Skip to content
Snippets Groups Projects
Commit b52adbcd authored by Harshit Mahajan's avatar Harshit Mahajan
Browse files

Add combined_api_defaults module type

Allow specifying default combined api properties. This would be currently used to control the enablement of new mainline modules

Bug:b/289203818
Test: verified locally
Change-Id: I9415140453ce04efd5461cb8684c70e987810ecc
parent 2ab8f35e
No related branches found
No related tags found
No related merge requests found
......@@ -64,6 +64,7 @@ type CombinedApisProperties struct {
type CombinedApis struct {
android.ModuleBase
android.DefaultableModuleBase
properties CombinedApisProperties
}
......@@ -74,6 +75,7 @@ func init() {
func registerBuildComponents(ctx android.RegistrationContext) {
ctx.RegisterModuleType("combined_apis", combinedApisModuleFactory)
ctx.RegisterModuleType("combined_apis_defaults", CombinedApisModuleDefaultsFactory)
}
var PrepareForCombinedApisTest = android.FixtureRegisterWithContext(registerBuildComponents)
......@@ -409,6 +411,7 @@ func combinedApisModuleFactory() android.Module {
module := &CombinedApis{}
module.AddProperties(&module.properties)
android.InitAndroidModule(module)
android.InitDefaultableModule(module)
android.AddLoadHook(module, func(ctx android.LoadHookContext) { module.createInternalModules(ctx) })
return module
}
......@@ -445,3 +448,16 @@ func remove(s []string, v string) []string {
}
return s2
}
// Defaults
type CombinedApisModuleDefaults struct {
android.ModuleBase
android.DefaultsModuleBase
}
func CombinedApisModuleDefaultsFactory() android.Module {
module := &CombinedApisModuleDefaults{}
module.AddProperties(&CombinedApisProperties{})
android.InitDefaultsModule(module)
return module
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment