gn2bp: Fix version script character escaping
* It seems that an apostrophe is required for the command to be executed successfully
Test: update_results.sh && m cronet_aml_components_cronet_android_cronet
Change-Id: Ide44e8be9d7db6894cb5bf1bcf0c3e4d67c2a228
diff --git a/tools/gn2bp/Android.bp.swp b/tools/gn2bp/Android.bp.swp
index e6f3978..401ffca 100644
--- a/tools/gn2bp/Android.bp.swp
+++ b/tools/gn2bp/Android.bp.swp
@@ -7841,7 +7841,7 @@
"-f " +
"$(location build/util/LASTCHANGE) " +
"-e " +
- "API_LEVEL=20 " +
+ "'API_LEVEL=20' " +
"-o " +
"$(out) " +
"$(location components/cronet/android/java/src/org/chromium/net/impl/ImplVersion.template)",
@@ -7882,7 +7882,7 @@
"-f " +
"$(location build/util/LASTCHANGE) " +
"-e " +
- "API_LEVEL=20 " +
+ "'API_LEVEL=20' " +
"-o " +
"$(out) " +
"$(location components/cronet/android/api/src/org/chromium/net/ApiVersion.template)",
@@ -8261,7 +8261,7 @@
cmd: "$(location build/util/version.py) -f " +
"$(location chrome/VERSION) " +
"-e " +
- "VERSION_FULL=\"%s.%s.%s.%s\" % (MAJOR,MINOR,BUILD,PATCH) " +
+ "'VERSION_FULL=\"%s.%s.%s.%s\" % (MAJOR,MINOR,BUILD,PATCH)' " +
"-o " +
"$(out) " +
"$(location components/cronet/version.h.in)",
@@ -8286,7 +8286,7 @@
cmd: "$(location build/util/version.py) -f " +
"$(location chrome/VERSION) " +
"-e " +
- "VERSION_FULL=\"%s.%s.%s.%s\" % (MAJOR,MINOR,BUILD,PATCH) " +
+ "'VERSION_FULL=\"%s.%s.%s.%s\" % (MAJOR,MINOR,BUILD,PATCH)' " +
"-o " +
"$(out) " +
"$(location components/cronet/version.h.in)",
@@ -8311,7 +8311,7 @@
cmd: "$(location build/util/version.py) -f " +
"$(location chrome/VERSION) " +
"-e " +
- "VERSION_FULL=\"%s.%s.%s.%s\" % (MAJOR,MINOR,BUILD,PATCH) " +
+ "'VERSION_FULL=\"%s.%s.%s.%s\" % (MAJOR,MINOR,BUILD,PATCH)' " +
"-o " +
"$(out) " +
"$(location components/cronet/version.h.in)",
@@ -8336,7 +8336,7 @@
cmd: "$(location build/util/version.py) -f " +
"$(location chrome/VERSION) " +
"-e " +
- "VERSION_FULL=\"%s.%s.%s.%s\" % (MAJOR,MINOR,BUILD,PATCH) " +
+ "'VERSION_FULL=\"%s.%s.%s.%s\" % (MAJOR,MINOR,BUILD,PATCH)' " +
"-o " +
"$(out) " +
"$(location components/cronet/version.h.in)",
diff --git a/tools/gn2bp/gen_android_bp b/tools/gn2bp/gen_android_bp
index ef05126..1836fd1 100755
--- a/tools/gn2bp/gen_android_bp
+++ b/tools/gn2bp/gen_android_bp
@@ -849,6 +849,7 @@
# args for the version.py contain file path without leading --arg key. So apply sanitize
# function for all the args.
self._update_all_args(self._sanitize_filepath_with_location_tag)
+ self._set_value_arg('-e', "'%s'" % self._get_value_arg('-e'))
super()._sanitize_args()
class JavaCppEnumSanitizer(BaseActionSanitizer):