3 SCRIPT_FILE=$(readlink -f $0)
4 SCRIPT_DIR=$(dirname $SCRIPT_FILE)
7 OUTDIR=$SCRIPT_DIR/Artifacts
8 NUGET_CMD="mono $SCRIPT_DIR/tools/NuGet.exe"
11 echo "Usage: $0 [options] [args]"
13 echo " -h, --help Show this usages message"
14 echo " -b, --build [module] Build a module"
15 echo " -f, --full Build all modules in src/ directory. The module should be added in pkg/Tizen.NET.Private.sln"
16 echo " -d, --dummy Build dummy modules"
17 echo " -p, --pack Make nuget packages"
18 echo " -c, --clean Clean all artifacts"
23 LIST=$(find $SCRIPT_DIR -type d -a -name bin -o -name obj)
31 echo "No module specified."
34 dotnet build $SCRIPT_DIR/src/$1 --configuration=Release --output=$OUTDIR/bin
38 dotnet build $SCRIPT_DIR/pkg/Tizen.NET.Private.sln --configuration=Release --output=$OUTDIR/bin
42 VERSION_FILE=$OUTDIR/Version.txt
43 if [ -f $VERSION_FILE ]; then
44 NUGET_VERSION_PREFIX=$(cat $VERSION_FILE | grep Prefix | cut -d: -f2 | sed 's/\r$//')
45 NUGET_VERSION_SUFFIX=$(cat $VERSION_FILE | grep Suffix | cut -d: -f2 | sed 's/\r$//')
46 NUGET_VERSION_OPT="-Version $NUGET_VERSION_PREFIX-$NUGET_VERSION_SUFFIX"
48 $NUGET_CMD pack $SCRIPT_DIR/pkg/Tizen.NET.Private.nuspec -Symbols -NoPackageAnalysis $NUGET_VERSION_OPT -BasePath $OUTDIR -OutputDirectory $OUTDIR
49 $NUGET_CMD pack $SCRIPT_DIR/pkg/Tizen.NET.nuspec -Symbols -NoPackageAnalysis $NUGET_VERSION_OPT -BasePath $OUTDIR -OutputDirectory $OUTDIR
53 dotnet build $SCRIPT_DIR/pkg/Tizen.NET.Dummy.csproj --configuration=Release
56 OPTS=`getopt -o hcbfpd --long help,clean,build,full,pack,dummy -n 'build' -- "$@"`
57 if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; usage; exit 1 ; fi
69 -h|--help) FLAG_HELP=true; shift ;;
70 -b|--build) FLAG_BUILD=true; shift ;;
71 -f|--full) FLAG_FULL=true; shift ;;
72 -d|--dummy) FLAG_DUMMY=true; shift ;;
73 -p|--pack) FLAG_PACK=true; shift ;;
74 -c|--clean) FLAG_CLEAN=true; shift ;;
80 if $FLAG_HELP; then usage; exit 0; fi
81 if $FLAG_CLEAN; then cmd_clean; exit 0; fi
82 if $FLAG_FULL; then cmd_full_build; exit 0; fi
83 if $FLAG_BUILD; then cmd_build $@; exit 0; fi
84 if $FLAG_PACK; then cmd_pack $@; exit 0; fi
85 if $FLAG_DUMMY; then cmd_dummy_build; exit 0; fi