summaryrefslogtreecommitdiff
path: root/android/androidmk.go
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-03-24 00:25:21 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2025-03-24 00:25:21 -0700
commitb51c6538317e2e88ecb42d76af4268d147d6d0c7 (patch)
treeafd11b0208e4d573242f1bae2a2d61c46f29c844 /android/androidmk.go
parentb1ed49936f1aea90e2186891b9792b4787713577 (diff)
parent870dbdc97b9ae3b1a1b8e221af1cbbb50d0bb041 (diff)
Merge "Add prepend_artifact_with_product attribute for dist" into main
Diffstat (limited to 'android/androidmk.go')
-rw-r--r--android/androidmk.go15
1 files changed, 10 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 {