From d649580f3d46b39f8837d668063f9b8ebde0474a Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 14 Jan 2025 15:50:48 -0800 Subject: Convert apex transition tag to dependency on apex When the apex mutator moves to using an info struct instead of a simple string it becomes difficult to add a dependency directly on the apex variation of a module, as that would require constructing a matching ApexInfo to locate it. Simplify adding the dependency by adding it on the apex instead, and then traversing from the apex to the desired module inside the apex. This causes a few changes in behaviors that require updating tests to match. When AlwaysUsePrebuiltSdks is set, the previous behavior was to use the fragment and its dependencies from the source module for the platform bootclasspath. Since the fragment is now found by traversing from the apex, and the prebuilt apex is preferred, the fragment from the prebuilt will now be found instead. prebuilt_bootclasspath lists fragments in apexes that it depends on. Previously it would depend on the apex variant of the fragment, which then allowed the fragment to be replaced by the variant from an override apex that set apex_name. Now it always depends on the original apex to find the fragment. Test: go test ./... Bug: 372543712 Change-Id: I1a92ff461d4706cf68a0b8b37e53dea412efb8bf --- apex/apex.go | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'apex/apex.go') diff --git a/apex/apex.go b/apex/apex.go index 1d74466b7..24b3118a4 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -1211,13 +1211,6 @@ func markPlatformAvailability(mctx android.BottomUpMutatorContext) { } } -type apexTransitionTag interface { - // ApexTransition is a temporary interface used to tag dependencies with the apex variation they should use - // when the dependency is added before the apex transition mutator has run. These will be replaced with - // dependencies on the apex instead, which will then be used to find the necessary module inside the apex. - ApexTransition() string -} - type apexTransitionMutator struct{} func (a *apexTransitionMutator) Split(ctx android.BaseModuleContext) []string { @@ -1232,9 +1225,6 @@ func (a *apexTransitionMutator) Split(ctx android.BaseModuleContext) []string { } func (a *apexTransitionMutator) OutgoingTransition(ctx android.OutgoingTransitionContext, sourceVariation string) string { - if tag, ok := ctx.DepTag().(apexTransitionTag); ok { - return tag.ApexTransition() - } return sourceVariation } -- cgit v1.2.3-59-g8ed1b