summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2023-03-31 00:17:33 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2023-03-31 00:17:33 +0000
commite28bde81fd665ee0aca6b32db6521d745d0be8c5 (patch)
tree076eb57944af847cdd842b648acb2f7eb5a99f83
parent97f5966f49793bdb62afaa14b2df08dc126a5274 (diff)
parent117bb747a4df079a3d5057471d170d56aa52cc87 (diff)
Merge "Move the testing platforms out of soong_injection"
-rw-r--r--bp2build/bp2build_product_config.go63
1 files changed, 12 insertions, 51 deletions
diff --git a/bp2build/bp2build_product_config.go b/bp2build/bp2build_product_config.go
index fdda35b69..ab2f821d3 100644
--- a/bp2build/bp2build_product_config.go
+++ b/bp2build/bp2build_product_config.go
@@ -78,20 +78,18 @@ alias(
# currently lunched, product, turn this into a select with an arm for each product.
actual = "@soong_injection//{PRODUCT_FOLDER}:{PRODUCT}-{VARIANT}",
)
-
-alias(
- name = "product_vars",
- actual = select({
- # TODO: When we start generating the platforms for more than just the
- # currently lunched, product, this select should have an arm for each product.
- "@soong_injection//{PRODUCT_FOLDER}:{PRODUCT}-{VARIANT}_constraint_value": "@soong_injection//{PRODUCT_FOLDER}:{PRODUCT}-{VARIANT}_product_vars",
- "@soong_injection//product_config_platforms/products/aosp_arm_for_testing:aosp_arm_for_testing_constraint_value": "@soong_injection//product_config_platforms/products/aosp_arm_for_testing:aosp_arm_for_testing_product_vars",
- "@soong_injection//product_config_platforms/products/aosp_arm64_for_testing:aosp_arm64_for_testing_constraint_value": "@soong_injection//product_config_platforms/products/aosp_arm64_for_testing:aosp_arm64_for_testing_product_vars",
- "@soong_injection//product_config_platforms/products/aosp_x86_for_testing:aosp_x86_for_testing_constraint_value": "@soong_injection//product_config_platforms/products/aosp_x86_for_testing:aosp_x86_for_testing_product_vars",
- "@soong_injection//product_config_platforms/products/aosp_x86_64_for_testing:aosp_x86_64_for_testing_constraint_value": "@soong_injection//product_config_platforms/products/aosp_x86_64_for_testing:aosp_x86_64_for_testing_product_vars",
- "@soong_injection//product_config_platforms/products/aosp_arm64_for_testing_no_compression:aosp_arm64_for_testing_no_compression_constraint_value": "@soong_injection//product_config_platforms/products/aosp_arm64_for_testing_no_compression:aosp_arm64_for_testing_no_compression_product_vars",
- }),
-)
+`)),
+ newFile(
+ "product_config_platforms",
+ "product_labels.bzl",
+ productReplacer.Replace(`
+# This file keeps a list of all the products in the android source tree, because they're
+# discovered as part of a preprocessing step before bazel runs.
+# TODO: When we start generating the platforms for more than just the
+# currently lunched product, they should all be listed here
+product_labels = [
+ "@soong_injection//{PRODUCT_FOLDER}:{PRODUCT}-{VARIANT}"
+]
`)),
newFile(
"product_config_platforms",
@@ -127,42 +125,5 @@ flags:
`)),
}
- // Add some products for testing
- for _, arch := range []string{"arm", "arm64", "x86", "x86_64"} {
- result = append(result, newFile(
- fmt.Sprintf("product_config_platforms/products/aosp_%s_for_testing", arch),
- "BUILD",
- fmt.Sprintf(`
-package(default_visibility=[
- "@soong_injection//product_config_platforms:__subpackages__",
- "@//build/bazel/product_config:__subpackages__",
-])
-load("@//build/bazel/tests/products:aosp_%s.variables.bzl", _soong_variables = "variables")
-load("@//build/bazel/product_config:android_product.bzl", "android_product")
-
-android_product(
- name = "aosp_%s_for_testing",
- soong_variables = _soong_variables,
-)
-`, arch, arch)))
- }
- result = append(result, newFile(
- "product_config_platforms/products/aosp_arm64_for_testing_no_compression",
- "BUILD",
- `
-package(default_visibility=[
- "@soong_injection//product_config_platforms:__subpackages__",
- "@//build/bazel/product_config:__subpackages__",
-])
-load("@bazel_skylib//lib:dicts.bzl", "dicts")
-load("@//build/bazel/tests/products:aosp_arm64.variables.bzl", _soong_variables = "variables")
-load("@//build/bazel/product_config:android_product.bzl", "android_product")
-
-android_product(
- name = "aosp_arm64_for_testing_no_compression",
- soong_variables = dicts.add(_soong_variables, {"CompressedApex": False}),
-)
-`))
-
return result, nil
}