summaryrefslogtreecommitdiff
path: root/android/module.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2023-08-07 22:43:58 +0000
committer Spandan Das <spandandas@google.com> 2023-08-08 02:19:38 +0000
commit479e39f8fb705ab1fbd363b72cc337584ba777a7 (patch)
tree6743902adb9d57ba6533935c4a733f131a3763f0 /android/module.go
parent09f6b1390c0f11380e63fb98a8197860f04659c8 (diff)
Handle nil enabled values
If enabled does not appear inside `soong_config_vars`, we can ignore it. Bug: 210546943 Test: go test ./bp2build Change-Id: I9e4d51c3b683f262921449634f827915ce87dc8d
Diffstat (limited to 'android/module.go')
-rw-r--r--android/module.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/android/module.go b/android/module.go
index 0120a544e..a662130a7 100644
--- a/android/module.go
+++ b/android/module.go
@@ -1434,7 +1434,10 @@ func productVariableConfigEnableAttribute(ctx *topDownMutatorContext) bazel.Labe
ctx.ModuleErrorf("Could not convert product variable enabled property")
}
- if *flag {
+ if flag == nil {
+ // soong config var is not used to set `enabled`. nothing to do.
+ continue
+ } else if *flag {
axis := productConfigProp.ConfigurationAxis()
result.SetSelectValue(axis, bazel.ConditionsDefaultConfigKey, bazel.MakeLabelList([]bazel.Label{{Label: "@platforms//:incompatible"}}))
result.SetSelectValue(axis, productConfigProp.SelectKey(), bazel.LabelList{Includes: []bazel.Label{}})