Merge changes I16389102,I105f4fba am: 12206326d6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1689752 Change-Id: Ida86926b0fc80b47228ff2975b714cb9af50a4dd
This commit is contained in:
commit
bbc5cbcf0f
|
@ -69,13 +69,15 @@ func addDependencyOntoApexVariants(ctx android.BottomUpMutatorContext, propertyN
|
|||
// addDependencyOntoApexModulePair adds a dependency onto the specified APEX specific variant or the
|
||||
// specified module.
|
||||
//
|
||||
// If apex="platform" then this adds a dependency onto the platform variant of the module. This adds
|
||||
// dependencies onto the prebuilt and source modules with the specified name, depending on which
|
||||
// ones are available. Visiting must use isActiveModule to select the preferred module when both
|
||||
// source and prebuilt modules are available.
|
||||
// If apex="platform" or "system_ext" then this adds a dependency onto the platform variant of the
|
||||
// module. This adds dependencies onto the prebuilt and source modules with the specified name,
|
||||
// depending on which ones are available. Visiting must use isActiveModule to select the preferred
|
||||
// module when both source and prebuilt modules are available.
|
||||
//
|
||||
// Use gatherApexModulePairDepsWithTag to retrieve the dependencies.
|
||||
func addDependencyOntoApexModulePair(ctx android.BottomUpMutatorContext, apex string, name string, tag blueprint.DependencyTag) {
|
||||
var variations []blueprint.Variation
|
||||
if apex != "platform" {
|
||||
if apex != "platform" && apex != "system_ext" {
|
||||
// Pick the correct apex variant.
|
||||
variations = []blueprint.Variation{
|
||||
{Mutator: "apex", Variation: apex},
|
||||
|
@ -118,12 +120,28 @@ func reportMissingVariationDependency(ctx android.BottomUpMutatorContext, variat
|
|||
ctx.AddFarVariationDependencies(variations, nil, name)
|
||||
}
|
||||
|
||||
// gatherApexModulePairDepsWithTag returns the list of dependencies with the supplied tag that was
|
||||
// added by addDependencyOntoApexModulePair.
|
||||
func gatherApexModulePairDepsWithTag(ctx android.BaseModuleContext, tag blueprint.DependencyTag) []android.Module {
|
||||
var modules []android.Module
|
||||
ctx.VisitDirectDepsIf(isActiveModule, func(module android.Module) {
|
||||
t := ctx.OtherModuleDependencyTag(module)
|
||||
if t == tag {
|
||||
modules = append(modules, module)
|
||||
}
|
||||
})
|
||||
return modules
|
||||
}
|
||||
|
||||
// ApexVariantReference specifies a particular apex variant of a module.
|
||||
type ApexVariantReference struct {
|
||||
// The name of the module apex variant, i.e. the apex containing the module variant.
|
||||
//
|
||||
// If this is not specified then it defaults to "platform" which will cause a dependency to be
|
||||
// added to the module's platform variant.
|
||||
//
|
||||
// A value of system_ext should be used for any module that will be part of the system_ext
|
||||
// partition.
|
||||
Apex *string
|
||||
|
||||
// The name of the module.
|
||||
|
|
|
@ -186,7 +186,7 @@ func isModuleInConfiguredList(ctx android.BaseModuleContext, module android.Modu
|
|||
|
||||
// Now match the apex part of the boot image configuration.
|
||||
requiredApex := configuredBootJars.Apex(index)
|
||||
if requiredApex == "platform" {
|
||||
if requiredApex == "platform" || requiredApex == "system_ext" {
|
||||
if len(apexInfo.InApexes) != 0 {
|
||||
// A platform variant is required but this is for an apex so ignore it.
|
||||
return false
|
||||
|
|
|
@ -152,14 +152,8 @@ func addDependenciesOntoBootImageModules(ctx android.BottomUpMutatorContext, mod
|
|||
func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
b.classpathFragmentBase().generateAndroidBuildActions(ctx)
|
||||
|
||||
ctx.VisitDirectDepsIf(isActiveModule, func(module android.Module) {
|
||||
tag := ctx.OtherModuleDependencyTag(module)
|
||||
if tag == platformBootclasspathModuleDepTag {
|
||||
b.configuredModules = append(b.configuredModules, module)
|
||||
} else if tag == bootclasspathFragmentDepTag {
|
||||
b.fragments = append(b.fragments, module)
|
||||
}
|
||||
})
|
||||
b.configuredModules = gatherApexModulePairDepsWithTag(ctx, platformBootclasspathModuleDepTag)
|
||||
b.fragments = gatherApexModulePairDepsWithTag(ctx, bootclasspathFragmentDepTag)
|
||||
|
||||
b.generateHiddenAPIBuildActions(ctx, b.configuredModules, b.fragments)
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ var prepareForTestWithPlatformBootclasspath = android.GroupFixturePreparers(
|
|||
func TestPlatformBootclasspath(t *testing.T) {
|
||||
preparer := android.GroupFixturePreparers(
|
||||
prepareForTestWithPlatformBootclasspath,
|
||||
FixtureConfigureBootJars("platform:foo", "platform:bar"),
|
||||
FixtureConfigureBootJars("platform:foo", "system_ext:bar"),
|
||||
android.FixtureWithRootAndroidBp(`
|
||||
platform_bootclasspath {
|
||||
name: "platform-bootclasspath",
|
||||
|
@ -45,6 +45,7 @@ func TestPlatformBootclasspath(t *testing.T) {
|
|||
system_modules: "none",
|
||||
sdk_version: "none",
|
||||
compile_dex: true,
|
||||
system_ext_specific: true,
|
||||
}
|
||||
`),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue