diff options
author | Jiyong Park <jiyong@google.com> | 2024-05-17 14:56:10 +0900 |
---|---|---|
committer | Jiyong Park <jiyong@google.com> | 2024-05-17 16:09:32 +0900 |
commit | e32507516340cceec6ac1714562ea07e8e7323e8 (patch) | |
tree | 89ab505ce49accbf7310f639df21ad07201da7b1 | |
parent | 4332f7bf9e4608e078007e39d5344ace74b32d30 (diff) | |
download | soong-e32507516340cceec6ac1714562ea07e8e7323e8.tar.gz |
Select supports product_variable("debuggable")
Bug: N/A
Test: run soong test with the next change
Change-Id: Id7a83961dc9f47191135219f0cea2c02b64a1666
-rw-r--r-- | android/module.go | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/android/module.go b/android/module.go index d4e4c2dee..c17f315a0 100644 --- a/android/module.go +++ b/android/module.go @@ -2161,9 +2161,19 @@ func (e configurationEvalutor) EvaluateConfiguration(condition proptools.Configu } return proptools.ConfigurableValueUndefined() case "product_variable": - // TODO(b/323382414): Might add these on a case-by-case basis - ctx.OtherModulePropertyErrorf(m, property, "TODO(b/323382414): Product variables are not yet supported in selects") - return proptools.ConfigurableValueUndefined() + if condition.NumArgs() != 1 { + ctx.OtherModulePropertyErrorf(m, property, "product_variable requires 1 argument, found %d", condition.NumArgs()) + return proptools.ConfigurableValueUndefined() + } + variable := condition.Arg(0) + switch variable { + case "debuggable": + return proptools.ConfigurableValueBool(ctx.Config().Debuggable()) + default: + // TODO(b/323382414): Might add these on a case-by-case basis + ctx.OtherModulePropertyErrorf(m, property, fmt.Sprintf("TODO(b/323382414): Product variable %q is not yet supported in selects", variable)) + return proptools.ConfigurableValueUndefined() + } case "soong_config_variable": if condition.NumArgs() != 2 { ctx.OtherModulePropertyErrorf(m, property, "soong_config_variable requires 2 arguments, found %d", condition.NumArgs()) |