Fix apex to follow deps of modules with stubs.

In case that an apex module depends on a module with stubs directly
*and* indirectly, the build system should follow the deps graph further.

Note that WalkDeps() visits deps in DFS and it won't visit again visited
modules.

Bug: n/a
Test: m (apex_test.go amended)
Change-Id: I1a6f135dbda6d1eb641575a3fbbc9bbee0622076
This commit is contained in:
Jooyung Han
2019-12-17 12:47:13 +09:00
parent a1682631eb
commit 671f1ce75e
3 changed files with 16 additions and 1 deletions

View File

@@ -1093,7 +1093,7 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
// don't include it in this APEX
return false
}
if !a.Host() && (cc.IsStubs() || cc.HasStubsVariants()) {
if !a.Host() && !android.DirectlyInApex(ctx.ModuleName(), ctx.OtherModuleName(cc)) && (cc.IsStubs() || cc.HasStubsVariants()) {
// If the dependency is a stubs lib, don't include it in this APEX,
// but make sure that the lib is installed on the device.
// In case no APEX is having the lib, the lib is installed to the system