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 $@
52 if [ -z "$VERSION" ]; then
53 VERSION=$VERSION_PREFIX.$((10000+$(git rev-list --count HEAD)))
56 $RUN_BUILD /t:pack /p:Version=$VERSION
62 RUNTIME_ASSEMBLIES="$OUTDIR/bin/public/*.dll $OUTDIR/bin/internal/*.dll"
63 TARGET_ASSEMBLY_PATH="/usr/share/dotnet.tizen/framework"
65 device_cnt=$(sdb devices | grep -v "List" | wc -l)
66 if [ $device_cnt -eq 0 ]; then
67 echo "No connected devices"
71 if [ $device_cnt -gt 1 ] && [ -z "$DEVICE_ID" ]; then
72 echo "Multiple devices are connected. Specify the device. (ex: ./build.sh install [device-id])"
78 if [ -n "$DEVICE_ID" ]; then
79 SDB_OPTIONS="-s $DEVICE_ID"
82 sdb $SDB_OPTIONS root on
83 sdb $SDB_OPTIONS shell mount -o remount,rw /
84 sdb $SDB_OPTIONS push $RUNTIME_ASSEMBLIES $TARGET_ASSEMBLY_PATH
86 nifile_cnt=$(sdb $SDB_OPTIONS shell find $TARGET_ASSEMBLY_PATH -name '*.ni.dll' | wc -l)
87 if [ $nifile_cnt -gt 0 ]; then
88 sdb $SDB_OPTIONS shell "rm -f $TARGET_ASSEMBLY_PATH/*.ni.dll"
89 sdb $SDB_OPTIONS shell nitool --system
90 sdb $SDB_OPTIONS shell nitool --regen-all-app
93 sdb $SDB_OPTIONS shell chsmack -a '_' $TARGET_ASSEMBLY_PATH/*
102 build|--build|-b) cmd_build $@ ;;
103 full |--full |-f) cmd_full_build $@ ;;
104 dummy|--dummy|-d) cmd_dummy_build $@ ;;
105 pack |--pack |-p) cmd_pack $@ ;;
106 install |--install |-i) cmd_install $@ ;;
107 clean|--clean|-c) cmd_clean $@ ;;