aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Nicoara <ancr@google.com>2022-06-30 16:34:28 +0100
committerCherrypicker Worker <android-build-cherrypicker-worker@google.com>2022-07-01 14:39:59 +0000
commit606eee9ca259d84c9136038ef4901009918e2bd5 (patch)
tree3802e27d89cd844c777cb681683371b0b2e1ecce
parent224fbdb596a24e72024ec7a59d2e7bf6cc226bf3 (diff)
downloadsoong-606eee9ca259d84c9136038ef4901009918e2bd5.tar.gz
Removing comment lines from apex_manifest.json
Allowing comments in apex_manifest.json by stripping all the lines which start with // Test: presubmit Bug: 237532860 Change-Id: Iec8c9987edf19b763b2b87df7d125c006ffb217a (cherry picked from commit ee4b633627fb291f6e39088307e38628d24a2070) Merged-In: Iec8c9987edf19b763b2b87df7d125c006ffb217a
-rw-r--r--apex/builder.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/apex/builder.go b/apex/builder.go
index fc9bb3bec..7e2b924c7 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -82,6 +82,11 @@ var (
Description: "prepare ${out}",
}, "provideNativeLibs", "requireNativeLibs", "opt")
+ stripCommentsApexManifestRule = pctx.StaticRule("stripCommentsApexManifestRule", blueprint.RuleParams{
+ Command: `sed '/^\s*\/\//d' $in > $out`,
+ Description: "strip lines starting with // ${in}=>${out}",
+ })
+
stripApexManifestRule = pctx.StaticRule("stripApexManifestRule", blueprint.RuleParams{
Command: `rm -f $out && ${conv_apex_manifest} strip $in -o $out`,
CommandDeps: []string{"${conv_apex_manifest}"},
@@ -205,10 +210,17 @@ func (a *apexBundle) buildManifest(ctx android.ModuleContext, provideNativeLibs,
optCommands = append(optCommands, "-a jniLibs "+strings.Join(jniLibs, " "))
}
+ manifestJsonCommentsStripped := android.PathForModuleOut(ctx, "apex_manifest_comments_stripped.json")
+ ctx.Build(pctx, android.BuildParams{
+ Rule: stripCommentsApexManifestRule,
+ Input: src,
+ Output: manifestJsonCommentsStripped,
+ })
+
manifestJsonFullOut := android.PathForModuleOut(ctx, "apex_manifest_full.json")
ctx.Build(pctx, android.BuildParams{
Rule: apexManifestRule,
- Input: src,
+ Input: manifestJsonCommentsStripped,
Output: manifestJsonFullOut,
Args: map[string]string{
"provideNativeLibs": strings.Join(provideNativeLibs, " "),