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
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
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