diff options
Diffstat (limited to 'apex/apex.go')
-rw-r--r-- | apex/apex.go | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/apex/apex.go b/apex/apex.go index 81160a9c..1e1c33a7 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -1358,6 +1358,13 @@ type PrebuiltProperties struct { // Optional name for the installed apex. If unspecified, name of the // module is used as the file name Filename *string + + // Names of modules to be overridden. Listed modules can only be other binaries + // (in Make or Soong). + // This does not completely prevent installation of the overridden binaries, but if both + // binaries would be installed by default (in PRODUCT_PACKAGES) the other binary will be removed + // from PRODUCT_PACKAGES. + Overrides []string } func (p *Prebuilt) installable() bool { @@ -1452,16 +1459,17 @@ func (p *Prebuilt) Name() string { return p.prebuilt.Name(p.ModuleBase.Name()) } -func (p *Prebuilt) AndroidMk() android.AndroidMkData { - return android.AndroidMkData{ +func (p *Prebuilt) AndroidMkEntries() android.AndroidMkEntries { + return android.AndroidMkEntries{ Class: "ETC", OutputFile: android.OptionalPathForPath(p.inputApex), Include: "$(BUILD_PREBUILT)", - Extra: []android.AndroidMkExtraFunc{ - func(w io.Writer, outputFile android.Path) { - fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", filepath.Join("$(OUT_DIR)", p.installDir.RelPathString())) - fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", p.installFilename) - fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE :=", !p.installable()) + ExtraEntries: []android.AndroidMkExtraEntriesFunc{ + func(entries *android.AndroidMkEntries) { + entries.SetString("LOCAL_MODULE_PATH", filepath.Join("$(OUT_DIR)", p.installDir.RelPathString())) + entries.SetString("LOCAL_MODULE_STEM", p.installFilename) + entries.SetBoolIfTrue("LOCAL_UNINSTALLABLE_MODULE", !p.installable()) + entries.AddStrings("LOCAL_OVERRIDES_PACKAGES", p.properties.Overrides...) }, }, } @@ -1471,7 +1479,7 @@ func (p *Prebuilt) AndroidMk() android.AndroidMkData { func PrebuiltFactory() android.Module { module := &Prebuilt{} module.AddProperties(&module.properties) - android.InitSingleSourcePrebuiltModule(module, &module.properties.Source) + android.InitSingleSourcePrebuiltModule(module, &module.properties, "Source") android.InitAndroidMultiTargetsArchModule(module, android.DeviceSupported, android.MultilibCommon) return module } |