Don't run resource shrinking for eng builds

Since we will not shrink the resources anyway this is a waste of time

Bug: 338429777
Test: m SystemUI
Change-Id: I388f045294131a304920756607792091627921bc
This commit is contained in:
Rico Wind
2024-05-07 09:08:31 +02:00
parent bf30241e75
commit 936754c599
2 changed files with 10 additions and 6 deletions

View File

@@ -521,7 +521,7 @@ func (a *AndroidApp) aaptBuildActions(ctx android.ModuleContext) {
}
// Use non final ids if we are doing optimized shrinking and are using R8.
nonFinalIds := Bool(a.dexProperties.Optimize.Optimized_shrink_resources) && a.dexer.effectiveOptimizeEnabled()
nonFinalIds := a.dexProperties.optimizedResourceShrinkingEnabled(ctx) && a.dexer.effectiveOptimizeEnabled()
a.aapt.buildActions(ctx,
aaptBuildActionOptions{
sdkContext: android.SdkContext(a),
@@ -552,7 +552,7 @@ func (a *AndroidApp) proguardBuildActions(ctx android.ModuleContext) {
staticLibProguardFlagFiles = android.FirstUniquePaths(staticLibProguardFlagFiles)
a.Module.extraProguardFlagsFiles = append(a.Module.extraProguardFlagsFiles, staticLibProguardFlagFiles...)
if !Bool(a.dexProperties.Optimize.Optimized_shrink_resources) {
if !(a.dexProperties.optimizedResourceShrinkingEnabled(ctx)) {
// When using the optimized shrinking the R8 enqueuer will traverse the xml files that become
// live for code references and (transitively) mark these as live.
// In this case we explicitly don't wan't the aapt2 generated keep files (which would keep the now
@@ -591,7 +591,7 @@ func (a *AndroidApp) dexBuildActions(ctx android.ModuleContext) (android.Path, a
var packageResources = a.exportPackage
if ctx.ModuleName() != "framework-res" {
if a.dexProperties.resourceShrinkingEnabled() {
if a.dexProperties.resourceShrinkingEnabled(ctx) {
protoFile := android.PathForModuleOut(ctx, packageResources.Base()+".proto.apk")
aapt2Convert(ctx, protoFile, packageResources, "proto")
a.dexer.resourcesInput = android.OptionalPathForPath(protoFile)
@@ -614,7 +614,7 @@ func (a *AndroidApp) dexBuildActions(ctx android.ModuleContext) (android.Path, a
}
a.Module.compile(ctx, extraSrcJars, extraClasspathJars, extraCombinedJars)
if a.dexProperties.resourceShrinkingEnabled() {
if a.dexProperties.resourceShrinkingEnabled(ctx) {
binaryResources := android.PathForModuleOut(ctx, packageResources.Base()+".binary.out.apk")
aapt2Convert(ctx, binaryResources, a.dexer.resourcesOutput.Path(), "binary")
packageResources = binaryResources