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
diff --git a/cc/library.go b/cc/library.go
index 06b9905..a7ac43d 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -596,7 +596,7 @@
// Returns a string that represents the class of the ABI dump.
// Returns an empty string if ABI check is disabled for this library.
-func (library *libraryDecorator) classifySourceAbiDump(ctx ModuleContext) string {
+func (library *libraryDecorator) classifySourceAbiDump(ctx BaseModuleContext) string {
enabled := library.Properties.Header_abi_checker.Enabled
if enabled != nil && !Bool(enabled) {
return ""
@@ -629,7 +629,7 @@
return ""
}
-func (library *libraryDecorator) shouldCreateSourceAbiDump(ctx ModuleContext) bool {
+func (library *libraryDecorator) shouldCreateSourceAbiDump(ctx BaseModuleContext) bool {
if !ctx.shouldCreateSourceAbiDump() {
return false
}