From b7cda928116f5c95c08301bb2e20c0b9882ee502 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Fri, 3 Mar 2023 15:38:28 +0000 Subject: [PATCH] Use filegroups for the droidstub txt files This allows moving the droidstubs modules into a subdir of frameworks base. The paths would otherwise fail to resolve when doing so. Bug: 271563074 Test: m Change-Id: I3472b37d8f4739d5018d9bb36b06f03b84f99e9a --- StubLibraries.bp | 22 +++++++++++----------- core/api/Android.bp | 36 +++++++++++++++++++++++++++++++----- 2 files changed, 42 insertions(+), 16 deletions(-) diff --git a/StubLibraries.bp b/StubLibraries.bp index 71531c4c0ccb..5b361044fd66 100644 --- a/StubLibraries.bp +++ b/StubLibraries.bp @@ -36,8 +36,8 @@ droidstubs { args: metalava_framework_docs_args, check_api: { current: { - api_file: "core/api/current.txt", - removed_api_file: "core/api/removed.txt", + api_file: ":non-updatable-current.txt", + removed_api_file: ":non-updatable-removed.txt", }, last_released: { api_file: ":android-non-updatable.api.public.latest", @@ -88,8 +88,8 @@ droidstubs { args: metalava_framework_docs_args + priv_apps, check_api: { current: { - api_file: "core/api/system-current.txt", - removed_api_file: "core/api/system-removed.txt", + api_file: ":non-updatable-system-current.txt", + removed_api_file: ":non-updatable-system-removed.txt", }, last_released: { api_file: ":android-non-updatable.api.system.latest", @@ -99,7 +99,7 @@ droidstubs { api_lint: { enabled: true, new_since: ":android.api.system.latest", - baseline_file: "core/api/system-lint-baseline.txt", + baseline_file: ":non-updatable-system-lint-baseline.txt", }, }, dists: [ @@ -127,12 +127,12 @@ droidstubs { args: metalava_framework_docs_args + test + priv_apps_in_stubs, check_api: { current: { - api_file: "core/api/test-current.txt", - removed_api_file: "core/api/test-removed.txt", + api_file: ":non-updatable-test-current.txt", + removed_api_file: ":non-updatable-test-removed.txt", }, api_lint: { enabled: true, - baseline_file: "core/api/test-lint-baseline.txt", + baseline_file: ":non-updatable-test-lint-baseline.txt", }, }, dists: [ @@ -172,8 +172,8 @@ droidstubs { args: metalava_framework_docs_args + priv_apps_in_stubs + module_libs, check_api: { current: { - api_file: "core/api/module-lib-current.txt", - removed_api_file: "core/api/module-lib-removed.txt", + api_file: ":non-updatable-module-lib-current.txt", + removed_api_file: ":non-updatable-module-lib-removed.txt", }, last_released: { api_file: ":android-non-updatable.api.module-lib.latest", @@ -183,7 +183,7 @@ droidstubs { api_lint: { enabled: true, new_since: ":android.api.module-lib.latest", - baseline_file: "core/api/module-lib-lint-baseline.txt", + baseline_file: ":non-updatable-module-lib-lint-baseline.txt", }, }, dists: [ diff --git a/core/api/Android.bp b/core/api/Android.bp index 02562447dc6b..71a2ca2903f6 100644 --- a/core/api/Android.bp +++ b/core/api/Android.bp @@ -13,7 +13,10 @@ // limitations under the License. package { - default_visibility: ["//visibility:private"], + default_visibility: [ + "//frameworks/base", + "//frameworks/base/api", + ], // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" @@ -27,31 +30,33 @@ package { filegroup { name: "non-updatable-current.txt", srcs: ["current.txt"], - visibility: ["//frameworks/base/api"], } filegroup { name: "non-updatable-removed.txt", srcs: ["removed.txt"], - visibility: ["//frameworks/base/api"], } filegroup { name: "non-updatable-system-current.txt", srcs: ["system-current.txt"], - visibility: ["//frameworks/base/api"], } filegroup { name: "non-updatable-system-removed.txt", srcs: ["system-removed.txt"], - visibility: ["//frameworks/base/api"], +} + +filegroup { + name: "non-updatable-system-lint-baseline.txt", + srcs: ["system-lint-baseline.txt"], } filegroup { name: "non-updatable-module-lib-current.txt", srcs: ["module-lib-current.txt"], visibility: [ + "//frameworks/base", "//frameworks/base/api", "//cts/tests/signature/api", ], @@ -61,11 +66,32 @@ filegroup { name: "non-updatable-module-lib-removed.txt", srcs: ["module-lib-removed.txt"], visibility: [ + "//frameworks/base", "//frameworks/base/api", "//cts/tests/signature/api", ], } +filegroup { + name: "non-updatable-module-lib-lint-baseline.txt", + srcs: ["module-lib-lint-baseline.txt"], +} + +filegroup { + name: "non-updatable-test-current.txt", + srcs: ["test-current.txt"], +} + +filegroup { + name: "non-updatable-test-removed.txt", + srcs: ["test-removed.txt"], +} + +filegroup { + name: "non-updatable-test-lint-baseline.txt", + srcs: ["test-lint-baseline.txt"], +} + java_api_contribution { name: "api-stubs-docs-non-updatable-public-stubs", api_surface: "public",