3 SCRIPT_FILE=$(readlink -f $0)
4 SCRIPT_DIR=$(dirname $SCRIPT_FILE)
6 OUTDIR=$SCRIPT_DIR/Artifacts
8 RETRY_CMD="$SCRIPT_DIR/tools/scripts/retry.sh"
9 TIMEOUT_CMD="$SCRIPT_DIR/tools/scripts/timeout.sh"
10 DOTNET_CMD="$RETRY_CMD $TIMEOUT_CMD 600 dotnet"
12 RUN_BUILD="$DOTNET_CMD msbuild $SCRIPT_DIR/build/build.proj /nologo"
17 echo "Usage: $0 [command] [args]"
19 echo " build [module] Build a specific module"
20 echo " full Build all modules in src/ directory"
21 echo " ext Build external modules in externals/ directory"
22 echo " dummy Generate dummy assemblies of all modules"
23 echo " pack [version] Make a NuGet package with build artifacts"
24 echo " clean Clean all artifacts"
29 echo "No module specified."
32 if [ -d /nuget ]; then
33 NUGET_SOURCE_OPT="/p:RestoreSources=/nuget"
35 $RUN_BUILD /t:restore /p:Project=$1 $NUGET_SOURCE_OPT
36 $RUN_BUILD /t:build /p:Project=$1
40 if [ -d /nuget ]; then
41 NUGET_SOURCE_OPT="/p:RestoreSources=/nuget"
44 $RUN_BUILD /t:restore $NUGET_SOURCE_OPT
49 if [ -d /nuget ]; then
50 NUGET_SOURCE_OPT="/p:RestoreSources=/nuget"
52 $RUN_BUILD /t:restore $NUGET_SOURCE_OPT
53 $RUN_BUILD /t:dummy $NUGET_SOURCE_OPT
57 if [ -d /nuget ]; then
58 NUGET_SOURCE_OPT="/p:RestoreSources=/nuget;$SCRIPT_DIR/packages;$SCRIPT_DIR/Artifacts"
60 PROJECTS=$(ls -1 $SCRIPT_DIR/externals/*.proj)
61 for p in $PROJECTS; do
62 $DOTNET_CMD msbuild $p /t:Build $NUGET_SOURCE_OPT /nologo
68 if [ -z "$VERSION" ]; then
69 VERSION=$VERSION_PREFIX.$((10000+$(git rev-list --count HEAD)))
72 $RUN_BUILD /t:pack /p:Version=$VERSION
81 build|--build|-b) cmd_build $@ ;;
82 full |--full |-f) cmd_full_build $@ ;;
83 dummy|--dummy|-d) cmd_dummy_build $@ ;;
84 ext |--ext |-e) cmd_ext_build $@ ;;
85 pack |--pack |-p) cmd_pack $@ ;;
86 clean|--clean|-c) cmd_clean $@ ;;