• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2018 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Generates stub source files for the core platform API of the ART module.
16// i.e. every class/member that is either in the public API or annotated with
17// @CorePlatformApi.
18//
19// The API specification .txt files managed by this only contain the additional
20// classes/members that are in the intra-core API but which are not in the public
21// API.
22droidstubs {
23    name: "art-module-platform-api-stubs-source",
24    srcs: [
25        ":art_module_api_files",
26    ],
27    sdk_version: "none",
28    system_modules: "none",
29    libs: [
30        // Needed to break the cycle in the platform api caused by
31        // b/141747409.
32        "i18n.module.intra.core.api.stubs",
33    ],
34
35    installable: false,
36    args: "--hide HiddenSuperclass " +
37        "--hide-annotation libcore.api.Hide " +
38        "--show-single-annotation libcore.api.CorePlatformApi " +
39        "--skip-annotation-instance-methods=false ",
40    merge_inclusion_annotations_dirs: ["ojluni-annotated-mmodule-stubs"],
41
42    api_filename: "api.txt",
43    removed_api_filename: "removed.txt",
44    previous_api: "previous.txt",
45
46    check_api: {
47        current: {
48            api_file: "api/platform/current-api.txt",
49            removed_api_file: "api/platform/current-removed.txt",
50        },
51        last_released: {
52            api_file: "api/platform/last-api.txt",
53            removed_api_file: "api/platform/last-removed.txt",
54        },
55    },
56}
57
58// A special set of system modules that is needed to break the cycle in the
59// platform api caused by b/141747409.
60java_system_modules {
61    name: "break-cycle-in-core-platform-system-modules",
62    libs: [
63        "art.module.intra.core.api.stubs",
64        "i18n.module.intra.core.api.stubs",
65    ],
66}
67
68// A library containing the core platform API stubs of the ART module.
69//
70// Core platform APIs are only intended for use of other parts of the platform, not the
71// core library modules.
72java_library {
73    name: "art.module.platform.api.stubs",
74    srcs: [
75        ":art-module-platform-api-stubs-source",
76    ],
77    hostdex: true,
78
79    sdk_version: "none",
80    system_modules: "break-cycle-in-core-platform-system-modules",
81    patch_module: "java.base",
82}
83
84// Used when compiling higher-level code against core.platform.api.stubs.
85java_system_modules {
86    name: "art-module-platform-api-stubs-system-modules",
87    visibility: [
88        "//art/build/sdk",
89        "//external/conscrypt",
90        "//external/icu/android_icu4j",
91        "//external/wycheproof",
92    ],
93    libs: [
94        "art.module.platform.api.stubs",
95    ],
96}
97
98// Ideally this should be a restricted whitelist but there are hundreds of modules that depend on
99// this.
100// TODO(http://b/134561230) - limit the number of dependents on this.
101core_platform_visibility = ["//visibility:public"]
102
103// A library containing the core platform API stubs for the core libraries.
104//
105// Although this stubs library is primarily used by the Java compiler / build to indicate
106// the core platform API surface area, compile_dex: true is used so that the Core Platform
107// API annotations are available to the dex tools that enable enforcement of runtime
108// accessibility. b/119068555
109java_library {
110    name: "core.platform.api.stubs",
111    visibility: core_platform_visibility,
112    hostdex: true,
113    compile_dex: true,
114
115    sdk_version: "none",
116    system_modules: "none",
117    static_libs: [
118        "art.module.platform.api.stubs",
119        "conscrypt.module.platform.api.stubs",
120        "i18n.module.platform.api.stubs",
121    ],
122    patch_module: "java.base",
123}
124
125// Used when compiling higher-level code against core.platform.api.stubs.
126java_system_modules {
127    name: "core-platform-api-stubs-system-modules",
128    visibility: core_platform_visibility,
129    libs: [
130        "core.platform.api.stubs",
131        // This one is not on device but it's needed when javac compiles code
132        // containing lambdas.
133        "core-lambda-stubs-for-system-modules",
134        // This one is not on device but it's needed when javac compiles code
135        // containing @Generated annotations produced by some code generation
136        // tools.
137        // See http://b/123891440.
138        "core-generated-annotation-stubs",
139    ],
140}
141