From d01f0b2c72c1a5160653e47ba68f56105212cc73 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Fri, 24 Jan 2025 18:27:07 +0000 Subject: Allow java_sdk_library to override the droidstubs api_surface per scope Previously, every `java_sdk_library` would create a `droidstubs` module passing in the name of the `apiScope` as the `api_surface` property. e.g. the `public` scope was always called `public`, etc. While that works for the vast majority of `java_sdk_library` modules there are a few in `libcore`, `external/conscrypt` and `external/icu` which create `public` scope APIs but which are not actually `public`. e.g. libcore creates `intra-core` APIs, conscrypt and icu also create `core-platform` APIs. They are different from `public` in the annotations that they pass to Metalava. A future change will pass the `api_surface` property down to Metalava and that will be used to retrieve a corresponding configuration from `build/soong/java/metalava/main-config.xml`. That configuration will include the annotations. Therefore, each set of annotations that are passed will need a unique name. This change allows the `api_surface` for the default `public` scope to be overridden to select the correct `api_surface` in the configuration. Bug: 391554590 Test: m checkapi Change-Id: Iaa2c8325f0ffae2daf77201abe4e77c919528ad3 --- java/sdk_library.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'java/sdk_library.go') diff --git a/java/sdk_library.go b/java/sdk_library.go index 155bea4d7..fda87f8fd 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -480,6 +480,9 @@ type ApiScopeProperties struct { // Extra libs used when compiling stubs for this scope. Libs []string + + // Name to override the api_surface that is passed down to droidstubs. + Api_surface *string } type sdkLibraryProperties struct { -- cgit v1.2.3-59-g8ed1b