Skip to content

Commit

Permalink
Update build.cmd/netci.groovy to use VS2017 (microsoft#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregg-miskelly authored Jan 23, 2019
1 parent 627fe75 commit 651c7aa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
36 changes: 22 additions & 14 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
@echo off
setlocal

if not defined VisualStudioVersion (
if defined VS140COMNTOOLS (
call "%VS140COMNTOOLS%\VsDevCmd.bat"
goto :EnvSet
)
if NOT "%VSINSTALLDIR%"=="" goto InDevPrompt

echo Error: build.cmd requires Visual Studio 2015.
exit /b 1
)
set x86ProgramFiles=%ProgramFiles(x86)%
if "%x86ProgramFiles%"=="" set x86ProgramFiles=%ProgramFiles%
set VSWherePath=%x86ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe
if NOT exist "%VSWherePath%" echo ERROR: Could not find vswhere.exe (%VSWherePath%). Ensure that Visual Studio 2017 version 15.5 or newer is installed. & exit /b -1

if not exist "%VSSDK140Install%" (
echo Error: build.cmd requires the Visual Studio SDK to be installed.
exit /b 1
)
for /f "usebackq tokens=1 delims=" %%a in (`"%VSWherePath%" -version [15.0, -prerelease -property installationPath`) do call :ProcessIDE "%%a"
if NOT "%VSINSTALLDIR%"=="" goto InDevPrompt

echo ERROR: Unable to find a Visual Studio install.
exit /b -1

:InDevPrompt
set _buildproj=%~dp0BuildAndTest.proj
set _buildlog=%~dp0msbuild.log
set MSBuildCmd=msbuild "%_buildproj%" /nologo /maxcpucount /nodeReuse:false %*

msbuild "%_buildproj%" /nologo /maxcpucount /nodeReuse:false %*
echo %MSBuildCmd%
call %MSBuildCmd%
set BUILDERRORLEVEL=%ERRORLEVEL%

echo Build Exit Code = %BUILDERRORLEVEL%
exit /b %BUILDERRORLEVEL%
exit /b %BUILDERRORLEVEL%

:ProcessIDE
if NOT "%VSINSTALLDIR%"=="" goto :EOF
if NOT exist "%~1\Common7\Tools\VsDevCmd.bat" goto :EOF
echo Using Visual Studio from %1
call "%~1\Common7\Tools\VsDevCmd.bat"
goto :EOF
2 changes: 1 addition & 1 deletion netci.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def branch = GithubBranchName
// and calls made within that closure apply to the newly created job.
def newJob = job(newJobName) {
steps {
batchFile("call \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\VsDevCmd.bat\" && build.cmd /p:Configuration=${configuration}")
batchFile("call build.cmd /p:Configuration=${configuration}")
}
}

Expand Down

0 comments on commit 651c7aa

Please sign in to comment.