aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Li <weiwli@google.com>2023-05-04 09:10:23 -0700
committerCherrypicker Worker <android-build-cherrypicker-worker@google.com>2023-05-19 00:35:24 +0000
commit05bfafda18345a05e0036bb7a491363e3d809e3b (patch)
tree362c5c5f7f57c14f292d1c5faaf737a6eeaf9726
parent643b262becfa90486a6559001764ee6309523ea0 (diff)
downloadbazel-05bfafda18345a05e0036bb7a491363e3d809e3b.tar.gz
Add some product variables to provider ProductVariablesInfo.
Bug: 275472038 Test: CIs (cherry picked from https://android-review.googlesource.com/q/commit:647f151ff509b8ae9ffbd78abb9a8097f6800a7e) Merged-In: I513180f3db4b1fdd579336e118e375398fd8d4f7 Change-Id: I513180f3db4b1fdd579336e118e375398fd8d4f7
-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,