Dedup registration of Soong config module types

Bug: 264876909
Test: m nothing
Change-Id: I467a2090b32438cbbf88bbb453bb4960757ec37a
This commit is contained in:
Paul Duffin
2023-01-09 14:02:06 +00:00
parent 939673bf6b
commit 3229998d37
3 changed files with 22 additions and 32 deletions

View File

@@ -31,12 +31,18 @@ import (
)
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