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
diff --git a/java/dex.go b/java/dex.go
index dd64675..f2406fb 100644
--- a/java/dex.go
+++ b/java/dex.go
@@ -42,6 +42,9 @@
// 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 @@
}
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 {