Check for duplicate bundled files from different modules.

A single file generated by different modules is almost never correct;
make it an error.

The check is skipped for some error cases, which will be handled in follow-ups.

Bug: 191770320
Test: m (soong test)
Change-Id: Ib3c6efd16bdf13b59f79be66d4f9dba49100f6cc
This commit is contained in:
Jooyung Han
2022-12-21 10:15:37 +09:00
parent 003cbe3bc5
commit 862c0d68ff
3 changed files with 70 additions and 22 deletions

View File

@@ -6992,6 +6992,42 @@ func TestCompatConfig(t *testing.T) {
})
}
func TestNoDupeApexFiles(t *testing.T) {
android.GroupFixturePreparers(
android.PrepareForTestWithAndroidBuildComponents,
PrepareForTestWithApexBuildComponents,
prepareForTestWithMyapex,
prebuilt_etc.PrepareForTestWithPrebuiltEtc,
).
ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern("is provided by two different files")).
RunTestWithBp(t, `
apex {
name: "myapex",
key: "myapex.key",
prebuilts: ["foo", "bar"],
updatable: false,
}
apex_key {
name: "myapex.key",
public_key: "testkey.avbpubkey",
private_key: "testkey.pem",
}
prebuilt_etc {
name: "foo",
src: "myprebuilt",
filename_from_src: true,
}
prebuilt_etc {
name: "bar",
src: "myprebuilt",
filename_from_src: true,
}
`)
}
func TestRejectNonInstallableJavaLibrary(t *testing.T) {
testApexError(t, `"myjar" is not configured to be compiled into dex`, `
apex {