summaryrefslogtreecommitdiff
path: root/apex/apex.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2025-01-14 16:01:03 -0800
committer Colin Cross <ccross@android.com> 2025-02-07 16:00:56 -0800
commitbdd344b91a5990d797eef508821a877febd0d7a0 (patch)
treecbc635952906b3c6834c098c9c4a50c4276b2ad8 /apex/apex.go
parentd8d8b85c5666b3ded986f1b5c64df31dea5076ee (diff)
Add extra dependency from apex to bootclasspath fragments to modules
An extra dependency from apex modules to their bootclasspath fragments and from bootclasspath fragments to their contents is necessary, as the existing one with bcpfTag return false from ReplaceSourceWithPrebuilt to never rewrite the dependency to the prebuilt fragment, and we'll need a dependency to the prebuilt fragment in the next CL. Bug: 372543712 Test: all soong tests pass Change-Id: I87ff3afa0d5c90936664dd493654f1d64230b8a9
Diffstat (limited to 'apex/apex.go')
-rw-r--r--apex/apex.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/apex/apex.go b/apex/apex.go
index bbcc4cc58..1d74466b7 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -768,6 +768,17 @@ var (
shBinaryTag = &dependencyTag{name: "shBinary", payload: true}
)
+type fragmentInApexDepTag struct {
+ blueprint.BaseDependencyTag
+ android.FragmentInApexTag
+}
+
+func (fragmentInApexDepTag) ExcludeFromVisibilityEnforcement() {}
+
+// fragmentInApexTag is used by apex modules to depend on their fragments. Java bootclasspath
+// modules can traverse from the apex to the fragment using android.IsFragmentInApexTag.
+var fragmentInApexTag = fragmentInApexDepTag{}
+
// TODO(jiyong): shorten this function signature
func addDependenciesForNativeModules(ctx android.BottomUpMutatorContext, nativeModules ResolvedApexNativeDependencies, target android.Target, imageVariation string) {
binVariations := target.Variations()
@@ -916,6 +927,7 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
commonVariation := ctx.Config().AndroidCommonTarget.Variations()
ctx.AddFarVariationDependencies(commonVariation, rroTag, a.properties.Rros...)
ctx.AddFarVariationDependencies(commonVariation, bcpfTag, a.properties.Bootclasspath_fragments.GetOrDefault(ctx, nil)...)
+ ctx.AddFarVariationDependencies(commonVariation, fragmentInApexTag, a.properties.Bootclasspath_fragments.GetOrDefault(ctx, nil)...)
ctx.AddFarVariationDependencies(commonVariation, sscpfTag, a.properties.Systemserverclasspath_fragments.GetOrDefault(ctx, nil)...)
ctx.AddFarVariationDependencies(commonVariation, javaLibTag, a.properties.Java_libs...)
ctx.AddFarVariationDependencies(commonVariation, fsTag, a.properties.Filesystems...)
@@ -1048,6 +1060,12 @@ func (a *apexBundle) ApexInfoMutator(mctx android.TopDownMutatorContext) {
ApexAvailableName: proptools.String(a.properties.Apex_available_name),
}
mctx.WalkDeps(func(child, parent android.Module) bool {
+ if parent == mctx.Module() {
+ tag := mctx.OtherModuleDependencyTag(child)
+ if _, ok := tag.(*dependencyTag); !ok {
+ return false
+ }
+ }
if !continueApexDepsWalk(child, parent) {
return false
}