From 44f1d8404be0159ea95f74b0645157e74fe1b86e Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Fri, 26 Jun 2020 20:17:02 +0100 Subject: Stop java_sdk_library_import from depending on source modules Previously, java_sdk_library_import added the dependencies on its child components in the deps mutator after prebuilts without a matching source module are renamed to the source module name. That meant that the java_sdk_library_import has to use the source module name and ended up depending on the source module unless it was preferred. This change adds a new component deps mutator that runs before the PrebuiltRenameMutator so that the java_sdk_library_import can add dependencies onto the prebuilt modules. It also updates an affected test. Bug: 159902351 Test: m nothing Change-Id: I3576c4873302743e51aff547ea1497bef6d748ac --- java/java_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'java/java_test.go') diff --git a/java/java_test.go b/java/java_test.go index def42dbb8..23dcd53ab 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -86,6 +86,7 @@ func testContext() *android.TestContext { RegisterStubsBuildComponents(ctx) RegisterSdkLibraryBuildComponents(ctx) ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators) + ctx.PreArchMutators(android.RegisterComponentsMutator) RegisterPrebuiltApisBuildComponents(ctx) @@ -684,11 +685,11 @@ func TestJavaSdkLibraryImport_WithSource(t *testing.T) { }) checkModuleDependencies(t, ctx, "prebuilt_sdklib", "android_common", []string{ + `prebuilt_sdklib.stubs`, `sdklib.impl`, // This should be prebuilt_sdklib.stubs but is set to sdklib.stubs because the // dependency is added after prebuilts may have been renamed and so has to use // the renamed name. - `sdklib.stubs`, `sdklib.xml`, }) } -- cgit v1.2.3-59-g8ed1b