forked from dotnet/roslyn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cibuild.sh
executable file
·64 lines (56 loc) · 1.49 KB
/
cibuild.sh
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# Run the compilation. Can pass additional build arguments as parameters
docompile()
{
xbuild /v:m /p:SignAssembly=false /p:DebugSymbols=false /p:DefineConstants=COMPILERCORE,DEBUG $1 src/Compilers/CSharp/csc/csc.csproj
}
echo Changing mono snapshot
. mono-snapshot mono/20150316155603
if [ $? -ne 0 ]; then
echo Could not set mono snapshot
exit 1
fi
# NuGet on mono crashes about every 5th time we run it. This is causing
# Linux runs to fail frequently enough that we need to employ a
# temporary work around.
echo Restoring NuGet packages
i=5
while [ $i -gt 0 ]; do
mono src/.nuget/NuGet.exe restore src/Roslyn.sln
if [ $? -eq 0 ]; then
i=0
fi
done
if [ $? -ne 0 ]; then
echo NuGet Failed
exit 1
fi
echo Compiling using toolset compiler
docompile
if [ $? -ne 0 ]; then
echo Compilation failed
exit 1
fi
compiler_binaries=(
csc.exe
Microsoft.CodeAnalysis.dll
Microsoft.CodeAnalysis.Desktop.dll
Microsoft.CodeAnalysis.CSharp.dll
Microsoft.CodeAnalysis.CSharp.Desktop.dll
System.Collections.Immutable.dll
System.Reflection.Metadata.dll)
mkdir Binaries/Bootstrap
for i in ${compiler_binaries[@]}; do
cp Binaries/Debug/${i} Binaries/Bootstrap/${i}
if [ $? -ne 0 ]; then
echo Compilation failed
exit 1
fi
done
rm -rf Binaries/Debug
echo Compiling using bootstrap compiler
docompile /p:BootstrapBuild="$(pwd)/Binaries/Bootstrap"
if [ $? -ne 0 ]; then
echo Compilation failed
exit 1
fi