From beeb35a8d65c14c592d3ba19114372ae3cd1e50f Mon Sep 17 00:00:00 2001 From: Jihoon Kang Date: Tue, 17 Oct 2023 22:22:24 +0000 Subject: Fix discrepancy between from text vs source android_test_frameworks_core_stubs_current Just like all other android_*_stubs_current modules, android_test_frameworks_core_stubs_current is added to classpath of the javac compilation of its reverse dependencies, and its static libs is dynamically switched between the ".from-source" suffixed from-source stub compiling java_library module and the ".from-text" suffixed from-text stub compiling java_api_library module. Other than the origin of the stubs, the two modules are expected to contain (mostly) identical APIs. However, the two static libs of android_test_frameworks_core_stubs_current currently do not follow this principle as the from-source java_library module does not add the "private-stub-annotation-jar" as static lib, while the from-text java_api_library does. This discrepancy lead to compilation error of the reverse dependencies when defaulting build to from-text stub generation. This change fixes the discrepancy between the two modules by removing "private-stub-annotation-jar" from the static lib of the from-source module and making the two modules behave more similarly. Test: patch on internal main and run `m framework-location.stubs.test.from-source --build-from-text-stub` Bug: 301522358 Change-Id: I821b7bb25a8f7ec7f9977a01ebdfbd5f1b25cf5e --- api/StubLibraries.bp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'api') diff --git a/api/StubLibraries.bp b/api/StubLibraries.bp index a410a58218c4..ada4b1a9cba5 100644 --- a/api/StubLibraries.bp +++ b/api/StubLibraries.bp @@ -721,7 +721,9 @@ java_api_library { "android_stubs_current_contributions", "android_system_stubs_current_contributions", "android_test_frameworks_core_stubs_current_contributions", - "stub-annotation-defaults", + ], + libs: [ + "stub-annotations", ], api_contributions: [ "api-stubs-docs-non-updatable.api.contribution", -- cgit v1.2.3-59-g8ed1b