aboutsummaryrefslogtreecommitdiff
path: root/apex
diff options
context:
space:
mode:
authorCole Faust <colefaust@google.com>2023-03-08 12:29:50 -0800
committerCole Faust <colefaust@google.com>2023-03-08 12:29:50 -0800
commit912bc8862e125e3d84bb2aa885ffe19da835ecef (patch)
tree6fe648b395b1b63d15225b5cbcc49a85491bfbf4 /apex
parent8eb8ae649caf4c6949a0c77498f5858d4730d6a1 (diff)
downloadsoong-912bc8862e125e3d84bb2aa885ffe19da835ecef.tar.gz
Use product variables from the overridden apex
override_apex's bp2build converter had a bug where it was looking at the product variables for the override_apex module itself instead of for the base module it is overriding. Fixes: 271424349 Test: go test Change-Id: If1e2653d3751fa908faf0ab97dfa2e943ebe98ec
Diffstat (limited to 'apex')
-rw-r--r--apex/apex.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/apex/apex.go b/apex/apex.go
index 88eb72fef..f50687613 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -50,7 +50,7 @@ func registerApexBuildComponents(ctx android.RegistrationContext) {
ctx.RegisterModuleType("apex", BundleFactory)
ctx.RegisterModuleType("apex_test", TestApexBundleFactory)
ctx.RegisterModuleType("apex_vndk", vndkApexBundleFactory)
- ctx.RegisterModuleType("apex_defaults", defaultsFactory)
+ ctx.RegisterModuleType("apex_defaults", DefaultsFactory)
ctx.RegisterModuleType("prebuilt_apex", PrebuiltFactory)
ctx.RegisterModuleType("override_apex", OverrideApexFactory)
ctx.RegisterModuleType("apex_set", apexSetFactory)
@@ -2728,14 +2728,9 @@ type Defaults struct {
}
// apex_defaults provides defaultable properties to other apex modules.
-func defaultsFactory() android.Module {
- return DefaultsFactory()
-}
-
-func DefaultsFactory(props ...interface{}) android.Module {
+func DefaultsFactory() android.Module {
module := &Defaults{}
- module.AddProperties(props...)
module.AddProperties(
&apexBundleProperties{},
&apexTargetBundleProperties{},
@@ -3538,7 +3533,7 @@ func convertWithBp2build(a *apexBundle, ctx android.TopDownMutatorContext) (baze
fileContextsLabelAttribute.SetValue(android.BazelLabelForModuleSrcSingle(ctx, *a.properties.File_contexts))
}
- productVariableProps := android.ProductVariableProperties(ctx)
+ productVariableProps := android.ProductVariableProperties(ctx, a)
// 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