forked from augustoproiete/i-am-root-nuget-package
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cmd
25 lines (19 loc) · 797 Bytes
/
build.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@echo off
setlocal
cd %~dp0
set _version=%~1
if "%_version%"=="" set _version=0.0.1-local
set CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe
if exist %CACHED_NUGET% goto copynuget
echo Downloading latest version of NuGet.exe...
if not exist %LocalAppData%\NuGet mkdir %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' -OutFile '%CACHED_NUGET%'"
:copynuget
if exist .nuget\NuGet.exe goto run
mkdir .nuget
copy %CACHED_NUGET% .nuget\NuGet.exe > nul
.nuget\NuGet.exe Update -Self
:run
if not exist out mkdir out
.nuget\NuGet.exe pack "src\IAmRoot.nuspec" -Version %_version% -NoPackageAnalysis -NonInteractive -OutputDirectory out
goto :eof