From bfa2f9ec69facd82d88129007e5eefb3e4136aa1 Mon Sep 17 00:00:00 2001 From: Jihoon Kang Date: Wed, 1 Nov 2023 22:49:35 +0000 Subject: [PATCH 1/2] Move core.module_lib.stubs.from-text closer to source This change moves the core.module_lib.stubs.from-text closer to its from-source equivalents and its top level module core/module_lib.stubs. Test: m nothing --build-from-text-stub Bug: 287522618 Change-Id: Ida6dd613834b36490b1ad79773b9404b1d0d9efc --- java/core-libraries/Android.bp | 20 ++++++++++++++++++++ java/core-libraries/TxtStubLibraries.bp | 20 -------------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/java/core-libraries/Android.bp b/java/core-libraries/Android.bp index 8b7387a85..57b0e21d7 100644 --- a/java/core-libraries/Android.bp +++ b/java/core-libraries/Android.bp @@ -207,6 +207,26 @@ java_library { ], } +java_api_library { + name: "core.module_lib.stubs.from-text", + api_surface: "module-lib", + api_contributions: [ + "art.module.public.api.stubs.source.api.contribution", + "art.module.public.api.stubs.source.system.api.contribution", + "art.module.public.api.stubs.source.module_lib.api.contribution", + + // Add the module-lib correspondence when Conscrypt or i18N module + // provides @SystemApi(MODULE_LIBRARIES). Currently, assume that only ART module provides + // @SystemApi(MODULE_LIBRARIES). + "conscrypt.module.public.api.stubs.source.api.contribution", + "i18n.module.public.api.stubs.source.api.contribution", + ], + libs: [ + "stub-annotations", + ], + visibility: ["//visibility:private"], +} + // Produces a dist file that is used by the // prebuilts/sdk/update_prebuilts.py script to update the prebuilts/sdk // directory. diff --git a/java/core-libraries/TxtStubLibraries.bp b/java/core-libraries/TxtStubLibraries.bp index c46f8b8ea..7a026a031 100644 --- a/java/core-libraries/TxtStubLibraries.bp +++ b/java/core-libraries/TxtStubLibraries.bp @@ -57,26 +57,6 @@ java_library { ], } -java_api_library { - name: "core.module_lib.stubs.from-text", - api_surface: "module-lib", - api_contributions: [ - "art.module.public.api.stubs.source.api.contribution", - "art.module.public.api.stubs.source.system.api.contribution", - "art.module.public.api.stubs.source.module_lib.api.contribution", - - // Add the module-lib correspondence when Conscrypt or i18N module - // provides @SystemApi(MODULE_LIBRARIES). Currently, assume that only ART module provides - // @SystemApi(MODULE_LIBRARIES). - "conscrypt.module.public.api.stubs.source.api.contribution", - "i18n.module.public.api.stubs.source.api.contribution", - ], - libs: [ - "stub-annotations", - ], - visibility: ["//visibility:private"], -} - // Same as legacy-core-platform-api-stubs-system-modules, but the stubs are generated from .txt files java_system_modules { name: "legacy-core-platform-api-stubs-system-modules.from-text", From 6416a7121193c16b33a13057e8473dd83aac1b14 Mon Sep 17 00:00:00 2001 From: Jihoon Kang Date: Wed, 1 Nov 2023 22:52:45 +0000 Subject: [PATCH 2/2] Remove TxtStubLibraries.bp The modules defined in TxtStubLibraries.bp are currently not in the critical path of the from-text stub build, because the from-text vs from-source switching is encapsulated within the stub library modules. Therefore, remove the modules altogether. Test: m nothing --build-from-text-stub Bug: 287522618 Change-Id: I249edcdf596c8a82058e1bfb17da863c2b5dd7a7 --- java/core-libraries/Android.bp | 4 - java/core-libraries/TxtStubLibraries.bp | 120 ------------------------ 2 files changed, 124 deletions(-) delete mode 100644 java/core-libraries/TxtStubLibraries.bp diff --git a/java/core-libraries/Android.bp b/java/core-libraries/Android.bp index 57b0e21d7..c6ab5611a 100644 --- a/java/core-libraries/Android.bp +++ b/java/core-libraries/Android.bp @@ -524,7 +524,3 @@ java_system_modules { "art-module-intra-core-api-stubs-system-modules-lib", ], } - -build = [ - "TxtStubLibraries.bp", -] diff --git a/java/core-libraries/TxtStubLibraries.bp b/java/core-libraries/TxtStubLibraries.bp deleted file mode 100644 index 7a026a031..000000000 --- a/java/core-libraries/TxtStubLibraries.bp +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (C) 2023 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file contains java_system_modules provided by the SDK. -// These system modules transitively depend on core stub libraries generated from .txt files. - -// Same as core-public-stubs-system-modules, but the stubs are generated from .txt files -java_system_modules { - name: "core-public-stubs-system-modules.from-text", - visibility: ["//visibility:public"], - libs: [ - "core-current-stubs-for-system-modules-no-annotations.from-text", - ], -} - -java_library { - name: "core-current-stubs-for-system-modules-no-annotations.from-text", - visibility: ["//visibility:private"], - defaults: [ - "system-modules-no-annotations", - ], - static_libs: [ - "core.current.stubs.from-text", - "core-lambda-stubs.from-text", - ], -} - -// Same as core-module-lib-stubs-system-modules, but the stubs are generated from .txt files -java_system_modules { - name: "core-module-lib-stubs-system-modules.from-text", - visibility: ["//visibility:public"], - libs: [ - "core-module-lib-stubs-for-system-modules-no-annotations.from-text", - ], -} - -java_library { - name: "core-module-lib-stubs-for-system-modules-no-annotations.from-text", - visibility: ["//visibility:private"], - defaults: [ - "system-modules-no-annotations", - ], - static_libs: [ - "core.module_lib.stubs.from-text", - "core-lambda-stubs.from-text", - ], -} - -// Same as legacy-core-platform-api-stubs-system-modules, but the stubs are generated from .txt files -java_system_modules { - name: "legacy-core-platform-api-stubs-system-modules.from-text", - visibility: core_platform_visibility, - libs: [ - "legacy.core.platform.api.no.annotations.stubs.from-text", - "core-lambda-stubs.from-text", - ], -} - -java_library { - name: "legacy.core.platform.api.no.annotations.stubs.from-text", - visibility: core_platform_visibility, - defaults: [ - "system-modules-no-annotations", - ], - hostdex: true, - compile_dex: true, - - static_libs: [ - "legacy.core.platform.api.stubs.from-text", - ], - patch_module: "java.base", -} - -// Same as stable-core-platform-api-stubs-system-modules, but the stubs are generated from .txt files -java_system_modules { - name: "stable-core-platform-api-stubs-system-modules.from-text", - visibility: core_platform_visibility, - libs: [ - "stable.core.platform.api.no.annotations.stubs.from-text", - "core-lambda-stubs.from-text", - ], -} - -java_library { - name: "stable.core.platform.api.no.annotations.stubs.from-text", - visibility: core_platform_visibility, - defaults: [ - "system-modules-no-annotations", - ], - hostdex: true, - compile_dex: true, - - static_libs: [ - "stable.core.platform.api.stubs.from-text", - ], - patch_module: "java.base", -} - -java_api_library { - name: "core-lambda-stubs.from-text", - api_surface: "toolchain", - api_contributions: [ - "art.module.toolchain.api.api.contribution", - ], - libs: [ - // LambdaMetaFactory depends on CallSite etc. which is part of the Core API surface - "core.current.stubs.from-text", - ], -}