Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1cd6d8e2 authored by Colin Cross's avatar Colin Cross Committed by Gerrit Code Review
Browse files

Merge "Export SOONG_CC_API_XML to Make outside androidmk"

parents 0f3b7d2f ebb32c48
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -294,9 +294,6 @@ func (library *libraryDecorator) AndroidMkEntries(ctx AndroidMkContext, entries
			if library.buildStubs() {
				entries.SetBool("LOCAL_NO_NOTICE_FILE", true)
			}
			if library.apiListCoverageXmlPath.String() != "" {
				entries.SetString("SOONG_CC_API_XML", "$(SOONG_CC_API_XML) "+library.apiListCoverageXmlPath.String())
			}
		})
	}
	// If a library providing a stub is included in an APEX, the private APIs of the library
+6 −0
Original line number Diff line number Diff line
@@ -1035,6 +1035,8 @@ type libraryInterface interface {
	androidMkWriteAdditionalDependenciesForSourceAbiDiff(w io.Writer)

	availableFor(string) bool

	getAPIListCoverageXMLPath() android.ModuleOutPath
}

type versionedInterface interface {
@@ -1971,6 +1973,10 @@ func (library *libraryDecorator) makeUninstallable(mod *Module) {
	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",
+12 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
package cc

import (
	"sort"
	"strings"

	"android/soong/android"
@@ -27,6 +28,8 @@ func init() {

type stubLibraries struct {
	stubLibraryMap map[string]bool

	apiListCoverageXmlPaths []string
}

// Check if the module defines stub, or itself is stub
@@ -53,6 +56,11 @@ func (s *stubLibraries) GenerateBuildActions(ctx android.SingletonContext) {
					s.stubLibraryMap[name] = true
				}
			}
			if m.library != nil {
				if p := m.library.getAPIListCoverageXMLPath().String(); p != "" {
					s.apiListCoverageXmlPaths = append(s.apiListCoverageXmlPaths, p)
				}
			}
		}
	})
}
@@ -66,4 +74,8 @@ func stubLibrariesSingleton() android.Singleton {
func (s *stubLibraries) MakeVars(ctx android.MakeVarsContext) {
	// Convert stub library file names into Makefile variable.
	ctx.Strict("STUB_LIBRARIES", strings.Join(android.SortedStringKeys(s.stubLibraryMap), " "))

	// Export the list of API XML files to Make.
	sort.Strings(s.apiListCoverageXmlPaths)
	ctx.Strict("SOONG_CC_API_XML", strings.Join(s.apiListCoverageXmlPaths, " "))
}