Merge "add walkPayloadDeps" am: 58b5030e30
am: 1cf0db8136
Change-Id: Ib266fa82bcd70fd39a663ebcaa60d5c0148cc0b1
This commit is contained in:
commit
230eceddce
40
apex/apex.go
40
apex/apex.go
|
@ -1936,21 +1936,9 @@ func (c *flattenedApexContext) InstallBypassMake() bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensures that the dependencies are marked as available for this APEX
|
// Visit dependencies that contributes to the payload of this APEX
|
||||||
func (a *apexBundle) checkApexAvailability(ctx android.ModuleContext) {
|
func (a *apexBundle) walkPayloadDeps(ctx android.ModuleContext,
|
||||||
// Let's be practical. Availability for test, host, and the VNDK apex isn't important
|
do func(ctx android.ModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool)) {
|
||||||
if ctx.Host() || a.testApex || a.vndkApex {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
checkDep := func(ctx android.ModuleContext, am android.ApexModule) {
|
|
||||||
apexName := ctx.ModuleName()
|
|
||||||
if am.AvailableFor(apexName) || whitelistedApexAvailable(apexName, am) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
ctx.ModuleErrorf("requires %q that is not available for the APEX.", am.Name())
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.WalkDepsBlueprint(func(child, parent blueprint.Module) bool {
|
ctx.WalkDepsBlueprint(func(child, parent blueprint.Module) bool {
|
||||||
am, ok := child.(android.ApexModule)
|
am, ok := child.(android.ApexModule)
|
||||||
if !ok || !am.CanHaveApexVariants() {
|
if !ok || !am.CanHaveApexVariants() {
|
||||||
|
@ -1960,7 +1948,7 @@ func (a *apexBundle) checkApexAvailability(ctx android.ModuleContext) {
|
||||||
// Check for the direct dependencies that contribute to the payload
|
// Check for the direct dependencies that contribute to the payload
|
||||||
if dt, ok := ctx.OtherModuleDependencyTag(child).(dependencyTag); ok {
|
if dt, ok := ctx.OtherModuleDependencyTag(child).(dependencyTag); ok {
|
||||||
if dt.payload {
|
if dt.payload {
|
||||||
checkDep(ctx, am)
|
do(ctx, parent, am, false /* externalDep */)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
@ -1968,15 +1956,33 @@ func (a *apexBundle) checkApexAvailability(ctx android.ModuleContext) {
|
||||||
|
|
||||||
// Check for the indirect dependencies if it is considered as part of the APEX
|
// Check for the indirect dependencies if it is considered as part of the APEX
|
||||||
if am.DepIsInSameApex(ctx, am) {
|
if am.DepIsInSameApex(ctx, am) {
|
||||||
checkDep(ctx, am)
|
do(ctx, parent, am, false /* externalDep */)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do(ctx, parent, am, true /* externalDep */)
|
||||||
|
|
||||||
// As soon as the dependency graph crosses the APEX boundary, don't go further.
|
// As soon as the dependency graph crosses the APEX boundary, don't go further.
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensures that the dependencies are marked as available for this APEX
|
||||||
|
func (a *apexBundle) checkApexAvailability(ctx android.ModuleContext) {
|
||||||
|
// Let's be practical. Availability for test, host, and the VNDK apex isn't important
|
||||||
|
if ctx.Host() || a.testApex || a.vndkApex {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
a.walkPayloadDeps(ctx, func(ctx android.ModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) {
|
||||||
|
apexName := ctx.ModuleName()
|
||||||
|
if externalDep || to.AvailableFor(apexName) || whitelistedApexAvailable(apexName, to) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
ctx.ModuleErrorf("requires %q that is not available for the APEX.", to.Name())
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||||
buildFlattenedAsDefault := ctx.Config().FlattenApex() && !ctx.Config().UnbundledBuild()
|
buildFlattenedAsDefault := ctx.Config().FlattenApex() && !ctx.Config().UnbundledBuild()
|
||||||
switch a.properties.ApexType {
|
switch a.properties.ApexType {
|
||||||
|
|
Loading…
Reference in New Issue