aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Li <weiwli@google.com>2023-05-19 22:25:01 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-05-19 22:25:01 +0000
commitf7242a94db94ed8187e32d781123822d6c3feffd (patch)
tree362c5c5f7f57c14f292d1c5faaf737a6eeaf9726
parentd58c9f9c08ce62940a2c84a9a2ec0a3ce1a507b4 (diff)
parent05bfafda18345a05e0036bb7a491363e3d809e3b (diff)
downloadbazel-f7242a94db94ed8187e32d781123822d6c3feffd.tar.gz
Add some product variables to provider ProductVariablesInfo. am: 05bfafda18
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/bazel/+/23305003 Change-Id: Icc928dbc67b78112bc0778c3302d28158b9faa4b Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--product_config/product_variables_providing_rule.bzl21
1 files changed, 21 insertions, 0 deletions
diff --git a/product_config/product_variables_providing_rule.bzl b/product_config/product_variables_providing_rule.bzl
index 8317dee6..c6ce1ab1 100644
--- a/product_config/product_variables_providing_rule.bzl
+++ b/product_config/product_variables_providing_rule.bzl
@@ -26,6 +26,14 @@ ProductVariablesInfo = provider(
"ManifestPackageNameOverrides": "A list of string:string mapping from APEX/APK name to package name to override the AndroidManifest.xml package of the module.",
"CertificateOverrides": "A list of string:string mapping from APEX/APK name to the certificate name to override the certificate used to sign the APEX/APK container.",
"DeviceMaxPageSizeSupported": "String indicating the max-page-size supported by the device.",
+ "DeviceProduct": "Device product",
+ "DeviceName": "Device name",
+ "Platform_version_name": "Platform version name",
+ "BuildId": "Build ID",
+ "ProductManufacturer": "Product manufacturer",
+ "ProductBrand": "Product brand",
+ "TargetBuildVariant": "Target build variant",
+ "BuildVersionTags": "Build version tags",
},
)
@@ -42,6 +50,11 @@ def _product_variables_providing_rule_impl(ctx):
tidy_checks = vars.get("TidyChecks", "")
tidy_checks = tidy_checks.split(",") if tidy_checks else []
+ target_build_variant = "user"
+ if vars.get("Eng"):
+ target_build_variant = "eng"
+ elif vars.get("Debuggable"):
+ target_build_variant = "userdebug"
return [
platform_common.TemplateVariableInfo(ctx.attr.attribute_vars),
@@ -55,6 +68,14 @@ def _product_variables_providing_rule_impl(ctx):
ManifestPackageNameOverrides = vars.get("ManifestPackageNameOverrides", []),
CertificateOverrides = vars.get("CertificateOverrides", []),
DeviceMaxPageSizeSupported = vars.get("DeviceMaxPageSizeSupported", ""),
+ DeviceProduct = vars.get("DeviceProduct", ""),
+ DeviceName = vars.get("DeviceName", ""),
+ Platform_version_name = vars.get("Platform_version_name", ""),
+ BuildId = vars.get("BuildId", ""),
+ ProductManufacturer = vars.get("ProductManufacturer", ""),
+ ProductBrand = vars.get("ProductBrand", ""),
+ TargetBuildVariant = target_build_variant,
+ BuildVersionTags = vars.get("BuildVersionTags", []),
),
ProductVariablesDepsInfo(
DefaultAppCertificateFiles = ctx.files.default_app_certificate_filegroup,