Antiforgery/build.cmd

40 строки
1.1 KiB
Batchfile
Исходник Обычный вид История

2016-01-12 02:53:38 +03:00
@ECHO off
SETLOCAL
2016-01-12 02:53:38 +03:00
SET REPO_FOLDER=%~dp0
CD "%REPO_FOLDER%"
SET BUILD_FOLDER=.build
SET KOREBUILD_FOLDER=%BUILD_FOLDER%\KoreBuild-dotnet
SET KOREBUILD_VERSION=
SET NUGET_PATH=%BUILD_FOLDER%\NuGet.exe
SET NUGET_VERSION=latest
SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe
2016-01-12 02:53:38 +03:00
IF NOT EXIST %BUILD_FOLDER% (
md %BUILD_FOLDER%
)
2016-01-12 02:53:38 +03:00
IF NOT EXIST %NUGET_PATH% (
IF NOT EXIST %CACHED_NUGET% (
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://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'"
)
copy %CACHED_NUGET% %NUGET_PATH% > nul
2015-10-12 22:47:15 +03:00
)
2016-01-12 02:53:38 +03:00
SET KOREBUILD_DOWNLOAD_ARGS=
IF NOT "%KOREBUILD_VERSION%"=="" (
SET KOREBUILD_DOWNLOAD_ARGS=-version %KOREBUILD_VERSION%
)
2016-01-12 02:53:38 +03:00
IF NOT EXIST %KOREBUILD_FOLDER% (
%BUILD_FOLDER%\nuget.exe install KoreBuild-dotnet -ExcludeVersion -o %BUILD_FOLDER% -nocache -pre %KOREBUILD_DOWNLOAD_ARGS%
)
2016-01-12 02:53:38 +03:00
"%KOREBUILD_FOLDER%\build\KoreBuild.cmd" %*