Fix: stubs lib is installed in APEX
This CL fixes the problem that when a lib is defined with stubs, the
stubs variantof the lib is installed to the APEX. This was happening
because the non-stubs variant is the last variant of the 'version'
variants and addFarVariationDependencies selects the first variant when
the 'version' variant isn't specified.
Fixing the problem by making the non-stubs variant (whose name is "")
the first variant.
Test: m (apex_test)
Change-Id: I1505fd2f29a0d70c916bad51000aa06f2b80b137
diff --git a/cc/library.go b/cc/library.go
index 40c1b4f..da223dc 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -1059,7 +1059,7 @@
stubsVersionsFor(mctx.Config())[mctx.ModuleName()] = copiedVersions
// "" is for the non-stubs variant
- versions = append(versions, "")
+ versions = append([]string{""}, versions...)
modules := mctx.CreateVariations(versions...)
for i, m := range modules {