Select supports product_variable("debuggable")

Bug: N/A
Test: run soong test with the next change
Change-Id: Id7a83961dc9f47191135219f0cea2c02b64a1666
This commit is contained in:
Jiyong Park 2024-05-17 14:56:10 +09:00
parent 4332f7bf9e
commit e325075163

View file

@ -2161,9 +2161,19 @@ func (e configurationEvalutor) EvaluateConfiguration(condition proptools.Configu
} }
return proptools.ConfigurableValueUndefined() return proptools.ConfigurableValueUndefined()
case "product_variable": case "product_variable":
// TODO(b/323382414): Might add these on a case-by-case basis if condition.NumArgs() != 1 {
ctx.OtherModulePropertyErrorf(m, property, "TODO(b/323382414): Product variables are not yet supported in selects") ctx.OtherModulePropertyErrorf(m, property, "product_variable requires 1 argument, found %d", condition.NumArgs())
return proptools.ConfigurableValueUndefined() 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": case "soong_config_variable":
if condition.NumArgs() != 2 { if condition.NumArgs() != 2 {
ctx.OtherModulePropertyErrorf(m, property, "soong_config_variable requires 2 arguments, found %d", condition.NumArgs()) ctx.OtherModulePropertyErrorf(m, property, "soong_config_variable requires 2 arguments, found %d", condition.NumArgs())