Merge changes I505a7ad8,I92d88199 into main am: fae5ec8bbc
am: 68168d7b56
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3258011 Change-Id: I3ff37fd8fe971ffc9cab1fc164fe9885abad7015 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -88,6 +88,9 @@ type ApexInfo struct {
|
|||||||
|
|
||||||
// Returns the name of the overridden apex (com.android.foo)
|
// Returns the name of the overridden apex (com.android.foo)
|
||||||
BaseApexName string
|
BaseApexName string
|
||||||
|
|
||||||
|
// Returns the value of `apex_available_name`
|
||||||
|
ApexAvailableName string
|
||||||
}
|
}
|
||||||
|
|
||||||
// AllApexInfo holds the ApexInfo of all apexes that include this module.
|
// AllApexInfo holds the ApexInfo of all apexes that include this module.
|
||||||
|
@@ -1071,6 +1071,7 @@ func (a *apexBundle) ApexInfoMutator(mctx android.TopDownMutatorContext) {
|
|||||||
ApexContents: []*android.ApexContents{apexContents},
|
ApexContents: []*android.ApexContents{apexContents},
|
||||||
TestApexes: testApexes,
|
TestApexes: testApexes,
|
||||||
BaseApexName: mctx.ModuleName(),
|
BaseApexName: mctx.ModuleName(),
|
||||||
|
ApexAvailableName: proptools.String(a.properties.Apex_available_name),
|
||||||
}
|
}
|
||||||
mctx.WalkDeps(func(child, parent android.Module) bool {
|
mctx.WalkDeps(func(child, parent android.Module) bool {
|
||||||
if !continueApexDepsWalk(child, parent) {
|
if !continueApexDepsWalk(child, parent) {
|
||||||
|
@@ -835,6 +835,7 @@ func TestBootclasspathFragment_HiddenAPIList(t *testing.T) {
|
|||||||
`)
|
`)
|
||||||
|
|
||||||
java.CheckModuleDependencies(t, result.TestContext, "mybootclasspathfragment", "android_common_apex10000", []string{
|
java.CheckModuleDependencies(t, result.TestContext, "mybootclasspathfragment", "android_common_apex10000", []string{
|
||||||
|
"all_apex_contributions",
|
||||||
"art-bootclasspath-fragment",
|
"art-bootclasspath-fragment",
|
||||||
"bar",
|
"bar",
|
||||||
"dex2oatd",
|
"dex2oatd",
|
||||||
@@ -1006,6 +1007,7 @@ func TestBootclasspathFragment_AndroidNonUpdatable_FromSource(t *testing.T) {
|
|||||||
`)
|
`)
|
||||||
|
|
||||||
java.CheckModuleDependencies(t, result.TestContext, "mybootclasspathfragment", "android_common_apex10000", []string{
|
java.CheckModuleDependencies(t, result.TestContext, "mybootclasspathfragment", "android_common_apex10000", []string{
|
||||||
|
"all_apex_contributions",
|
||||||
"android-non-updatable.stubs",
|
"android-non-updatable.stubs",
|
||||||
"android-non-updatable.stubs.module_lib",
|
"android-non-updatable.stubs.module_lib",
|
||||||
"android-non-updatable.stubs.system",
|
"android-non-updatable.stubs.system",
|
||||||
@@ -1178,6 +1180,7 @@ func TestBootclasspathFragment_AndroidNonUpdatable_FromText(t *testing.T) {
|
|||||||
`)
|
`)
|
||||||
|
|
||||||
java.CheckModuleDependencies(t, result.TestContext, "mybootclasspathfragment", "android_common_apex10000", []string{
|
java.CheckModuleDependencies(t, result.TestContext, "mybootclasspathfragment", "android_common_apex10000", []string{
|
||||||
|
"all_apex_contributions",
|
||||||
"android-non-updatable.stubs",
|
"android-non-updatable.stubs",
|
||||||
"android-non-updatable.stubs.system",
|
"android-non-updatable.stubs.system",
|
||||||
"android-non-updatable.stubs.test",
|
"android-non-updatable.stubs.test",
|
||||||
@@ -1331,6 +1334,7 @@ func TestBootclasspathFragment_AndroidNonUpdatable_AlwaysUsePrebuiltSdks(t *test
|
|||||||
`)
|
`)
|
||||||
|
|
||||||
java.CheckModuleDependencies(t, result.TestContext, "mybootclasspathfragment", "android_common_apex10000", []string{
|
java.CheckModuleDependencies(t, result.TestContext, "mybootclasspathfragment", "android_common_apex10000", []string{
|
||||||
|
"all_apex_contributions",
|
||||||
"art-bootclasspath-fragment",
|
"art-bootclasspath-fragment",
|
||||||
"bar",
|
"bar",
|
||||||
"dex2oatd",
|
"dex2oatd",
|
||||||
|
@@ -463,6 +463,12 @@ func (b *BootclasspathFragmentModule) DepsMutator(ctx android.BottomUpMutatorCon
|
|||||||
// Add a dependency onto the dex2oat tool which is needed for creating the boot image. The
|
// Add a dependency onto the dex2oat tool which is needed for creating the boot image. The
|
||||||
// path is retrieved from the dependency by GetGlobalSoongConfig(ctx).
|
// path is retrieved from the dependency by GetGlobalSoongConfig(ctx).
|
||||||
dexpreopt.RegisterToolDeps(ctx)
|
dexpreopt.RegisterToolDeps(ctx)
|
||||||
|
|
||||||
|
// Add a dependency to `all_apex_contributions` to determine if prebuilts are active.
|
||||||
|
// If prebuilts are active, `contents` validation on the source bootclasspath fragment should be disabled.
|
||||||
|
if _, isPrebuiltModule := ctx.Module().(*PrebuiltBootclasspathFragmentModule); !isPrebuiltModule {
|
||||||
|
ctx.AddDependency(b, android.AcDepTag, "all_apex_contributions")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BootclasspathFragmentModule) BootclasspathDepsMutator(ctx android.BottomUpMutatorContext) {
|
func (b *BootclasspathFragmentModule) BootclasspathDepsMutator(ctx android.BottomUpMutatorContext) {
|
||||||
|
@@ -209,13 +209,18 @@ func disableSourceApexVariant(ctx android.BaseModuleContext) bool {
|
|||||||
psi = prebuiltSelectionInfo
|
psi = prebuiltSelectionInfo
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// Find the apex variant for this module
|
// Find the apex variant for this module
|
||||||
var apexVariantsWithoutTestApexes []string
|
apexVariantsWithoutTestApexes := []string{}
|
||||||
if apexInfo.BaseApexName != "" {
|
if apexInfo.BaseApexName != "" {
|
||||||
// This is a transitive dependency of an override_apex
|
// This is a transitive dependency of an override_apex
|
||||||
apexVariantsWithoutTestApexes = []string{apexInfo.BaseApexName}
|
apexVariantsWithoutTestApexes = append(apexVariantsWithoutTestApexes, apexInfo.BaseApexName)
|
||||||
} else {
|
} else {
|
||||||
_, apexVariantsWithoutTestApexes, _ = android.ListSetDifference(apexInfo.InApexVariants, apexInfo.TestApexes)
|
_, variants, _ := android.ListSetDifference(apexInfo.InApexVariants, apexInfo.TestApexes)
|
||||||
|
apexVariantsWithoutTestApexes = append(apexVariantsWithoutTestApexes, variants...)
|
||||||
|
}
|
||||||
|
if apexInfo.ApexAvailableName != "" {
|
||||||
|
apexVariantsWithoutTestApexes = append(apexVariantsWithoutTestApexes, apexInfo.ApexAvailableName)
|
||||||
}
|
}
|
||||||
disableSource := false
|
disableSource := false
|
||||||
// find the selected apexes
|
// find the selected apexes
|
||||||
|
Reference in New Issue
Block a user