Replace soong config list variable with selects
It would be more work to support setting configurable properties with
soong config list variables, so instead, replace it with selects.
The selects are more verbose than the list variable, but at the same
time, they're replacing this logic in make:
https://cs.android.com/android/platform/superproject/main/+/main:build/make/core/config.mk;l=870;drc=b20aee1b1e015171986afa5c2ddfcd3452d3b2dc
In the future we may want to come up with a proper list comprehension
syntax in soong to make this shorter.
Bug: 347605145
Bug: 342006386
Test: m nothing --no-skip-soong-tests
Change-Id: I0157056457d8f56c3bba85bd89c682d485d39793
diff --git a/Android.bp b/Android.bp
index 496de06..1a2d1ef 100644
--- a/Android.bp
+++ b/Android.bp
@@ -88,16 +88,7 @@
srcs: ["technical_debt.cil"],
}
-soong_config_module_type {
- name: "se_phony",
- module_type: "phony",
- config_namespace: "ANDROID",
- bool_variables: ["PRODUCT_PRECOMPILED_SEPOLICY"],
- list_variables: ["PLATFORM_SEPOLICY_COMPAT_VERSIONS"],
- properties: ["required"],
-}
-
-se_phony {
+phony {
// Currently used only for aosp_cf_system_x86_64
// TODO(b/329208946): migrate selinux_policy_system to Soong
name: "selinux_policy_system_soong",
@@ -113,18 +104,28 @@
"plat_sepolicy.cil",
"plat_service_contexts",
"secilc",
- ],
- soong_config_variables: {
- PLATFORM_SEPOLICY_COMPAT_VERSIONS: {
- required: [
- "plat_%s.cil",
- "%s.compat.cil",
- ],
- },
- PRODUCT_PRECOMPILED_SEPOLICY: {
- required: ["plat_sepolicy_and_mapping.sha256"],
- },
- },
+ "plat_29.0.cil",
+ "29.0.compat.cil",
+ "plat_30.0.cil",
+ "30.0.compat.cil",
+ "plat_31.0.cil",
+ "31.0.compat.cil",
+ "plat_32.0.cil",
+ "32.0.compat.cil",
+ "plat_33.0.cil",
+ "33.0.compat.cil",
+ "plat_34.0.cil",
+ "34.0.compat.cil",
+ ] + select(soong_config_variable("ANDROID", "PLATFORM_SEPOLICY_VERSION"), {
+ "202404": [],
+ default: [
+ "plat_202404.cil",
+ "202404.compat.cil",
+ ],
+ }) + select(soong_config_variable("ANDROID", "PRODUCT_PRECOMPILED_SEPOLICY"), {
+ "true": ["plat_sepolicy_and_mapping.sha256"],
+ default: [],
+ }),
}
reqd_mask_policy = [":se_build_files{.reqd_mask}"]