forked from dotnet/roslyn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cibuild.cmd
47 lines (38 loc) · 1.87 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
37
38
39
40
41
42
43
44
45
46
47
@setlocal enabledelayedexpansion
REM Parse Arguments.
set RoslynRoot=%~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\VC\vcvarsall.bat" x86
REM Build the compiler so we can self host it for the full build
src\.nuget\NuGet.exe restore %RoslynRoot%/src/Toolset.sln -packagesdirectory packages
msbuild /nologo /v:m /m %RoslynRoot%/src/Compilers/Core/VBCSCompiler/VBCSCompiler.csproj /p:Configuration=%BuildConfiguration%
msbuild /nologo /v:m /m %RoslynRoot%/src/Compilers/CSharp/csc2/csc2.csproj /p:Configuration=%BuildConfiguration%
msbuild /nologo /v:m /m %RoslynRoot%/src/Compilers/VisualBasic/vbc2/vbc2.csproj /p:Configuration=%BuildConfiguration%
mkdir %RoslynRoot%\Binaries\Bootstrap
move Binaries\%BuildConfiguration%\* %RoslynRoot%\Binaries\Bootstrap
msbuild /v:m /t:Clean src/Toolset.sln /p:Configuration=%BuildConfiguration%
taskkill /F /IM vbcscompiler.exe
msbuild /v:m /m /p:BootstrapBuildPath=%RoslynRoot%\Binaries\Bootstrap 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