summaryrefslogtreecommitdiff
path: root/android/androidmk.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/androidmk.go')
-rw-r--r--android/androidmk.go28
1 files changed, 18 insertions, 10 deletions
diff --git a/android/androidmk.go b/android/androidmk.go
index 694f5d66b..e32835946 100644
--- a/android/androidmk.go
+++ b/android/androidmk.go
@@ -435,13 +435,18 @@ func getDistContributions(ctx ConfigAndOtherModuleProviderContext, mod Module) *
suffix = *dist.Suffix
}
- productString := ""
- if dist.Append_artifact_with_product != nil && *dist.Append_artifact_with_product {
- productString = fmt.Sprintf("_%s", ctx.Config().DeviceProduct())
+ prependProductString := ""
+ if proptools.Bool(dist.Prepend_artifact_with_product) {
+ prependProductString = fmt.Sprintf("%s-", ctx.Config().DeviceProduct())
}
- if suffix != "" || productString != "" {
- dest = strings.TrimSuffix(dest, ext) + suffix + productString + ext
+ appendProductString := ""
+ if proptools.Bool(dist.Append_artifact_with_product) {
+ appendProductString = fmt.Sprintf("_%s", ctx.Config().DeviceProduct())
+ }
+
+ if suffix != "" || appendProductString != "" || prependProductString != "" {
+ dest = prependProductString + strings.TrimSuffix(dest, ext) + suffix + appendProductString + ext
}
if dist.Dir != nil {
@@ -510,6 +515,9 @@ func (a *AndroidMkEntries) fillInEntries(ctx fillInEntriesContext, mod Module) {
a.EntryMap = make(map[string][]string)
base := mod.base()
name := base.BaseModuleName()
+ if bmn, ok := mod.(baseModuleName); ok {
+ name = bmn.BaseModuleName()
+ }
if a.OverrideName != "" {
name = a.OverrideName
}
@@ -888,14 +896,14 @@ func getSoongOnlyDataFromMods(ctx fillInEntriesContext, mods []Module) ([]distCo
}
}
- commonInfo, _ := OtherModuleProvider(ctx, mod, CommonModuleInfoProvider)
+ commonInfo := OtherModulePointerProviderOrDefault(ctx, mod, CommonModuleInfoProvider)
if commonInfo.SkipAndroidMkProcessing {
continue
}
if info, ok := OtherModuleProvider(ctx, mod, AndroidMkInfoProvider); ok {
// Deep copy the provider info since we need to modify the info later
info := deepCopyAndroidMkProviderInfo(info)
- info.PrimaryInfo.fillInEntries(ctx, mod, &commonInfo)
+ info.PrimaryInfo.fillInEntries(ctx, mod, commonInfo)
if info.PrimaryInfo.disabled() {
continue
}
@@ -1320,7 +1328,7 @@ var AndroidMkInfoProvider = blueprint.NewProvider[*AndroidMkProviderInfo]()
// Please only access the module's internal data through providers.
func translateAndroidMkEntriesInfoModule(ctx SingletonContext, w io.Writer, moduleInfoJSONs *[]*ModuleInfoJSON,
mod Module, providerInfo *AndroidMkProviderInfo) error {
- commonInfo, _ := OtherModuleProvider(ctx, mod, CommonModuleInfoProvider)
+ commonInfo := OtherModulePointerProviderOrDefault(ctx, mod, CommonModuleInfoProvider)
if commonInfo.SkipAndroidMkProcessing {
return nil
}
@@ -1331,11 +1339,11 @@ func translateAndroidMkEntriesInfoModule(ctx SingletonContext, w io.Writer, modu
aconfigUpdateAndroidMkInfos(ctx, mod, &info)
// Any new or special cases here need review to verify correct propagation of license information.
- info.PrimaryInfo.fillInEntries(ctx, mod, &commonInfo)
+ info.PrimaryInfo.fillInEntries(ctx, mod, commonInfo)
info.PrimaryInfo.write(w)
if len(info.ExtraInfo) > 0 {
for _, ei := range info.ExtraInfo {
- ei.fillInEntries(ctx, mod, &commonInfo)
+ ei.fillInEntries(ctx, mod, commonInfo)
ei.write(w)
}
}