forked from dotnet/roslyn-analyzers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cibuild.cmd
36 lines (29 loc) · 1.11 KB
/
cibuild.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
@setlocal enabledelayedexpansion
REM Parse Arguments.
set AnalyzersRoot=%~dp0
set BuildConfiguration=Debug
:ParseArguments
if "%1" == "" goto :DoneParsing
if /I "%1" == "/?" call :Usage && exit /b 1
if /I "%1" == "/debug" set BuildConfiguration=Debug&&shift&& goto :ParseArguments
if /I "%1" == "/release" set BuildConfiguration=Release&&shift&& goto :ParseArguments
call :Usage && exit /b 1
:DoneParsing
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat"
msbuild /v:m /m BuildAndTest.proj /p:CIBuild=true /p:Configuration=%BuildConfiguration%
if ERRORLEVEL 1 (
taskkill /F /IM vbcscompiler.exe
echo Build failed
exit /b 1
)
REM Kill any instances of VBCSCompiler.exe to release locked files;
REM otherwise future CI runs may fail while trying to delete those files.
taskkill /F /IM vbcscompiler.exe
REM It is okay and expected for taskkill to fail (it's a cleanup routine). Ensure
REM caller sees successful exit.
exit /b 0
:Usage
@echo Usage: cibuild.cmd [/debug^|/release]
@echo /debug Perform debug build. This is the default.
@echo /release Perform release build
@goto :eof