Skip to content

Commit

Permalink
Fix AppVeyor CI
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
belkiss committed Jun 1, 2019
1 parent 1b753ea commit 92bded8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sharpmake AppVeyor CI configuration

image: Visual Studio 2015
image: Visual Studio 2017

platform:
- Any CPU
Expand All @@ -11,7 +11,7 @@ configuration:

before_build:
- cmd: bootstrap-sharpmake.bat
- cmd: dotnet restore
- cmd: nuget restore Sharpmake.sln

build:
project: Sharpmake.sln
Expand Down
22 changes: 2 additions & 20 deletions CompileSharpmake.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
16 changes: 0 additions & 16 deletions bootstrap-sharpmake.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 92bded8

Please sign in to comment.