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"
25 echo "No module specified."
28 if [ -d /nuget ]; then
29 NUGET_SOURCE_OPT="/p:RestoreSources=/nuget"
32 $RUN_BUILD /t:restore /p:Project=$PROJECT $NUGET_SOURCE_OPT $@
33 $RUN_BUILD /t:build /p:Project=$PROJECT $@
37 if [ -d /nuget ]; then
38 NUGET_SOURCE_OPT="/p:RestoreSources=/nuget"
42 $RUN_BUILD /t:restore $NUGET_SOURCE_OPT $@
43 $RUN_BUILD /t:build /fl $@
53 if [ -z "$VERSION" ]; then
54 pushd $SCRIPT_DIR > /dev/null
55 VERSION=$VERSION_PREFIX.$((10000+$(git rev-list --count HEAD)))
59 $RUN_BUILD /t:pack /p:Version=$VERSION
65 RUNTIME_ASSEMBLIES="$OUTDIR/bin/public/*.dll $OUTDIR/bin/internal/*.dll"
66 TARGET_ASSEMBLY_PATH="/usr/share/dotnet.tizen/framework"
68 device_cnt=$(sdb devices | grep -v "List" | wc -l)
69 if [ $device_cnt -eq 0 ]; then
70 echo "No connected devices"
74 if [ $device_cnt -gt 1 ] && [ -z "$DEVICE_ID" ]; then
75 echo "Multiple devices are connected. Specify the device. (ex: ./build.sh install [device-id])"
81 if [ -n "$DEVICE_ID" ]; then
82 SDB_OPTIONS="-s $DEVICE_ID"
85 sdb $SDB_OPTIONS root on
86 sdb $SDB_OPTIONS shell mount -o remount,rw /
87 sdb $SDB_OPTIONS push $RUNTIME_ASSEMBLIES $TARGET_ASSEMBLY_PATH
89 nifile_cnt=$(sdb $SDB_OPTIONS shell find $TARGET_ASSEMBLY_PATH -name '*.ni.dll' | wc -l)
90 if [ $nifile_cnt -gt 0 ]; then
91 sdb $SDB_OPTIONS shell "rm -f $TARGET_ASSEMBLY_PATH/*.ni.dll"
92 sdb $SDB_OPTIONS shell nitool --system
93 sdb $SDB_OPTIONS shell nitool --regen-all-app
96 sdb $SDB_OPTIONS shell chsmack -a '_' $TARGET_ASSEMBLY_PATH/*
105 build|--build|-b) cmd_build $@ ;;
106 full |--full |-f) cmd_full_build $@ ;;
107 dummy|--dummy|-d) cmd_dummy_build $@ ;;
108 pack |--pack |-p) cmd_pack $@ ;;
109 install |--install |-i) cmd_install $@ ;;
110 clean|--clean|-c) cmd_clean $@ ;;