Merge "Launch flag guarded always on optimized resource shrinking" into main am: 15c5e54de7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3241280 Change-Id: Ie86673bfe45a7b24ae450f52fb4a727495c64977 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1965,6 +1965,10 @@ func (c *config) GetBuildFlag(name string) (string, bool) {
|
|||||||
return val, ok
|
return val, ok
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *config) UseOptimizedResourceShrinkingByDefault() bool {
|
||||||
|
return c.productVariables.GetBuildFlagBool("RELEASE_USE_OPTIMIZED_RESOURCE_SHRINKING_BY_DEFAULT")
|
||||||
|
}
|
||||||
|
|
||||||
func (c *config) UseResourceProcessorByDefault() bool {
|
func (c *config) UseResourceProcessorByDefault() bool {
|
||||||
return c.productVariables.GetBuildFlagBool("RELEASE_USE_RESOURCE_PROCESSOR_BY_DEFAULT")
|
return c.productVariables.GetBuildFlagBool("RELEASE_USE_RESOURCE_PROCESSOR_BY_DEFAULT")
|
||||||
}
|
}
|
||||||
|
@@ -120,7 +120,7 @@ func (d *DexProperties) resourceShrinkingEnabled(ctx android.ModuleContext) bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *DexProperties) optimizedResourceShrinkingEnabled(ctx android.ModuleContext) bool {
|
func (d *DexProperties) optimizedResourceShrinkingEnabled(ctx android.ModuleContext) bool {
|
||||||
return d.resourceShrinkingEnabled(ctx) && Bool(d.Optimize.Optimized_shrink_resources)
|
return d.resourceShrinkingEnabled(ctx) && BoolDefault(d.Optimize.Optimized_shrink_resources, ctx.Config().UseOptimizedResourceShrinkingByDefault())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *dexer) optimizeOrObfuscateEnabled() bool {
|
func (d *dexer) optimizeOrObfuscateEnabled() bool {
|
||||||
@@ -400,7 +400,7 @@ func (d *dexer) r8Flags(ctx android.ModuleContext, dexParams *compileDexParams)
|
|||||||
r8Flags = append(r8Flags, "--resource-input", d.resourcesInput.Path().String())
|
r8Flags = append(r8Flags, "--resource-input", d.resourcesInput.Path().String())
|
||||||
r8Deps = append(r8Deps, d.resourcesInput.Path())
|
r8Deps = append(r8Deps, d.resourcesInput.Path())
|
||||||
r8Flags = append(r8Flags, "--resource-output", d.resourcesOutput.Path().String())
|
r8Flags = append(r8Flags, "--resource-output", d.resourcesOutput.Path().String())
|
||||||
if Bool(opt.Optimized_shrink_resources) {
|
if d.dexProperties.optimizedResourceShrinkingEnabled(ctx) {
|
||||||
r8Flags = append(r8Flags, "--optimized-resource-shrinking")
|
r8Flags = append(r8Flags, "--optimized-resource-shrinking")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user