diff options
author | 2025-03-20 15:09:04 -0700 | |
---|---|---|
committer | 2025-03-20 15:20:09 -0700 | |
commit | 91e05ea05655e9a8d7c1e661f82ce0f71bc57117 (patch) | |
tree | 1d066c8b24b5493c266469628f98382949a868fc /java | |
parent | 89d23d3ef9831f908c08cc2afcb0c26353420385 (diff) |
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
Diffstat (limited to 'java')
-rw-r--r-- | java/dex.go | 8 |
1 files changed, 7 insertions, 1 deletions
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 { |