Export SOONG_CC_API_XML to Make outside androidmk
This relands Ie0a945d879de4f99ce76d005aea8041719c244f7 with a fix
to prevent building XMl files for multiple variants of a library.
The SOONG_CC_API_XML values are needed for modules that are not
exported to Make, export them from a singleton that covers all
modules instead of an AndroidMkProvider that may not be called
for some modules.
Bug: 193819970
Test: forrest
Change-Id: I54710c00901976a736e88126f406e02b1f3c3586
diff --git a/cc/library.go b/cc/library.go
index de9d01e..5306d5c 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -956,7 +956,7 @@
nativeAbiResult.versionScript)
// Parse symbol file to get API list for coverage
- if library.stubsVersion() == "current" && ctx.PrimaryArch() {
+ if library.stubsVersion() == "current" && ctx.PrimaryArch() && !ctx.inRecovery() && !ctx.inProduct() && !ctx.inVendor() {
library.apiListCoverageXmlPath = parseSymbolFileForAPICoverage(ctx, symbolFile)
}
@@ -1035,6 +1035,8 @@
androidMkWriteAdditionalDependenciesForSourceAbiDiff(w io.Writer)
availableFor(string) bool
+
+ getAPIListCoverageXMLPath() android.ModuleOutPath
}
type versionedInterface interface {
@@ -1971,6 +1973,10 @@
mod.ModuleBase.MakeUninstallable()
}
+func (library *libraryDecorator) getAPIListCoverageXMLPath() android.ModuleOutPath {
+ return library.apiListCoverageXmlPath
+}
+
var versioningMacroNamesListKey = android.NewOnceKey("versioningMacroNamesList")
// versioningMacroNamesList returns a singleton map, where keys are "version macro names",