提交 263210d9 编写于 作者: D David Poeschl

Update stabilization cibuild scripts

The cibuild scripts had diverged between stabilization and master. This
change brings stabilization back in sync with master and makes a small
change to ensure passing invalid commandline arguments returns a proper
error code.
上级 746b38e0
@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 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 REM Build the compiler so we can self host it for the full build
src\.nuget\NuGet.exe restore src\Toolset.sln -packagesdirectory packages src\.nuget\NuGet.exe restore %RoslynRoot%/src/Toolset.sln -packagesdirectory packages
msbuild /nologo /v:m /m src/Compilers/Core/VBCSCompiler/VBCSCompiler.csproj msbuild /nologo /v:m /m %RoslynRoot%/src/Compilers/Core/VBCSCompiler/VBCSCompiler.csproj /p:Configuration=%BuildConfiguration%
msbuild /nologo /v:m /m src/Compilers/CSharp/csc2/csc2.csproj msbuild /nologo /v:m /m %RoslynRoot%/src/Compilers/CSharp/csc2/csc2.csproj /p:Configuration=%BuildConfiguration%
msbuild /nologo /v:m /m src/Compilers/VisualBasic/vbc2/vbc2.csproj msbuild /nologo /v:m /m %RoslynRoot%/src/Compilers/VisualBasic/vbc2/vbc2.csproj /p:Configuration=%BuildConfiguration%
mkdir Binaries\Bootstrap mkdir %RoslynRoot%\Binaries\Bootstrap
move Binaries\Debug\* Binaries\Bootstrap move Binaries\%BuildConfiguration%\* %RoslynRoot%\Binaries\Bootstrap
msbuild /v:m /t:Clean src/Toolset.sln msbuild /v:m /t:Clean src/Toolset.sln /p:Configuration=%BuildConfiguration%
taskkill /F /IM vbcscompiler.exe taskkill /F /IM vbcscompiler.exe
msbuild /v:m /m /p:BootstrapBuildPath=%~dp0\Binaries\Bootstrap BuildAndTest.proj /p:CIBuild=true msbuild /v:m /m /p:BootstrapBuildPath=%RoslynRoot%\Binaries\Bootstrap BuildAndTest.proj /p:CIBuild=true /p:Configuration=%BuildConfiguration%
if ERRORLEVEL 1 ( if ERRORLEVEL 1 (
taskkill /F /IM vbcscompiler.exe taskkill /F /IM vbcscompiler.exe
echo Build failed echo Build failed
...@@ -25,3 +39,9 @@ taskkill /F /IM vbcscompiler.exe ...@@ -25,3 +39,9 @@ taskkill /F /IM vbcscompiler.exe
REM It is okay and expected for taskkill to fail (it's a cleanup routine). Ensure REM It is okay and expected for taskkill to fail (it's a cleanup routine). Ensure
REM caller sees successful exit. REM caller sees successful exit.
exit /b 0 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
\ No newline at end of file
#!/bin/bash #!/usr/bin/env bash
usage() usage()
{ {
...@@ -7,12 +7,13 @@ usage() ...@@ -7,12 +7,13 @@ usage()
echo "" echo ""
echo "Options" echo "Options"
echo " --mono-path <path> Path to the mono installation to use for the run" echo " --mono-path <path> Path to the mono installation to use for the run"
echo " --os <os> OS to run (Linux / Darwin)" echo " --os <os> OS to run (Linux / Darwin)"
echo " --minimal Run a minimal set of suites (used when upgrading mono)" echo " --minimal Run a minimal set of suites (used when upgrading mono)"
} }
XUNIT_VERSION=2.0.0-alpha-build2576 XUNIT_VERSION=2.0.0-alpha-build2576
FULL_RUN=true FULL_RUN=true
BUILD_CONFIGURATION=Debug
OS_NAME=$(uname -s) OS_NAME=$(uname -s)
while [[ $# > 0 ]] while [[ $# > 0 ]]
...@@ -35,6 +36,14 @@ do ...@@ -35,6 +36,14 @@ do
FULL_RUN=false FULL_RUN=false
shift 1 shift 1
;; ;;
--debug)
BUILD_CONFIGURATION=Debug
shift 1
;;
--release)
BUILD_CONFIGURATION=Release
shift 1
;;
*) *)
usage usage
exit 1 exit 1
...@@ -74,15 +83,15 @@ compile_toolset() ...@@ -74,15 +83,15 @@ compile_toolset()
{ {
echo Compiling the toolset compilers echo Compiling the toolset compilers
echo -e "\tCompiling the C# compiler" echo -e "\tCompiling the C# compiler"
run_xbuild src/Compilers/CSharp/csc/csc.csproj run_xbuild src/Compilers/CSharp/csc/csc.csproj /p:Configuration=$BUILD_CONFIGURATION
if [ "$FULL_RUN" = "true" ]; then if [ "$FULL_RUN" = "true" ]; then
echo -e "\tCompiling VB compiler" echo -e "\tCompiling VB compiler"
run_xbuild src/Compilers/VisualBasic/vbc/vbc.csproj run_xbuild src/Compilers/VisualBasic/vbc/vbc.csproj /p:Configuration=$BUILD_CONFIGURATION
fi fi
} }
# Save the toolset binaries from Binaries/Debug to Binaries/Bootstrap # Save the toolset binaries from Binaries/BUILD_CONFIGURATION to Binaries/Bootstrap
save_toolset() save_toolset()
{ {
local compiler_binaries=( local compiler_binaries=(
...@@ -101,7 +110,7 @@ save_toolset() ...@@ -101,7 +110,7 @@ save_toolset()
mkdir Binaries/Bootstrap mkdir Binaries/Bootstrap
for i in ${compiler_binaries[@]}; do for i in ${compiler_binaries[@]}; do
cp Binaries/Debug/${i} Binaries/Bootstrap/${i} cp Binaries/$BUILD_CONFIGURATION/${i} Binaries/Bootstrap/${i}
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo Saving bootstrap binaries failed echo Saving bootstrap binaries failed
exit 1 exit 1
...@@ -114,8 +123,8 @@ save_toolset() ...@@ -114,8 +123,8 @@ save_toolset()
clean_roslyn() clean_roslyn()
{ {
echo Cleaning the enlistment echo Cleaning the enlistment
xbuild /v:m /t:Clean src/Toolset.sln xbuild /v:m /t:Clean src/Toolset.sln /p:Configuration=$BUILD_CONFIGURATION
rm -rf Binaries/Debug rm -rf Binaries/$BUILD_CONFIGURATION
} }
build_roslyn() build_roslyn()
...@@ -126,10 +135,10 @@ build_roslyn() ...@@ -126,10 +135,10 @@ build_roslyn()
if [ "$FULL_RUN" = "true" ]; then if [ "$FULL_RUN" = "true" ]; then
echo -e "\tCompiling CrossPlatform.sln" echo -e "\tCompiling CrossPlatform.sln"
run_xbuild $BOOTSTRAP_ARG src/CrossPlatform.sln run_xbuild $BOOTSTRAP_ARG src/CrossPlatform.sln /p:Configuration=$BUILD_CONFIGURATION
else else
echo -e "\tCompiling the C# compiler" echo -e "\tCompiling the C# compiler"
run_xbuild $BOOTSTRAP_ARG src/Compilers/CSharp/csc/csc.csproj run_xbuild $BOOTSTRAP_ARG src/Compilers/CSharp/csc/csc.csproj /p:Configuration=$BUILD_CONFIGURATION
fi fi
} }
...@@ -201,7 +210,7 @@ test_roslyn() ...@@ -201,7 +210,7 @@ test_roslyn()
for i in "${test_binaries[@]}" for i in "${test_binaries[@]}"
do do
mono $xunit_runner Binaries/Debug/$i.dll -xml Binaries/Debug/$i.TestResults.xml -noshadow mono $xunit_runner Binaries/$BUILD_CONFIGURATION/$i.dll -xml Binaries/$BUILD_CONFIGURATION/$i.TestResults.xml -noshadow
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
any_failed=true any_failed=true
fi fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册