Updatng build.cmd to use cached NuGet.exe

This commit is contained in:
Pranav K 2014-02-02 08:31:24 -08:00
parent b8f5824114
commit 939f363a0e
1 changed files with 13 additions and 6 deletions

View File

@ -1,16 +1,23 @@
@echo off
cd %~dp0
IF EXIST .nuget\NuGet.exe goto restore
SETLOCAL
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 md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"
:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '.nuget\NuGet.exe'"
copy %CACHED_NUGET% .nuget\nuget.exe > nul
:restore
IF EXIST build goto run
IF EXIST packages\KoreBuild goto run
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
xcopy packages\KoreBuild\build build\ /Y
.nuget\NuGet.exe install Sake -version 0.2 -o packages
.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion
:run
packages\Sake.0.2\tools\Sake.exe -I build -f makefile.shade %*
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*