diff options
author | 2022-09-22 10:41:42 +0200 | |
---|---|---|
committer | 2022-09-23 19:11:11 +0200 | |
commit | 351bac996cb6e329f935aa70e59fa9f4aa58d65d (patch) | |
tree | 0fa1b238261062c52b576012f4042bff0a997c02 /java/aapt2.go | |
parent | eb30142616c1c79e8b84970fb044a9589baa7dfc (diff) |
Add soong support for resource shrinking
This adds a new flag to the optimize section to allow invoking the resource shrinker
Bug: 246217952
Test: m
Change-Id: I2e7851af1189db2a6adf6f9f9f444a1d7f3a8d60
Diffstat (limited to 'java/aapt2.go')
-rw-r--r-- | java/aapt2.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/java/aapt2.go b/java/aapt2.go index 5346ddf89..7845a0b23 100644 --- a/java/aapt2.go +++ b/java/aapt2.go @@ -256,17 +256,21 @@ func aapt2Link(ctx android.ModuleContext, var aapt2ConvertRule = pctx.AndroidStaticRule("aapt2Convert", blueprint.RuleParams{ - Command: `${config.Aapt2Cmd} convert --output-format proto $in -o $out`, + Command: `${config.Aapt2Cmd} convert --output-format $format $in -o $out`, CommandDeps: []string{"${config.Aapt2Cmd}"}, - }) + }, "format", +) // Converts xml files and resource tables (resources.arsc) in the given jar/apk file to a proto // format. The proto definition is available at frameworks/base/tools/aapt2/Resources.proto. -func aapt2Convert(ctx android.ModuleContext, out android.WritablePath, in android.Path) { +func aapt2Convert(ctx android.ModuleContext, out android.WritablePath, in android.Path, format string) { ctx.Build(pctx, android.BuildParams{ Rule: aapt2ConvertRule, Input: in, Output: out, - Description: "convert to proto", + Description: "convert to " + format, + Args: map[string]string{ + "format": format, + }, }) } |