From 91e05ea05655e9a8d7c1e661f82ce0f71bc57117 Mon Sep 17 00:00:00 2001 From: LaMont Jones Date: Thu, 20 Mar 2025 15:09:04 -0700 Subject: Make d8-on-eng a per-module opt-out Several modules use defaults that set `enabled`, rather than relying on the defaults. With this change, eng builds no use d8 instead of r8, with the exception of unit tests in prebuilts/r8. Bug: b/374975543 Test: manual, TH Change-Id: I377d354f005529d04fb9d9255afa73979935f091 --- java/dex.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'java') diff --git a/java/dex.go b/java/dex.go index dd6467546..f2406fb3c 100644 --- a/java/dex.go +++ b/java/dex.go @@ -42,6 +42,9 @@ type DexProperties struct { // True if the module containing this has it set by default. EnabledByDefault bool `blueprint:"mutated"` + // If true, then this module will be optimized on eng builds. + Enabled_on_eng *bool + // Whether to allow that library classes inherit from program classes. // Defaults to false. Ignore_library_extends_program *bool @@ -162,7 +165,10 @@ type dexer struct { } func (d *dexer) effectiveOptimizeEnabled(ctx android.EarlyModuleContext) bool { - return BoolDefault(d.dexProperties.Optimize.Enabled, d.dexProperties.Optimize.EnabledByDefault && !ctx.Config().Eng()) + if ctx.Config().Eng() { + return proptools.Bool(d.dexProperties.Optimize.Enabled_on_eng) + } + return BoolDefault(d.dexProperties.Optimize.Enabled, d.dexProperties.Optimize.EnabledByDefault) } func (d *DexProperties) resourceShrinkingEnabled(ctx android.ModuleContext) bool { -- cgit v1.2.3-59-g8ed1b