3 SCRIPT_FILE=$(readlink -f $0)
4 SCRIPT_DIR=$(dirname $SCRIPT_FILE)
7 OUTDIR=$SCRIPT_DIR/Artifacts
9 NUGET_CMD="mono $SCRIPT_DIR/tools/NuGet.exe"
11 RETRY_CMD="$SCRIPT_DIR/tools/retry.sh"
12 TIMEOUT_CMD="$SCRIPT_DIR/tools/timeout.sh"
14 DOTNET_CMD="$RETRY_CMD $TIMEOUT_CMD 600 dotnet"
16 RUN_BUILD="$DOTNET_CMD msbuild $SCRIPT_DIR/build/build.proj"
17 RUN_BUILD_DUMMY="$DOTNET_CMD build $SCRIPT_DIR/build/build.dummy.csproj"
21 echo "Usage: $0 [options] [args]"
23 echo " -h, --help Show this usages message"
24 echo " -b, --build [module] Build a module"
25 echo " -f, --full Build all modules in src/ directory"
26 echo " -d, --dummy Build dummy modules"
27 echo " -p, --pack [version] Make nuget packages"
28 echo " -c, --clean Clean all artifacts"
37 echo "No module specified."
40 if [ -d /nuget ]; then
41 NUGET_SOURCE_OPT="/p:RestoreSources=/nuget"
43 $RUN_BUILD /t:build /p:Project=$1 $NUGET_SOURCE_OPT
47 if [ -d /nuget ]; then
48 NUGET_SOURCE_OPT="/p:RestoreSources=/nuget"
50 $RUN_BUILD /t:build $NUGET_SOURCE_OPT
55 NUGET_VERSION_OPT="-Version $1"
58 $NUGET_CMD pack $SCRIPT_DIR/pkg/Tizen.NET.Private.nuspec -Symbols -NoPackageAnalysis $NUGET_VERSION_OPT -BasePath $SCRIPT_DIR -OutputDirectory $OUTDIR
59 $NUGET_CMD pack $SCRIPT_DIR/pkg/Tizen.NET.nuspec -Symbols -NoPackageAnalysis $NUGET_VERSION_OPT -BasePath $SCRIPT_DIR -OutputDirectory $OUTDIR
63 if [ -d /nuget ]; then
64 NUGET_SOURCE_OPT="/p:RestoreSources=/nuget"
66 $RUN_BUILD_DUMMY $NUGET_SOURCE_OPT
69 OPTS=`getopt -o hcbfpd --long help,clean,build,full,pack,dummy -n 'build' -- "$@"`
70 if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; usage; exit 1 ; fi
82 -h|--help) FLAG_HELP=true; shift ;;
83 -b|--build) FLAG_BUILD=true; shift ;;
84 -f|--full) FLAG_FULL=true; shift ;;
85 -d|--dummy) FLAG_DUMMY=true; shift ;;
86 -p|--pack) FLAG_PACK=true; shift ;;
87 -c|--clean) FLAG_CLEAN=true; shift ;;
93 if $FLAG_HELP; then usage; exit 0; fi
94 if $FLAG_CLEAN; then cmd_clean; exit 0; fi
95 if $FLAG_FULL; then cmd_full_build; exit 0; fi
96 if $FLAG_BUILD; then cmd_build $@; exit 0; fi
97 if $FLAG_PACK; then cmd_pack $@; exit 0; fi
98 if $FLAG_DUMMY; then cmd_dummy_build; exit 0; fi