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

Commit 67883b3e authored by Jiyong Park's avatar Jiyong Park
Browse files

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
parent d26357eb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -664,5 +664,5 @@ func TestStaticLinking(t *testing.T) {
	ldFlags := ctx.ModuleForTests("not_in_apex", "android_arm64_armv8-a_core").Rule("ld").Args["libFlags"]

	// Ensure that not_in_apex is linking with the static variant of mylib
	ensureContains(t, ldFlags, "mylib/android_arm64_armv8-a_core_static/mylib.a")
	ensureContains(t, ldFlags, "mylib/android_arm64_armv8-a_core_static_platform/mylib.a")
}
+1 −1
Original line number Diff line number Diff line
@@ -1059,7 +1059,7 @@ func VersionMutator(mctx android.BottomUpMutatorContext) {
			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 {