Extract apex registration code into function for reuse

Test: m nothing
Change-Id: Id2c918891ecd9e874004f6828f71374bf0cdb9e4
This commit is contained in:
Paul Duffin
2021-03-09 22:34:13 +00:00
parent 706cb6f344
commit 667893c657
3 changed files with 21 additions and 23 deletions

View File

@@ -39,16 +39,20 @@ import (
)
func init() {
android.RegisterModuleType("apex", BundleFactory)
android.RegisterModuleType("apex_test", testApexBundleFactory)
android.RegisterModuleType("apex_vndk", vndkApexBundleFactory)
android.RegisterModuleType("apex_defaults", defaultsFactory)
android.RegisterModuleType("prebuilt_apex", PrebuiltFactory)
android.RegisterModuleType("override_apex", overrideApexFactory)
android.RegisterModuleType("apex_set", apexSetFactory)
registerApexBuildComponents(android.InitRegistrationContext)
}
android.PreDepsMutators(RegisterPreDepsMutators)
android.PostDepsMutators(RegisterPostDepsMutators)
func registerApexBuildComponents(ctx android.RegistrationContext) {
ctx.RegisterModuleType("apex", BundleFactory)
ctx.RegisterModuleType("apex_test", testApexBundleFactory)
ctx.RegisterModuleType("apex_vndk", vndkApexBundleFactory)
ctx.RegisterModuleType("apex_defaults", defaultsFactory)
ctx.RegisterModuleType("prebuilt_apex", PrebuiltFactory)
ctx.RegisterModuleType("override_apex", overrideApexFactory)
ctx.RegisterModuleType("apex_set", apexSetFactory)
ctx.PreDepsMutators(RegisterPreDepsMutators)
ctx.PostDepsMutators(RegisterPostDepsMutators)
}
func RegisterPreDepsMutators(ctx android.RegisterMutatorsContext) {