Add prepend_artifact_with_product attribute for dist
Add the new attribute to feet what test_package's requirement, moving
the dist output naming logic from test_package to dist.
Also add 4 allowed module names for the rest of the continuous_* test
packages.
Ignore-AOSP-First: Because the platform_tests conversion is in internal
branch currently.
Bug: 399246722
Test: m dist platform_tests
Change-Id: I96e690f23e801c22fe66f0f234be8a1f9a84062f
diff --git a/android/androidmk.go b/android/androidmk.go
index 7cc6aef..e328359 100644
--- a/android/androidmk.go
+++ b/android/androidmk.go
@@ -435,13 +435,18 @@
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 {