[TCT][TPK Scripts][NONACR][Added support in tizen-manifest file for <background>...
authorShobhit Verma <shobhit.v@samsung.com>
Wed, 7 Sep 2016 14:43:29 +0000 (20:13 +0530)
committerShobhit Verma <shobhit.v@samsung.com>
Wed, 7 Sep 2016 14:43:29 +0000 (20:13 +0530)
Change-Id: I47613ded976cd4b6cba75f29a3bb55b5bfc56435
Signed-off-by: Shobhit Verma <shobhit.v@samsung.com>
scripts_tpk/tpk_create.sh

index e86457b..b00a35b 100755 (executable)
@@ -217,6 +217,11 @@ deploySourceFile() {
        do
                if [[ $line =~ "<service-application" ]]; then
                        sed -i 's/ui-application/service-application/g' tizen-manifest.xml
+                       flag=1
+               fi
+               if [[ $line =~ "<widget-application" ]]; then
+                       sed -i 's/ui-application/widget-application/g' tizen-manifest.xml
+                       flag=2
                fi
 
                # add datacontrol attribute for data-control module
@@ -226,11 +231,10 @@ deploySourceFile() {
                        echo $line >> tizen-manifest.xml
                        echo '</ui-application>' >> tizen-manifest.xml
                        echo '</manifest>' >> tizen-manifest.xml
-                       echo "$(cat tizen-manifest.xml)"
+                       #echo "$(cat tizen-manifest.xml)"
                fi
-
                
-               if [[ $line =~ "</ui-application>" ]] || [[ $line =~ "</service-application>" ]]
+               if [[ $line =~ "</ui-application>" ]] || [[ $line =~ "</service-application>" ]] || [[ $line =~ "</widget-application>" ]]
                then
                        sed -i '/<\/manifest>/d' tizen-manifest.xml
                        while true
@@ -246,6 +250,25 @@ deploySourceFile() {
                fi
        done < $xmlfilepath
        sed -i 's/example/tizen/g' tizen-manifest.xml
+       
+       BACKGROUND_DATA="<background-category value=\"background-network\"\/>\n \
+       <background-category value=\"download\"\/>\n \
+       <background-category value=\"iot-communication\"\/>\n \
+       <background-category value=\"location\"\/>\n \
+       <background-category value=\"media\"\/>\n \
+       <background-category value=\"sensor\"\/>\n"
+       
+       if [ $flag == 1 ]; then
+               BACKGROUND_DATA+="<\/service-application>"
+               sed -i "s/<\/service-application>/${BACKGROUND_DATA}/" tizen-manifest.xml
+       elif [ $flag == 2 ]; then
+               BACKGROUND_DATA+="<\/widget-application>"
+               sed -i "s/<\/widget-application>/${BACKGROUND_DATA}/" tizen-manifest.xml
+       else
+               BACKGROUND_DATA+="<\/ui-application>"
+               sed -i "s/<\/ui-application>/${BACKGROUND_DATA}/" tizen-manifest.xml
+       fi  
+       
        echo $green"Source files copied and xml modified successfully"
 
        ## Module specific changes start