Extract sdk registration code into function for reuse

Test: m nothing
Change-Id: I0d0e36324808831deb9a32f07ca3696125703873
This commit is contained in:
Paul Duffin
2021-03-09 22:59:28 +00:00
parent 667893c657
commit 6d9108f047
3 changed files with 16 additions and 12 deletions

View File

@@ -33,10 +33,14 @@ func init() {
pctx.Import("android/soong/android")
pctx.Import("android/soong/java/config")
android.RegisterModuleType("sdk", SdkModuleFactory)
android.RegisterModuleType("sdk_snapshot", SnapshotModuleFactory)
android.PreDepsMutators(RegisterPreDepsMutators)
android.PostDepsMutators(RegisterPostDepsMutators)
registerSdkBuildComponents(android.InitRegistrationContext)
}
func registerSdkBuildComponents(ctx android.RegistrationContext) {
ctx.RegisterModuleType("sdk", SdkModuleFactory)
ctx.RegisterModuleType("sdk_snapshot", SnapshotModuleFactory)
ctx.PreDepsMutators(RegisterPreDepsMutators)
ctx.PostDepsMutators(RegisterPostDepsMutators)
}
type sdk struct {