Replace InAnyApex with checking apex_available
The InAnyApex property is set by the apex transition mutator when
any apex variants are being created. This is effectively communicating
the existence of the apex variant to the platform variant, which
complicates incremental analysis by making the platform variant
implicitly depend on the apex variant.
Replace the InAnyApex property with checking if apex_available has any
entries that are not "//apex_available:platform".
Bug: 372543712
Test: all soong tests pass
Change-Id: I2e0ae467cec0ee683ed4815a2b7397ef41375de2
diff --git a/android/apex.go b/android/apex.go
index fb2ad6c..db93912 100644
--- a/android/apex.go
+++ b/android/apex.go
@@ -252,9 +252,6 @@
// Default is ["//apex_available:platform"].
Apex_available []string
- // See ApexModule.InAnyApex()
- InAnyApex bool `blueprint:"mutated"`
-
// See ApexModule.NotAvailableForPlatform()
NotAvailableForPlatform bool `blueprint:"mutated"`
@@ -351,7 +348,12 @@
// Implements ApexModule
func (m *ApexModuleBase) InAnyApex() bool {
- return m.ApexProperties.InAnyApex
+ for _, apex_name := range m.ApexProperties.Apex_available {
+ if apex_name != AvailableToPlatform {
+ return true
+ }
+ }
+ return false
}
// Implements ApexModule
@@ -609,8 +611,6 @@
apexInfos, _ = mergeApexVariations(apexInfos)
}
- base.ApexProperties.InAnyApex = true
-
if platformVariation && !ctx.Host() && !module.AvailableFor(AvailableToPlatform) && module.NotAvailableForPlatform() {
// Do not install the module for platform, but still allow it to output
// uninstallable AndroidMk entries in certain cases when they have side