[TCT][Scripts][NonACR]multiple modules build and install feature is added 59/285459/6
authorPrashant Kumar Jangid <p.jangid@samsung.com>
Tue, 13 Dec 2022 06:45:48 +0000 (12:15 +0530)
committershobhit verma <shobhit.v@samsung.com>
Tue, 13 Dec 2022 10:20:20 +0000 (10:20 +0000)
Usage:
sudo ./tpkbuild build itc dlog,bluetooth,camera armv7l mobile
sudo ./tpkbuild install itc dlog,bluetooth,camera armv7l mobile

Change-Id: Ie7616ca24601b4373d34b488734e7be58b3e3303
Signed-off-by: Prashant Kumar Jangid <p.jangid@samsung.com>
scripts_tpk/tpkbuild.sh

index 47914b27e4704333cfeec1e0722e6d99766a0027..4be05309aa6f79baab8abbaf39744811837844b2 100755 (executable)
@@ -23,6 +23,9 @@ TESTCASE_TYPE=""
 MODULE_NAME=""
 TC_COUNT=""
 
+green=`tput setaf 2`
+reset=`tput sgr0`
+bold=`tput bold`
 
 function helpusage {
 # usage note
@@ -46,7 +49,7 @@ function helpusage {
 
 INSTALL_CHILD=0
 
-if   [ "$1" != "addmod" ] && [ "$1" != "rmmod" ]; then
+if   [ "$1" != "addmod" ] && [ "$1" != "rmmod" ] ; then
        if [ "$2" = "mobile" ] || [ "$3" = "mobile" ] || [ "$4" = "mobile" ] || [ "$5" = "mobile" ]; then
                PROFILE_TYPE="mobile"
        elif [ "$2" = "wearable" ] || [ "$3" = "wearable"  ] || [ "$4" = "wearable"  ] || [ "$5" = "wearable"  ]; then
@@ -240,6 +243,23 @@ function install_custom {
 
 }
 
+function multi_build {
+       IFS=','
+       read -ra module_arr<<< $*
+       for module_name_seperated in "${module_arr[@]}";
+       do
+               echo $green$bold"Build Started for module :${module_name_seperated}"$reset
+               build $TESTCASE_TYPE $module_name_seperated
+       done
+}
+function multi_install {
+       IFS=','
+       read -ra module_arr<<< $*
+       for module_name_seperated in "${module_arr[@]}";do
+       echo $green$bold"Installing module :${module_name_seperated}"$reset
+       install $TESTCASE_TYPE $module_name_seperated
+       done
+}
 # d_showVar VARNAME -- print bash variable name
 function d_showVar { if [ "$ARG" == "-d" -a -n "$1" ]; then echo "d >> ${1} = ${!1}"; fi }
 # keyprompt "introductory message" -- wait until any key pressed
@@ -432,7 +452,8 @@ elif [ "build" == "$1" ]; then
        elif  [ "$#" -eq  "5" ]; then
                check_tc_type $2 $3 $4 $5
                MODULE_NAME=$3
-               build $TESTCASE_TYPE $MODULE_NAME
+               multi_build $MODULE_NAME
+               # build $TESTCASE_TYPE $MODULE_NAME
 
        else
                echo "Entered wrong number of arguments"
@@ -451,7 +472,8 @@ elif [ "install" == "$1" ]; then
        elif  [ "$#" -eq  "5" ]; then
                check_tc_type $2 $3 $4 $5
                MODULE_NAME=$3
-               install $TESTCASE_TYPE $MODULE_NAME
+               multi_install $MODULE_NAME
+               # install $TESTCASE_TYPE $MODULE_NAME
 
        else
                echo "Entered wrong number of arguments"
@@ -519,7 +541,6 @@ elif [ "install_custom" == "$1" ]; then
                echo "Entered wrong number of arguments"
                helpusage
        fi
-
 else
        echo "Entered invalid arguments"
        helpusage