Refactor cc/sabi.go

* Rename `vndk_deps` mutator to `sabi_deps` to better reflect its
  purpose.
* Eliminate duplication of ABI dump generation logic. sabiDepsMutator
  should call libraryDecorator.shouldCreateSourceAbiDump() to determine
  if a module needs to be marked with CreateSAbiDumps.
* Non-VNDK libraries that are opt-in to ABI check would have their
  dependencies correctly marked with CreateSAbiDumps.
* Refactor some lines to idiomatic syntax.
* Add comment strings.

Bug: 145608479
Bug: 173492236
Test: TH presubmit
Change-Id: I99e97787bdf2a4f0c970809161b64aa668ff3d1a
This commit is contained in:
Yo Chiang
2020-11-19 16:30:49 +08:00
parent 9ae3c52b20
commit 8aa4e3f99e
4 changed files with 54 additions and 44 deletions

View File

@@ -79,7 +79,6 @@ func RegisterCCBuildComponents(ctx android.RegistrationContext) {
ctx.BottomUp("sanitize_runtime", sanitizerRuntimeMutator).Parallel()
ctx.BottomUp("coverage", coverageMutator).Parallel()
ctx.TopDown("vndk_deps", sabiDepsMutator)
ctx.TopDown("lto_deps", ltoDepsMutator)
ctx.BottomUp("lto", ltoMutator).Parallel()
@@ -88,6 +87,11 @@ func RegisterCCBuildComponents(ctx android.RegistrationContext) {
ctx.TopDown("double_loadable", checkDoubleLoadableLibraries).Parallel()
})
ctx.FinalDepsMutators(func(ctx android.RegisterMutatorsContext) {
// sabi mutator needs to be run after apex mutator finishes.
ctx.TopDown("sabi_deps", sabiDepsMutator)
})
ctx.RegisterSingletonType("kythe_extract_all", kytheExtractAllFactory)
}