diff options
author | Jooyung Han <jooyung@google.com> | 2019-01-18 15:20:43 +0900 |
---|---|---|
committer | Jooyung Han <jooyung@google.com> | 2019-03-06 11:18:21 +0900 |
commit | a70f067899c73b45558b862953ae229c313dcb12 (patch) | |
tree | 2a9f64857bd04a68a449c21f059efffd211b876d /android | |
parent | b8ba8a5ee84aa209192160de029f1c91f9dde636 (diff) | |
download | build_soong-a70f067899c73b45558b862953ae229c313dcb12.tar.gz build_soong-a70f067899c73b45558b862953ae229c313dcb12.tar.bz2 build_soong-a70f067899c73b45558b862953ae229c313dcb12.zip |
Add checks for double_loadable dependencies
Vendor-available libs can be double-loaded if LLNDK libs depend
on them. Currently soong checks only 'direct' dependency bewteen
LLNDK and VNDK lib. With this change, soong checks if every dependencies
from LLNDK is also LLNDK or VNDK-SP or marked as 'double_loadable:true'.
This change causes many libs to be marked as 'double_loadable'.
Bug: 121280180
Test: m -j
Change-Id: Ibc1879b6fd465a3141520abe0150018c3051c0a7
Diffstat (limited to 'android')
-rw-r--r-- | android/mutator.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/android/mutator.go b/android/mutator.go index e5f742f7..509b67fa 100644 --- a/android/mutator.go +++ b/android/mutator.go @@ -132,11 +132,15 @@ type TopDownMutatorContext interface { VisitDepsDepthFirst(visit func(Module)) VisitDepsDepthFirstIf(pred func(Module) bool, visit func(Module)) WalkDeps(visit func(Module, Module) bool) + // GetWalkPath is supposed to be called in visit function passed in WalkDeps() + // and returns a top-down dependency path from a start module to current child module. + GetWalkPath() []Module } type androidTopDownMutatorContext struct { blueprint.TopDownMutatorContext androidBaseContextImpl + walkPath []Module } type AndroidBottomUpMutator func(BottomUpMutatorContext) @@ -287,10 +291,16 @@ func (a *androidTopDownMutatorContext) VisitDepsDepthFirstIf(pred func(Module) b } func (a *androidTopDownMutatorContext) WalkDeps(visit func(Module, Module) bool) { + a.walkPath = []Module{a.Module()} a.TopDownMutatorContext.WalkDeps(func(child, parent blueprint.Module) bool { childAndroidModule, _ := child.(Module) parentAndroidModule, _ := parent.(Module) if childAndroidModule != nil && parentAndroidModule != nil { + // record walkPath before visit + for a.walkPath[len(a.walkPath)-1] != parentAndroidModule { + a.walkPath = a.walkPath[0 : len(a.walkPath)-1] + } + a.walkPath = append(a.walkPath, childAndroidModule) return visit(childAndroidModule, parentAndroidModule) } else { return false @@ -298,6 +308,10 @@ func (a *androidTopDownMutatorContext) WalkDeps(visit func(Module, Module) bool) }) } +func (a *androidTopDownMutatorContext) GetWalkPath() []Module { + return a.walkPath +} + func (a *androidTopDownMutatorContext) AppendProperties(props ...interface{}) { for _, p := range props { err := proptools.AppendMatchingProperties(a.Module().base().customizableProperties, |