diff options
author | 2025-01-14 15:50:48 -0800 | |
---|---|---|
committer | 2025-02-07 16:00:56 -0800 | |
commit | d649580f3d46b39f8837d668063f9b8ebde0474a (patch) | |
tree | 819a6a4beb1eca9e6a705bb0f8ac28389b355b6e /apex/apex.go | |
parent | bdd344b91a5990d797eef508821a877febd0d7a0 (diff) |
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
Diffstat (limited to 'apex/apex.go')
-rw-r--r-- | apex/apex.go | 10 |
1 files changed, 0 insertions, 10 deletions
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 } |