-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sh
executable file
·71 lines (63 loc) · 1.85 KB
/
build.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
64
65
66
67
68
69
70
71
## Build and optionally publish sub projects
##
## This script will by default build release versions of the tools.
## If publish (-p) is requested it will create standalone versions of the
## tools in <script_root>/bin.
##
## If frameworks (-f) are requested the script will create a scratch empty 'app'
## publish that contains the default frameworks. See ./src/packages/project.json
## for specific version numbers.
function usage
{
echo ""
echo "build.sh [-b <BUILD TYPE>] [-f] [-h] [-p]"
echo ""
echo " -b <BUILD TYPE> : Build type, can be Debug or Release."
echo " -h : Show this message."
echo " -f : Install default framework directory in <script_root>/fx."
echo " -p : Publish utilities."
echo ""
}
# defaults
buildType="Release"
publish=false
scriptDir="`dirname \"$0\"`"
platform="`dotnet --info | awk '/RID/ {print $2}'`"
# default install in 'bin' dir at script location
appInstallDir="$scriptDir/bin"
fxInstallDir="$scriptDir/fx"
# process for '-h', '-p', 'f', and '-b <arg>'
while getopts "hpfb:" opt; do
case "$opt" in
h)
usage
exit 0
;;
b)
buildType=$OPTARG
;;
p)
publish=true
;;
f)
fx=true
;;
esac
done
# declare the array of projects
declare -a projects=(mcgdiff corediff analyze cijobs)
# for each project either build or publish
for proj in "${projects[@]}"
do
if [ "$publish" == true ]; then
dotnet publish -c $buildType -o $appInstallDir/$proj ./src/$proj
else
dotnet build -c $buildType ./src/$proj
fi
done
# set up fx if requested.
if [ "$fx" == true ]; then
dotnet publish -c $buildType -o $fxInstallDir ./src/packages
# remove package version of mscorlib* - refer to core root version for diff testing.
rm $fxInstallDir/mscorlib*
fi