summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2024-11-20 15:07:58 -0800
committer Colin Cross <ccross@android.com> 2024-12-12 14:55:28 -0800
commitaf4c8562a29e152cd473f64e938638b44d57078b (patch)
tree590129592e5da4dc09a68cf3d5e448ebb79f020c /java
parent8acea3e421fff22567fbbe21f0b91ca85857cf1c (diff)
Remove TestApexes from ApexInfo
TestApexes is used to enforce the "Stub libraries should have a single apex_available" check, but requires propagating information from multiple apexes in order to filter out the test apexes. Instead, all test apexes used by stub libraries will set apex_available_name to masquerade as their non-test counterpart for apex_available checks. Bug: 383592644 Test: TestStubLibrariesMultipleApexViolation Change-Id: I57dcf1e6fabbe70f40d702490b93fc7f28d6eba2
Diffstat (limited to 'java')
-rw-r--r--java/dexpreopt.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/java/dexpreopt.go b/java/dexpreopt.go
index 5928446e3..44ba80a10 100644
--- a/java/dexpreopt.go
+++ b/java/dexpreopt.go
@@ -211,20 +211,19 @@ func disableSourceApexVariant(ctx android.BaseModuleContext) bool {
})
// Find the apex variant for this module
- apexVariantsWithoutTestApexes := []string{}
+ apexVariants := []string{}
if apexInfo.BaseApexName != "" {
// This is a transitive dependency of an override_apex
- apexVariantsWithoutTestApexes = append(apexVariantsWithoutTestApexes, apexInfo.BaseApexName)
+ apexVariants = append(apexVariants, apexInfo.BaseApexName)
} else {
- _, variants, _ := android.ListSetDifference(apexInfo.InApexVariants, apexInfo.TestApexes)
- apexVariantsWithoutTestApexes = append(apexVariantsWithoutTestApexes, variants...)
+ apexVariants = append(apexVariants, apexInfo.InApexVariants...)
}
if apexInfo.ApexAvailableName != "" {
- apexVariantsWithoutTestApexes = append(apexVariantsWithoutTestApexes, apexInfo.ApexAvailableName)
+ apexVariants = append(apexVariants, apexInfo.ApexAvailableName)
}
disableSource := false
// find the selected apexes
- for _, apexVariant := range apexVariantsWithoutTestApexes {
+ for _, apexVariant := range apexVariants {
if len(psi.GetSelectedModulesForApiDomain(apexVariant)) > 0 {
// If the apex_contribution for this api domain is non-empty, disable the source variant
disableSource = true