diff options
Diffstat (limited to 'apex/apex.go')
| -rw-r--r-- | apex/apex.go | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/apex/apex.go b/apex/apex.go index 94e871cb..383fc23a 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -1320,6 +1320,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 { @@ -1410,17 +1417,16 @@ 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()) - }, + AddCustomEntries: func(name, prefix, moduleDir string, 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...) }, } } |
