Convert apex_available (for supported modules) to bazel tags.
The tags will then be read by an aspect applied from apex attributes to
validate that the deps are explicitly opt-in to the appropriate apex.
The semantics of this is the same as the Soong apex_available property.
This also adds the "base_apex_name" attr to override_apex conversion so
that apex_available checks continue to work on the non-Google and non-Go
apex names.
Test: presubmits
Fixes: 218841706
Change-Id: I19b3637da9aa47573b252d74f62b601fbdc3784d
diff --git a/apex/apex.go b/apex/apex.go
index b1b4e47..8e1783e 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -2676,6 +2676,10 @@
}
attrs, props := convertWithBp2build(a, ctx)
+ // We just want the name, not module reference.
+ baseApexName := strings.TrimPrefix(baseApexModuleName, ":")
+ attrs.Base_apex_name = &baseApexName
+
for _, p := range o.GetProperties() {
overridableProperties, ok := p.(*overridableProperties)
if !ok {
@@ -3397,6 +3401,7 @@
Package_name *string
Logging_parent *string
Tests bazel.LabelListAttribute
+ Base_apex_name *string
}
type convertedNativeSharedLibs struct {