Dedup registration of Soong config module types
Bug: 264876909
Test: m nothing
Change-Id: I467a2090b32438cbbf88bbb453bb4960757ec37a
diff --git a/android/soong_config_modules.go b/android/soong_config_modules.go
index c1e92b8..7434c89 100644
--- a/android/soong_config_modules.go
+++ b/android/soong_config_modules.go
@@ -31,12 +31,18 @@
)
func init() {
- RegisterModuleType("soong_config_module_type_import", SoongConfigModuleTypeImportFactory)
- RegisterModuleType("soong_config_module_type", SoongConfigModuleTypeFactory)
- RegisterModuleType("soong_config_string_variable", SoongConfigStringVariableDummyFactory)
- RegisterModuleType("soong_config_bool_variable", SoongConfigBoolVariableDummyFactory)
+ RegisterSoongConfigModuleBuildComponents(InitRegistrationContext)
}
+func RegisterSoongConfigModuleBuildComponents(ctx RegistrationContext) {
+ ctx.RegisterModuleType("soong_config_module_type_import", SoongConfigModuleTypeImportFactory)
+ ctx.RegisterModuleType("soong_config_module_type", SoongConfigModuleTypeFactory)
+ ctx.RegisterModuleType("soong_config_string_variable", SoongConfigStringVariableDummyFactory)
+ ctx.RegisterModuleType("soong_config_bool_variable", SoongConfigBoolVariableDummyFactory)
+}
+
+var PrepareForTestWithSoongConfigModuleBuildComponents = FixtureRegisterWithContext(RegisterSoongConfigModuleBuildComponents)
+
type soongConfigModuleTypeImport struct {
ModuleBase
properties soongConfigModuleTypeImportProperties