summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
Diffstat (limited to 'android')
-rw-r--r--android/androidmk.go15
-rw-r--r--android/module.go6
2 files changed, 16 insertions, 5 deletions
diff --git a/android/androidmk.go b/android/androidmk.go
index 7cc6aef00..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 {
diff --git a/android/module.go b/android/module.go
index c0abfd0a3..1538861d3 100644
--- a/android/module.go
+++ b/android/module.go
@@ -208,6 +208,12 @@ type Dist struct {
// no change to the artifact file name.
Append_artifact_with_product *bool `android:"arch_variant"`
+ // If true, then the artifact file will be prepended with <product name>-. For
+ // example, if the product is coral and the module is an android_app module
+ // of name foo, then the artifact would be coral-foo.apk. If false, there is
+ // no change to the artifact file name.
+ Prepend_artifact_with_product *bool `android:"arch_variant"`
+
// A string tag to select the OutputFiles associated with the tag.
//
// If no tag is specified then it will select the default dist paths provided