Remove global state from version mutator
A per-context variable is used to store the list of modules that
contain stubs and their available versions. Stores the list of the
stubs versions on the implementation module, and then use the new
return values from AddVariationDependencies to expand dependencies
on implementation libraries to also depend on the stubs libraries.
Adds a new mutator pass to propagate list of stub versions to llndk
libraries.
Also creates an alias version variation called "latest" to allow
depending on the latest version without having to know what it is.
Test: all Soong tests
Test: no change to build.ninja, Android-${TARGET_PRODUCT}.mk, make_vars-${TARGET_PRODUCT}.mk or late-${TARGET_PRODUCT}.mk
Change-Id: If19659e2e5828c860fd4d679ef79a414b7ea2efc
diff --git a/cc/binary_sdk_member.go b/cc/binary_sdk_member.go
index a1abc72..55e400e 100644
--- a/cc/binary_sdk_member.go
+++ b/cc/binary_sdk_member.go
@@ -44,7 +44,7 @@
for _, target := range targets {
name, version := StubsLibNameAndVersion(lib)
if version == "" {
- version = LatestStubsVersionFor(mctx.Config(), name)
+ version = "latest"
}
variations := target.Variations()
if mctx.Device() {