Refactor factories

Change module factories from returning a blueprint.Module and a list
of property structs to returning an android.Module, which holds the
list of property structs.

Test: build.ninja identical except for Factory: comment lines
Change-Id: Ica1d823f009db812c518f271a386fbff39c9766f
This commit is contained in:
Colin Cross
2017-06-23 15:06:31 -07:00
parent 4817389148
commit 36242850fd
29 changed files with 211 additions and 168 deletions

View File

@@ -137,9 +137,11 @@ func (m *headerModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
}
func ndkHeadersFactory() (blueprint.Module, []interface{}) {
func ndkHeadersFactory() android.Module {
module := &headerModule{}
return android.InitAndroidModule(module, &module.properties)
module.AddProperties(&module.properties)
android.InitAndroidModule(module)
return module
}
type preprocessedHeaderProperies struct {
@@ -251,12 +253,16 @@ func processHeadersWithVersioner(ctx android.ModuleContext, srcDir, outDir andro
return timestampFile
}
func preprocessedNdkHeadersFactory() (blueprint.Module, []interface{}) {
func preprocessedNdkHeadersFactory() android.Module {
module := &preprocessedHeaderModule{}
module.AddProperties(&module.properties)
// Host module rather than device module because device module install steps
// do not get run when embedded in make. We're not any of the existing
// module types that can be exposed via the Android.mk exporter, so just use
// a host module.
return android.InitAndroidArchModule(module, android.HostSupportedNoCross,
android.MultilibFirst, &module.properties)
android.InitAndroidArchModule(module, android.HostSupportedNoCross, android.MultilibFirst)
return module
}