diff --git a/java/java_test.go b/java/java_test.go index d27a73d30..19d800667 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -74,8 +74,6 @@ var prepareForJavaTest = android.GroupFixturePreparers( PrepareForTestWithOverlayBuildComponents, python.PrepareForTestWithPythonBuildComponents, android.FixtureRegisterWithContext(func(ctx android.RegistrationContext) { - ctx.RegisterModuleType("java_plugin", PluginFactory) - ctx.RegisterPreSingletonType("sdk_versions", sdkPreSingletonFactory) }), dexpreopt.PrepareForTestWithDexpreopt, diff --git a/java/plugin.go b/java/plugin.go index 947c28626..297ac2cb8 100644 --- a/java/plugin.go +++ b/java/plugin.go @@ -17,7 +17,11 @@ package java import "android/soong/android" func init() { - android.RegisterModuleType("java_plugin", PluginFactory) + registerJavaPluginBuildComponents(android.InitRegistrationContext) +} + +func registerJavaPluginBuildComponents(ctx android.RegistrationContext) { + ctx.RegisterModuleType("java_plugin", PluginFactory) } // A java_plugin module describes a host java library that will be used by javac as an annotation processor. diff --git a/java/testing.go b/java/testing.go index b0290dc3d..82a2103fd 100644 --- a/java/testing.go +++ b/java/testing.go @@ -44,6 +44,7 @@ var PrepareForTestWithJavaBuildComponents = android.GroupFixturePreparers( android.PrepareForTestWithAndroidBuildComponents, // Make java build components available to the test. android.FixtureRegisterWithContext(RegisterRequiredBuildComponentsForTest), + android.FixtureRegisterWithContext(registerJavaPluginBuildComponents), ) // Test fixture preparer that will define default java modules, e.g. standard prebuilt modules.