build_def: Add update version script to prebuild command
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 8 Jun 2023 06:50:23 +0000 (15:50 +0900)
committer이상철/Tizen Platform Lab(SR)/삼성전자 <sc11.lee@samsung.com>
Thu, 8 Jun 2023 07:52:39 +0000 (16:52 +0900)
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
build_def.prop
update_version.sh [new file with mode: 0644]

index 5345090daa653cca8f4f113068bb7d086fd5912f..23c62832622740addfadd374cf031819317c26d9 100644 (file)
@@ -1,4 +1,4 @@
 PREBUILD_COMMAND =
-PREBUILD_COMMAND = sh copy_libs.sh
+PREBUILD_COMMAND = sh copy_libs.sh;sh update_version.sh
 POSTBUILD_COMMAND =
 POSTBUILD_DESC =
diff --git a/update_version.sh b/update_version.sh
new file mode 100644 (file)
index 0000000..c65131f
--- /dev/null
@@ -0,0 +1,8 @@
+echo "===== Update tizen-manifest.xml version ====="
+VER_SPEC=$(grep "Version" packaging/espp-service.spec | cut -f2 -d : | sed 's/ //g')
+VER_XML=$(grep -oP '(?<= version=").*?(?=">)' tizen-manifest.xml)
+if [ "${VER_SPEC}" != "${VER_XML}" ]; then
+       echo "update tizen-manifest.xml version: ${VER_XML} => ${VER_SPEC}"
+       sed -i "s/\( version=\"\)[^\"]*\(\">\)/\1${VER_SPEC}\2/" tizen-manifest.xml
+fi
+echo "============================================="