Don't panic for unhandled product vars

Instead, we return an error. This allows us to access some product
variable information earlier when it will not be used as an attribute
without panicing

Test: m nothing
Change-Id: Id094b2b9e1364a8d174d99b3824fa149fb235b3e
This commit is contained in:
Liz Kammer
2023-09-19 08:41:14 -04:00
parent 9a97a8f62a
commit 9e2a5a7d6d
7 changed files with 36 additions and 13 deletions

View File

@@ -3298,7 +3298,10 @@ func convertWithBp2build(a *apexBundle, ctx android.TopDownMutatorContext) (baze
cannedFsConfigAttribute.SetValue(android.BazelLabelForModuleSrcSingle(ctx, *a.properties.Canned_fs_config))
}
productVariableProps := android.ProductVariableProperties(ctx, a)
productVariableProps, errs := android.ProductVariableProperties(ctx, a)
for _, err := range errs {
ctx.ModuleErrorf("ProductVariableProperties error: %s", err)
}
// TODO(b/219503907) this would need to be set to a.MinSdkVersionValue(ctx) but
// given it's coming via config, we probably don't want to put it in here.
var minSdkVersion bazel.StringAttribute