From 351bac996cb6e329f935aa70e59fa9f4aa58d65d Mon Sep 17 00:00:00 2001 From: Rico Wind Date: Thu, 22 Sep 2022 10:41:42 +0200 Subject: 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 --- java/aapt2.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'java/aapt2.go') 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, + }, }) } -- cgit v1.2.3-59-g8ed1b