diff options
| -rw-r--r-- | apex/apex_test.go | 2 | ||||
| -rw-r--r-- | cc/library.go | 16 | ||||
| -rw-r--r-- | cc/testing.go | 13 | ||||
| -rw-r--r-- | sdk/testing.go | 2 | ||||
| -rw-r--r-- | sysprop/sysprop_test.go | 2 |
5 files changed, 15 insertions, 20 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go index e8dc9aaaa..5e49e41b7 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -286,8 +286,6 @@ func testApexContext(t *testing.T, bp string, handlers ...testCustomizer) (*andr ctx.RegisterModuleType("prebuilt_apex", PrebuiltFactory) ctx.RegisterModuleType("override_apex", overrideApexFactory) - ctx.RegisterModuleType("cc_library_shared", cc.LibrarySharedFactory) - ctx.RegisterModuleType("cc_library_headers", cc.LibraryHeaderFactory) cc.RegisterRequiredBuildComponentsForTest(ctx) ctx.RegisterModuleType("cc_binary", cc.BinaryFactory) ctx.RegisterModuleType("cc_test", cc.TestFactory) diff --git a/cc/library.go b/cc/library.go index 04130c4c9..84f1831a0 100644 --- a/cc/library.go +++ b/cc/library.go @@ -174,12 +174,16 @@ type FlagExporterProperties struct { } func init() { - android.RegisterModuleType("cc_library_static", LibraryStaticFactory) - android.RegisterModuleType("cc_library_shared", LibrarySharedFactory) - android.RegisterModuleType("cc_library", LibraryFactory) - android.RegisterModuleType("cc_library_host_static", LibraryHostStaticFactory) - android.RegisterModuleType("cc_library_host_shared", LibraryHostSharedFactory) - android.RegisterModuleType("cc_library_headers", LibraryHeaderFactory) + RegisterLibraryBuildComponents(android.InitRegistrationContext) +} + +func RegisterLibraryBuildComponents(ctx android.RegistrationContext) { + ctx.RegisterModuleType("cc_library_static", LibraryStaticFactory) + ctx.RegisterModuleType("cc_library_shared", LibrarySharedFactory) + ctx.RegisterModuleType("cc_library", LibraryFactory) + ctx.RegisterModuleType("cc_library_host_static", LibraryHostStaticFactory) + ctx.RegisterModuleType("cc_library_host_shared", LibraryHostSharedFactory) + ctx.RegisterModuleType("cc_library_headers", LibraryHeaderFactory) } // cc_library creates both static and/or shared libraries for a device and/or diff --git a/cc/testing.go b/cc/testing.go index de4f1ec06..bc3107721 100644 --- a/cc/testing.go +++ b/cc/testing.go @@ -20,14 +20,14 @@ import ( func RegisterRequiredBuildComponentsForTest(ctx android.RegistrationContext) { RegisterPrebuiltBuildComponents(ctx) - ctx.RegisterModuleType("toolchain_library", ToolchainLibraryFactory) - ctx.RegisterModuleType("cc_library", LibraryFactory) - ctx.RegisterModuleType("llndk_library", LlndkLibraryFactory) - ctx.RegisterModuleType("cc_object", ObjectFactory) - android.RegisterPrebuiltMutators(ctx) RegisterCCBuildComponents(ctx) + RegisterLibraryBuildComponents(ctx) + + ctx.RegisterModuleType("toolchain_library", ToolchainLibraryFactory) + ctx.RegisterModuleType("llndk_library", LlndkLibraryFactory) + ctx.RegisterModuleType("cc_object", ObjectFactory) } func GatherRequiredDepsForTest(os android.OsType) string { @@ -308,9 +308,6 @@ func CreateTestContext() *android.TestContext { ctx.RegisterModuleType("cc_binary", BinaryFactory) ctx.RegisterModuleType("cc_binary_host", binaryHostFactory) ctx.RegisterModuleType("cc_fuzz", FuzzFactory) - ctx.RegisterModuleType("cc_library_shared", LibrarySharedFactory) - ctx.RegisterModuleType("cc_library_static", LibraryStaticFactory) - ctx.RegisterModuleType("cc_library_headers", LibraryHeaderFactory) ctx.RegisterModuleType("cc_test", TestFactory) ctx.RegisterModuleType("llndk_headers", llndkHeadersFactory) ctx.RegisterModuleType("ndk_library", NdkLibraryFactory) diff --git a/sdk/testing.go b/sdk/testing.go index eec7f0198..950cf0a71 100644 --- a/sdk/testing.go +++ b/sdk/testing.go @@ -77,8 +77,6 @@ func testSdkContext(bp string, fs map[string][]byte) (*android.TestContext, andr // from cc package cc.RegisterRequiredBuildComponentsForTest(ctx) - ctx.RegisterModuleType("cc_library_shared", cc.LibrarySharedFactory) - ctx.RegisterModuleType("cc_library_static", cc.LibraryStaticFactory) // from apex package ctx.RegisterModuleType("apex", apex.BundleFactory) diff --git a/sysprop/sysprop_test.go b/sysprop/sysprop_test.go index 0c0f2229e..7cad3da94 100644 --- a/sysprop/sysprop_test.go +++ b/sysprop/sysprop_test.go @@ -66,8 +66,6 @@ func testContext(config android.Config) *android.TestContext { }) cc.RegisterRequiredBuildComponentsForTest(ctx) - ctx.RegisterModuleType("cc_library_headers", cc.LibraryHeaderFactory) - ctx.RegisterModuleType("cc_library_static", cc.LibraryFactory) ctx.PreDepsMutators(func(ctx android.RegisterMutatorsContext) { ctx.BottomUp("sysprop_java", java.SyspropMutator).Parallel() }) |