3 SCRIPT_FILE=$(readlink -f $0)
4 SCRIPT_DIR=$(dirname $SCRIPT_FILE)
6 OUTDIR=$SCRIPT_DIR/Artifacts
8 RUN_BUILD="dotnet msbuild $SCRIPT_DIR/build/build.proj /nologo"
13 echo "Usage: $0 [command] [args]"
15 echo " build [module] Build a specific module"
16 echo " full Build all modules in src/ directory"
17 echo " dummy Generate dummy assemblies of all modules"
18 echo " pack [version] Make a NuGet package with build artifacts"
19 echo " install [target] Install assemblies to the target device"
20 echo " clean Clean all artifacts"
29 if [ -d /nuget ]; then
30 NUGET_SOURCE_OPT="/p:RestoreSources=/nuget"
32 $RUN_BUILD /t:restore $NUGET_SOURCE_OPT $@
33 $RUN_BUILD /t:build /fl $@
38 echo "No module specified."
42 build /p:Project=$PROJECT $@
52 build /p:BuildDesignAssembly=True $@
53 if [ -d "$OUTDIR"/bin/design ]; then
54 cp -f "$OUTDIR"/bin/design/*.Design.dll "$SCRIPT_DIR"/pkg/Tizen.NET.API*/design/
59 $RUN_BUILD /t:dummy $@
64 if [ -z "$VERSION" ]; then
65 pushd $SCRIPT_DIR > /dev/null
66 VERSION=$VERSION_PREFIX.$((10000+$(git rev-list --count HEAD)))
70 $RUN_BUILD /t:pack /p:Version=$VERSION
76 RUNTIME_ASSEMBLIES="$OUTDIR/bin/public/*.dll $OUTDIR/bin/internal/*.dll"
77 TARGET_ASSEMBLY_PATH="/usr/share/dotnet.tizen/framework"
79 device_cnt=$(sdb devices | grep -v "List" | wc -l)
80 if [ $device_cnt -eq 0 ]; then
81 echo "No connected devices"
85 if [ $device_cnt -gt 1 ] && [ -z "$DEVICE_ID" ]; then
86 echo "Multiple devices are connected. Specify the device. (ex: ./build.sh install [device-id])"
92 if [ -n "$DEVICE_ID" ]; then
93 SDB_OPTIONS="-s $DEVICE_ID"
96 sdb $SDB_OPTIONS root on
97 sdb $SDB_OPTIONS shell mount -o remount,rw /
98 sdb $SDB_OPTIONS push $RUNTIME_ASSEMBLIES $TARGET_ASSEMBLY_PATH
100 nifile_cnt=$(sdb $SDB_OPTIONS shell find $TARGET_ASSEMBLY_PATH -name '*.ni.dll' | wc -l)
101 if [ $nifile_cnt -gt 0 ]; then
102 sdb $SDB_OPTIONS shell "rm -f $TARGET_ASSEMBLY_PATH/*.ni.dll"
103 sdb $SDB_OPTIONS shell nitool --system
104 sdb $SDB_OPTIONS shell nitool --regen-all-app
107 sdb $SDB_OPTIONS shell chsmack -a '_' $TARGET_ASSEMBLY_PATH/*
116 build|--build|-b) cmd_build $@ ;;
117 full |--full |-f) cmd_full_build $@ ;;
118 dummy|--dummy|-d) cmd_dummy_build $@ ;;
119 design|--design) cmd_design_build $@ ;;
120 pack |--pack |-p) cmd_pack $@ ;;
121 install |--install |-i) cmd_install $@ ;;
122 clean|--clean|-c) cmd_clean $@ ;;