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

Commit f4fa5450 authored by Spandan Das's avatar Spandan Das Committed by Gerrit Code Review
Browse files

Merge "Do not propagate transitive required deps of apexes" into main

parents 91043357 e545e64e
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -614,9 +614,6 @@ func newApexFile(ctx android.BaseModuleContext, builtFile android.Path, androidM
		}
		ret.moduleDir = ctx.OtherModuleDir(module)
		ret.partition = module.PartitionTag(ctx.DeviceConfig())
		ret.requiredModuleNames = module.RequiredModuleNames(ctx)
		ret.targetRequiredModuleNames = module.TargetRequiredModuleNames()
		ret.hostRequiredModuleNames = module.HostRequiredModuleNames()
		ret.multilib = module.Target().Arch.ArchType.Multilib
	}
	return ret
+0 −40
Original line number Diff line number Diff line
@@ -7938,46 +7938,6 @@ func TestRejectNonInstallableJavaLibrary(t *testing.T) {
	`)
}

func TestCarryRequiredModuleNames(t *testing.T) {
	t.Parallel()
	ctx := testApex(t, `
		apex {
			name: "myapex",
			key: "myapex.key",
			native_shared_libs: ["mylib"],
			updatable: false,
		}

		apex_key {
			name: "myapex.key",
			public_key: "testkey.avbpubkey",
			private_key: "testkey.pem",
		}

		cc_library {
			name: "mylib",
			srcs: ["mylib.cpp"],
			system_shared_libs: [],
			stl: "none",
			required: ["a", "b"],
			host_required: ["c", "d"],
			target_required: ["e", "f"],
			apex_available: [ "myapex" ],
		}
	`)

	apexBundle := ctx.ModuleForTests("myapex", "android_common_myapex").Module().(*apexBundle)
	data := android.AndroidMkDataForTest(t, ctx, apexBundle)
	name := apexBundle.BaseModuleName()
	prefix := "TARGET_"
	var builder strings.Builder
	data.Custom(&builder, name, prefix, "", data)
	androidMk := builder.String()
	ensureContains(t, androidMk, "LOCAL_REQUIRED_MODULES := mylib.myapex:64 a b\n")
	ensureContains(t, androidMk, "LOCAL_HOST_REQUIRED_MODULES := c d\n")
	ensureContains(t, androidMk, "LOCAL_TARGET_REQUIRED_MODULES := e f\n")
}

func TestSymlinksFromApexToSystem(t *testing.T) {
	t.Parallel()
	bp := `