From 92bded88c1a2e3fc1e31b850a406d6d7d5a9086c Mon Sep 17 00:00:00 2001 From: Lambert Clara Date: Sat, 1 Jun 2019 11:01:59 +0200 Subject: [PATCH] Fix AppVeyor CI - AppVeyor now uses vs2017 image - Use nuget restore instead of dotnet restore - Use msbuild -t:build -restore to get proper nuget package restoration in CompileSharpmake.bat --- .appveyor.yml | 4 ++-- CompileSharpmake.bat | 22 ++-------------------- bootstrap-sharpmake.bat | 16 ---------------- 3 files changed, 4 insertions(+), 38 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index d192aa0da..c94effd9b 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,6 +1,6 @@ # Sharpmake AppVeyor CI configuration -image: Visual Studio 2015 +image: Visual Studio 2017 platform: - Any CPU @@ -11,7 +11,7 @@ configuration: before_build: - cmd: bootstrap-sharpmake.bat -- cmd: dotnet restore +- cmd: nuget restore Sharpmake.sln build: project: Sharpmake.sln diff --git a/CompileSharpmake.bat b/CompileSharpmake.bat index a185a5922..3526c2c11 100644 --- a/CompileSharpmake.bat +++ b/CompileSharpmake.bat @@ -29,32 +29,14 @@ echo MSBuild batch path: !VSMSBUILDCMD! call !VSMSBUILDCMD! if %errorlevel% NEQ 0 goto end -call :NugetRestore %1 win -if %errorlevel% NEQ 0 goto end - call :BuildSharpmake %1 %2 %3 -if %errorlevel% NEQ 0 goto end - - -:: Restore nuget -:NugetRestore -echo Restoring nuget packages for %~1 - -set DOTNET_RESTORE=dotnet restore "%~1" -if "%~2" neq "" set DOTNET_RESTORE=%DOTNET_RESTORE% -r %2 -echo %DOTNET_RESTORE% -%DOTNET_RESTORE% -if %errorlevel% NEQ 0 ( - echo ERROR: Failed to restore nuget package for %~1 - exit /b 1 -) -exit /b 0 +goto end :: Build Sharpmake using specified arguments :BuildSharpmake echo Compiling %~1 in "%~2|%~3"... -set MSBUILD_CMD=msbuild "%~1" /nologo /verbosity:quiet /p:Configuration="%~2" /p:Platform="%~3" +set MSBUILD_CMD=msbuild -t:build -restore "%~1" /nologo /verbosity:quiet /p:Configuration="%~2" /p:Platform="%~3" echo %MSBUILD_CMD% %MSBUILD_CMD% if %errorlevel% NEQ 0 ( diff --git a/bootstrap-sharpmake.bat b/bootstrap-sharpmake.bat index 10ee91c0d..8e7e28b02 100644 --- a/bootstrap-sharpmake.bat +++ b/bootstrap-sharpmake.bat @@ -13,24 +13,8 @@ echo %SM_CMD% %SM_CMD% if %errorlevel% NEQ 0 goto error -call :NugetRestore Sharpmake.sln win -if %errorlevel% NEQ 0 goto error - goto success -:NugetRestore -echo Restoring nuget packages for %~1 - -set DOTNET_RESTORE=dotnet restore "%~1" -if "%~2" neq "" set DOTNET_RESTORE=%DOTNET_RESTORE% -r %2 -echo %DOTNET_RESTORE% -%DOTNET_RESTORE% -if %errorlevel% NEQ 0 ( - echo ERROR: Failed to restore nuget package for %~1 - exit /b 1 -) -exit /b 0 - @REM ----------------------------------------------------------------------- :success COLOR 2F