From 85bc19380567dfee327f04162587633673e3dcf7 Mon Sep 17 00:00:00 2001 From: Jihoon Kang Date: Mon, 1 Jul 2024 17:04:46 +0000 Subject: Revert^4 "Implement detecting container violations." This change introduces a method to detect violating inter-container dependencies between modules. The method is run in `ModuleBase.GenerateBuildActions`, after the container info provider is set. Given that the provider of the direct dependencies would have been set at this time, the method utilizes this information to determine the violations, which are introduced in https://r.android.com/3141104. Note that this enforcement does not turn all inter-container dependencies as errors. Instead, it will only turn dependencies that matches the pre-defined violations into errors. Even if the dependency matches the violation, an error will not be thrown if the dependency satisfies any of the exception functions (e.g. the dependent module is stubs, or the two modules belong to the same apexes). Test: m nothing --no-skip-soong-tests Bug: 338660802 Change-Id: Ib9ddc0761fa46f1309b1a1a4f759d9a4e04fd70e --- java/dexpreopt_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'java/dexpreopt_test.go') diff --git a/java/dexpreopt_test.go b/java/dexpreopt_test.go index 73e33f4fb..07d0595e6 100644 --- a/java/dexpreopt_test.go +++ b/java/dexpreopt_test.go @@ -54,6 +54,7 @@ func TestDexpreoptEnabled(t *testing.T) { name: "foo", installable: true, srcs: ["a.java"], + sdk_version: "current", }`, enabled: true, }, @@ -98,6 +99,7 @@ func TestDexpreoptEnabled(t *testing.T) { java_library { name: "foo", installable: true, + sdk_version: "current", }`, enabled: false, }, @@ -107,6 +109,7 @@ func TestDexpreoptEnabled(t *testing.T) { java_library { name: "foo", srcs: ["a.java"], + sdk_version: "current", }`, enabled: false, }, @@ -144,6 +147,7 @@ func TestDexpreoptEnabled(t *testing.T) { name: "foo", srcs: ["a.java"], compile_dex: true, + sdk_version: "current", }`, enabled: false, }, @@ -164,6 +168,7 @@ func TestDexpreoptEnabled(t *testing.T) { installable: true, srcs: ["a.java"], apex_available: ["com.android.apex1"], + sdk_version: "current", }`, apexVariant: true, enabled: false, @@ -176,6 +181,7 @@ func TestDexpreoptEnabled(t *testing.T) { installable: true, srcs: ["a.java"], apex_available: ["com.android.apex1"], + sdk_version: "current", }`, moduleName: "service-foo", apexVariant: true, @@ -189,6 +195,7 @@ func TestDexpreoptEnabled(t *testing.T) { installable: true, srcs: ["a.java"], apex_available: ["com.android.apex1"], + sdk_version: "current", }`, moduleName: "prebuilt_service-foo", apexVariant: true, @@ -202,6 +209,7 @@ func TestDexpreoptEnabled(t *testing.T) { installable: true, srcs: ["a.java"], apex_available: ["com.android.apex1"], + sdk_version: "current", }`, moduleName: "service-foo", apexVariant: false, @@ -311,6 +319,7 @@ func TestDexpreoptBuiltInstalledForApex(t *testing.T) { installable: true, srcs: ["a.java"], apex_available: ["com.android.apex1"], + sdk_version: "current", }`) ctx := result.TestContext module := ctx.ModuleForTests("service-foo", "android_common_apex1000") @@ -342,6 +351,7 @@ func TestDexpreoptBuiltInstalledForApex(t *testing.T) { name: "foo", installable: true, srcs: ["a.java"], + sdk_version: "current", }`) ctx = result.TestContext module = ctx.ModuleForTests("foo", "android_common") @@ -398,6 +408,7 @@ func TestAndroidMkEntriesForApex(t *testing.T) { installable: true, srcs: ["a.java"], apex_available: ["com.android.apex1"], + sdk_version: "current", }`) ctx := result.TestContext module := ctx.ModuleForTests("service-foo", "android_common_apex1000") @@ -429,6 +440,7 @@ func TestAndroidMkEntriesForApex(t *testing.T) { name: "foo", installable: true, srcs: ["a.java"], + sdk_version: "current", }`) ctx = result.TestContext module = ctx.ModuleForTests("foo", "android_common") @@ -454,6 +466,7 @@ func TestGenerateProfileEvenIfDexpreoptIsDisabled(t *testing.T) { profile: "art-profile", }, srcs: ["a.java"], + sdk_version: "current", }`) ctx := result.TestContext -- cgit v1.2.3-59-g8ed1b