Revert "Use D8 by default for android_test"

This reverts commit 02edc10047.

Reason for revert: Breaks test_suites_x86_64_coverage

Bug: 233421462
Change-Id: I7b04d3fd7802be0f271ea3c29ef25e3d08ab1389
This commit is contained in:
Jared Duke
2022-05-23 04:00:23 +00:00
parent 02edc10047
commit 4e445be558
3 changed files with 5 additions and 6 deletions

View File

@@ -1017,7 +1017,7 @@ func (a *AndroidTest) OverridablePropertiesDepsMutator(ctx android.BottomUpMutat
func AndroidTestFactory() android.Module { func AndroidTestFactory() android.Module {
module := &AndroidTest{} module := &AndroidTest{}
module.Module.dexProperties.Optimize.EnabledByDefault = false module.Module.dexProperties.Optimize.EnabledByDefault = true
module.Module.properties.Instrument = true module.Module.properties.Instrument = true
module.Module.properties.Supports_static_instrumentation = true module.Module.properties.Supports_static_instrumentation = true
@@ -1071,7 +1071,6 @@ func (a *AndroidTestHelperApp) InstallInTestcases() bool {
func AndroidTestHelperAppFactory() android.Module { func AndroidTestHelperAppFactory() android.Module {
module := &AndroidTestHelperApp{} module := &AndroidTestHelperApp{}
// TODO(b/192032291): Disable by default after auditing downstream usage.
module.Module.dexProperties.Optimize.EnabledByDefault = true module.Module.dexProperties.Optimize.EnabledByDefault = true
module.Module.properties.Installable = proptools.BoolPtr(true) module.Module.properties.Installable = proptools.BoolPtr(true)

View File

@@ -36,8 +36,8 @@ type DexProperties struct {
Main_dex_rules []string `android:"path"` Main_dex_rules []string `android:"path"`
Optimize struct { Optimize struct {
// If false, disable all optimization. Defaults to true for android_app and // If false, disable all optimization. Defaults to true for android_app and android_test
// android_test_helper_app modules, false for android_test, java_library, and java_test modules. // modules, false for java_library and java_test modules.
Enabled *bool Enabled *bool
// True if the module containing this has it set by default. // True if the module containing this has it set by default.
EnabledByDefault bool `blueprint:"mutated"` EnabledByDefault bool `blueprint:"mutated"`

View File

@@ -723,9 +723,9 @@ func TestDefaults(t *testing.T) {
t.Errorf("atestNoOptimize should not optimize APK") t.Errorf("atestNoOptimize should not optimize APK")
} }
atestDefault := ctx.ModuleForTests("atestDefault", "android_common").MaybeRule("d8") atestDefault := ctx.ModuleForTests("atestDefault", "android_common").MaybeRule("r8")
if atestDefault.Output == nil { if atestDefault.Output == nil {
t.Errorf("atestDefault should not optimize APK") t.Errorf("atestDefault should optimize APK")
} }
} }