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 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
54 VERSION_FILE=$OUTDIR/Version.txt
55 if [ -f $VERSION_FILE ]; then
56 NUGET_VERSION_PREFIX=$(cat $VERSION_FILE | grep Prefix | cut -d: -f2 | sed 's/\r$//')
57 NUGET_VERSION_SUFFIX=$(cat $VERSION_FILE | grep Suffix | cut -d: -f2 | sed 's/\r$//')
58 NUGET_VERSION_OPT="-Version $NUGET_VERSION_PREFIX-$NUGET_VERSION_SUFFIX"
60 $NUGET_CMD pack $SCRIPT_DIR/pkg/Tizen.NET.Private.nuspec -Symbols -NoPackageAnalysis $NUGET_VERSION_OPT -BasePath $SCRIPT_DIR -OutputDirectory $OUTDIR
61 $NUGET_CMD pack $SCRIPT_DIR/pkg/Tizen.NET.nuspec -Symbols -NoPackageAnalysis $NUGET_VERSION_OPT -BasePath $SCRIPT_DIR -OutputDirectory $OUTDIR
65 if [ -d /nuget ]; then
66 NUGET_SOURCE_OPT="/p:RestoreSources=/nuget"
68 $RUN_BUILD_DUMMY $NUGET_SOURCE_OPT
71 OPTS=`getopt -o hcbfpd --long help,clean,build,full,pack,dummy -n 'build' -- "$@"`
72 if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; usage; exit 1 ; fi
84 -h|--help) FLAG_HELP=true; shift ;;
85 -b|--build) FLAG_BUILD=true; shift ;;
86 -f|--full) FLAG_FULL=true; shift ;;
87 -d|--dummy) FLAG_DUMMY=true; shift ;;
88 -p|--pack) FLAG_PACK=true; shift ;;
89 -c|--clean) FLAG_CLEAN=true; shift ;;
95 if $FLAG_HELP; then usage; exit 0; fi
96 if $FLAG_CLEAN; then cmd_clean; exit 0; fi
97 if $FLAG_FULL; then cmd_full_build; exit 0; fi
98 if $FLAG_BUILD; then cmd_build $@; exit 0; fi
99 if $FLAG_PACK; then cmd_pack $@; exit 0; fi
100 if $FLAG_DUMMY; then cmd_dummy_build; exit 0; fi