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

@@ -228,6 +228,14 @@ func UpdateApexDependency(apexName string, moduleName string, directDep bool) {
apexNames[apexName] = apexNames[apexName] || directDep
}
// TODO(b/146393795): remove this when b/146393795 is fixed
func ClearApexDependency() {
m := apexNamesMap()
for k := range m {
delete(m, k)
}
}
// Tests whether a module named moduleName is directly depended on by an APEX
// named apexName.
func DirectlyInApex(apexName string, moduleName string) bool {