summaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
author Jihoon Kang <jihoonkang@google.com> 2023-10-05 23:42:51 +0000
committer Jihoon Kang <jihoonkang@google.com> 2023-10-11 16:59:41 +0000
commit4683b14cf5fe2bf25eb8428f10a1b163d238bdf1 (patch)
tree8d676c86012e8332d226ae32b3cef5ad09fd3dd0 /api
parent9a7e0d45103e955edeab791ee55a05100e1dc139 (diff)
Add module lib and test union java_api_library module
Currently, hiddenapi_modular defines test api surface as a subset of module lib api surface, causing hiddenapi check failure in from-text stub build. In order to mitigate this and enable the hiddenapi check in from-text stub build, this change introduces a java_api_library module that generates the stub jar that contains both test and module lib api contributions. The module will not be available for consumption, but will only be used in hiddenapi check. Test: m android_test_module_lib_stubs_current.from-text --build-from-text-stub Bug: 191644675 Change-Id: I2b6c9f75d9ebcfd75fa5b509dbef14aa0f88ac97
Diffstat (limited to 'api')
-rw-r--r--api/StubLibraries.bp44
1 files changed, 44 insertions, 0 deletions
diff --git a/api/StubLibraries.bp b/api/StubLibraries.bp
index 857077d60a5d..79efaced998a 100644
--- a/api/StubLibraries.bp
+++ b/api/StubLibraries.bp
@@ -436,6 +436,26 @@ java_api_library {
full_api_surface_stub: "android_module_lib_stubs_current_full.from-text",
}
+// This module generates a stub jar that is a union of the test and module lib
+// non-updatable api contributions. Modules should not depend on the stub jar
+// generated from this module, as this module is strictly used for hiddenapi only.
+java_api_library {
+ name: "android-non-updatable.stubs.test_module_lib",
+ api_surface: "module_lib",
+ api_contributions: [
+ "api-stubs-docs-non-updatable.api.contribution",
+ "system-api-stubs-docs-non-updatable.api.contribution",
+ "test-api-stubs-docs-non-updatable.api.contribution",
+ "module-lib-api-stubs-docs-non-updatable.api.contribution",
+ ],
+ defaults: ["android-non-updatable_from_text_defaults"],
+ full_api_surface_stub: "android_test_module_lib_stubs_current.from-text",
+
+ // This module is only used for hiddenapi, and other modules should not
+ // depend on this module.
+ visibility: ["//visibility:private"],
+}
+
java_defaults {
name: "android_stubs_dists_default",
dist: {
@@ -739,6 +759,30 @@ java_api_library {
}
java_api_library {
+ name: "android_test_module_lib_stubs_current.from-text",
+ api_surface: "module-lib",
+ defaults: [
+ "android_stubs_current_contributions",
+ "android_system_stubs_current_contributions",
+ "android_test_stubs_current_contributions",
+ "android_module_lib_stubs_current_contributions",
+ ],
+ libs: [
+ "android_module_lib_stubs_current_full.from-text",
+ "stub-annotations",
+ ],
+ api_contributions: [
+ "test-api-stubs-docs-non-updatable.api.contribution",
+ ],
+
+ // This module is only used to build android-non-updatable.stubs.test_module_lib
+ // and other modules should not depend on this module.
+ visibility: [
+ "//visibility:private",
+ ],
+}
+
+java_api_library {
name: "android_system_server_stubs_current.from-text",
api_surface: "system-server",
api_contributions: [