From c059c8c9a05e28b5d3782464f01c493047a64d21 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Wed, 20 Jan 2021 17:13:52 +0000 Subject: Add java.RegisterRequiredBuildComponentsForTest function Insulate tests that exercise code in the java package from having to register the build components provided by the java package by providing a single function that registers them all. This follows the pattern currently used in the cc and rust packages. This change is in preparation for switching the dex_bootjars singleton from a singleton, which does not require a module definition in order to be instantiated, to a singleton module which does. That will require adding a module definition into java.GatherRequiredDepsForTest() and this change ensures that the required components will have been registered in every test. Bug: 177892522 Test: m nothing Change-Id: I6475db8240894947dd07c89a940a3e4f201aa598 --- java/java_test.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'java/java_test.go') diff --git a/java/java_test.go b/java/java_test.go index 1c0738fa4..2a23f371e 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -73,21 +73,10 @@ func testConfig(env map[string]string, bp string, fs map[string][]byte) android. func testContext(config android.Config) *android.TestContext { ctx := android.NewTestArchContext(config) - RegisterJavaBuildComponents(ctx) - RegisterAppBuildComponents(ctx) - RegisterAppImportBuildComponents(ctx) - RegisterAppSetBuildComponents(ctx) - RegisterAARBuildComponents(ctx) - RegisterGenRuleBuildComponents(ctx) - RegisterRuntimeResourceOverlayBuildComponents(ctx) - RegisterSystemModulesBuildComponents(ctx) + RegisterRequiredBuildComponentsForTest(ctx) ctx.RegisterModuleType("java_plugin", PluginFactory) ctx.RegisterModuleType("filegroup", android.FileGroupFactory) ctx.RegisterModuleType("python_binary_host", python.PythonBinaryHostFactory) - RegisterDocsBuildComponents(ctx) - RegisterStubsBuildComponents(ctx) - RegisterPrebuiltApisBuildComponents(ctx) - RegisterSdkLibraryBuildComponents(ctx) ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators) ctx.PreArchMutators(android.RegisterComponentsMutator) -- cgit v1.2.3-59-g8ed1b