For test apexes, base_apex_name is the api domain
apex_test do not "override" the source apexes that they test. However,
similar to override_apexes, test apexes have the same path
(/apex/<apex_name>) on device. Instead of creating another property,
reuse the existing base_apex_name property. The use case for this will
be for creating selection statements for stub/impl selection.
Test: go test ./bp2build
Change-Id: I4b7548e0e0fc920e407e1c5e5c00e87efc6e70c9
diff --git a/apex/apex.go b/apex/apex.go
index 69547c3..e01406b 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -3703,6 +3703,8 @@
commonAttrs := android.CommonAttributes{}
if a.testApex {
commonAttrs.Testonly = proptools.BoolPtr(true)
+ // Set the api_domain of the test apex
+ attrs.Base_apex_name = proptools.StringPtr(cc.GetApiDomain(a.Name()))
}
return attrs, props, commonAttrs