diff options
author | 2019-06-22 12:59:27 -0700 | |
---|---|---|
committer | 2019-06-22 12:59:27 -0700 | |
commit | a0ba2f58586dda08178b1eb7acab42e08a555423 (patch) | |
tree | 4206e9b224bce6795347f1f10ee86fc8549cf609 /java/aapt2.go | |
parent | fedc47141e9903f5e99361c52609c39e57bc7c49 (diff) |
Allow passing --legacy in aaptflags
--legacy will soon no longer be passed by default to all aapt2
compiles. Allow it to be specified in aaptflags by passing it to
aapt2 compile when it is present and filtering it out from the
flags passed to aapt2 link.
Bug: 135597368
Test: m java
Change-Id: Ib65d1a9b7c32ae4ff5ab6f58e66aedfb5f296712
Diffstat (limited to 'java/aapt2.go')
-rw-r--r-- | java/aapt2.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/java/aapt2.go b/java/aapt2.go index a8151608f..ad746f7b8 100644 --- a/java/aapt2.go +++ b/java/aapt2.go @@ -60,7 +60,9 @@ var aapt2CompileRule = pctx.AndroidStaticRule("aapt2Compile", }, "outDir", "cFlags") -func aapt2Compile(ctx android.ModuleContext, dir android.Path, paths android.Paths) android.WritablePaths { +func aapt2Compile(ctx android.ModuleContext, dir android.Path, paths android.Paths, + flags []string) android.WritablePaths { + shards := shardPaths(paths, AAPT2_SHARD_SIZE) ret := make(android.WritablePaths, 0, len(paths)) @@ -81,9 +83,7 @@ func aapt2Compile(ctx android.ModuleContext, dir android.Path, paths android.Pat Outputs: outPaths, Args: map[string]string{ "outDir": android.PathForModuleOut(ctx, "aapt2", dir.String()).String(), - // Always set --pseudo-localize, it will be stripped out later for release - // builds that don't want it. - "cFlags": "--pseudo-localize", + "cFlags": strings.Join(flags, " "), }, }) } @@ -104,7 +104,9 @@ var aapt2CompileZipRule = pctx.AndroidStaticRule("aapt2CompileZip", }, }, "cFlags", "resZipDir", "zipSyncFlags") -func aapt2CompileZip(ctx android.ModuleContext, flata android.WritablePath, zip android.Path, zipPrefix string) { +func aapt2CompileZip(ctx android.ModuleContext, flata android.WritablePath, zip android.Path, zipPrefix string, + flags []string) { + if zipPrefix != "" { zipPrefix = "--zip-prefix " + zipPrefix } @@ -114,9 +116,7 @@ func aapt2CompileZip(ctx android.ModuleContext, flata android.WritablePath, zip Input: zip, Output: flata, Args: map[string]string{ - // Always set --pseudo-localize, it will be stripped out later for release - // builds that don't want it. - "cFlags": "--pseudo-localize", + "cFlags": strings.Join(flags, " "), "resZipDir": android.PathForModuleOut(ctx, "aapt2", "reszip", flata.Base()).String(), "zipSyncFlags": zipPrefix, }, |