[TCT][Scripts] Build and install using a single command 68/320368/2
authorUtkarsh Tiwari <utk.tiwari@samsung.com>
Thu, 14 Nov 2024 05:39:10 +0000 (11:09 +0530)
committerUtkarsh Tiwari <utk.tiwari@samsung.com>
Thu, 14 Nov 2024 05:41:58 +0000 (11:11 +0530)
Change-Id: Ied9a3c613a6be8a5da977aeffae79b833d6b5983
Signed-off-by: Utkarsh Tiwari <utk.tiwari@samsung.com>
scripts_tpk/tpkbuild.sh

index e38892e0462ff6bd8e7bb8adfe2f8825a06bc086..7042ce991bb220cdad33b19c8dceb2dee2fcdcf7 100755 (executable)
@@ -35,14 +35,20 @@ function helpusage {
     echo "<arch_type> = armv7l|x86 for 32bit architecture"
     echo "<arch_type> = aarch64|x86_64|riscv64 for 64bit architecture"
     echo "<device_type> = mobile|wearable|tizeniot|tv"
-    echo "commands description:"
+    echo "Commands Description:"
     echo "       build                 performs SDK build"
     echo "       install               install packages for execution"
     echo "       addmod                add a new 'c' module"
     echo "       rmmod                 remove a module"
-    echo "To build|install all the packages (itc,ctc and utc), usage: `basename $0` build|install <arch_type> <device_type>"
-    echo "To build|install all packages of a <build_type>, usage: `basename $0` build|install <build_type> <arch_type> <device_type>"
-    echo "addmod|rmmod is specific to build_type and module_name, usage: `basename $0` <addmod|rmmod> <build_type> <module_name>"
+       echo "       -i                         install after build without full install command"
+    echo "To build | install all the packages (itc,ctc and utc), usage: `basename $0` build | install <arch_type> <device_type>"
+    echo "To build | install all packages of a <build_type>, usage: `basename $0` build|install <build_type> <arch_type> <device_type>"
+       echo "To build | install specific or multiple packages in a single command of a <build_type>, usage: `basename $0` build <build_type> <package_name1>,<package_name2>,<package_name3> <arch_type> <device_type> -i"
+    echo "addmod | rmmod is specific to build_type and module_name, usage: `basename $0` <addmod|rmmod> <build_type> <module_name>"
+       echo "To build and install in a single command -i option to provide, usage is as below:"
+       echo "       all packages: `basename $0` build <arch_type> <device_type> -i"
+       echo "       all packages of a build type: `basename $0` build <build_type> <arch_type> <device_type> -i"
+       echo "       multiple packages of a build type: `basename $0` build <build_type> <package_name1>,<package_name2>,<package_name3> <arch_type> <device_type> -i"
     echo ""
     exit 1
 }
@@ -453,7 +459,6 @@ elif [ "rmmod" == "$1" ]; then
        if [ "$#" -gt  "3" ]; then echo "Usage: `basename $0` addmod <build_type> <module_name>"; exit 1; fi
        rm_module $2 $3
 elif [ "build" == "$1" ]; then
-
        if [ -d BuildLog_${PROFILE_TYPE}_${LOG_ARCH_TYPE} ];then
                rm -rf BuildLog_${PROFILE_TYPE}_${LOG_ARCH_TYPE}
        fi
@@ -465,14 +470,37 @@ elif [ "build" == "$1" ]; then
                build
 
        elif  [ "$#" -eq  "4" ]; then
-               check_tc_type $2 $3 $4
-               build $TESTCASE_TYPE
+               if [ "$4" =  "-i" ]; then
+                       build
+                       install
+               else
+                       check_tc_type $2 $3 $4
+                       build $TESTCASE_TYPE
+               fi
 
        elif  [ "$#" -eq  "5" ]; then
-               check_tc_type $2 $3 $4 $5
-               MODULE_NAME=$3
-               multi_build $MODULE_NAME
-               # build $TESTCASE_TYPE $MODULE_NAME
+
+               if [ "$5" =  "-i" ]; then
+                       check_tc_type $2 $3 $4
+                       build $TESTCASE_TYPE
+                       install $TESTCASE_TYPE
+               else
+                       check_tc_type $2 $3 $4 $5
+                       MODULE_NAME=$3
+                       multi_build $MODULE_NAME
+               fi
+
+       elif  [ "$#" -eq  "6" ]; then
+               if [ "$6" =  "-i" ]; then
+                       check_tc_type $2 $3 $4 $5
+                       MODULE_NAME=$3
+                       multi_build $MODULE_NAME
+                       multi_install $MODULE_NAME
+
+               else
+                       echo "Entered wrong number of arguments. Please check"
+                       helpusage
+               fi
 
        else
                echo "Entered wrong number of arguments"