blob: c24cfbd6543142647323fd2ea83d9d752f2bb098 [file] [log] [blame]
Colin Crossaf0b54c2017-09-27 17:22:32 -07001// Copyright (C) 2007 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//
Neil Fuller77e3f3b2018-10-19 10:22:32 +010016// Definitions for building the Android core library and associated tests.
Colin Crossaf0b54c2017-09-27 17:22:32 -070017//
18
Neil Fuller77e3f3b2018-10-19 10:22:32 +010019// The Android core library provides low-level APIs for use by the rest of the
20// Android software stack. It is made up of various parts, some of which can be
21// found in libcore/ and other parts that can be found in various external/
Paul Duffinfb46f732019-09-25 16:04:21 +010022// directories.
23//
Neil Fullercf756882018-08-28 18:42:22 +010024// libcore has some sub-directories that follow a common structure:
25// e.g. dalvik, dom, harmony-tests, json, jsr166-tests, luni, libart, ojluni,
26// support, xml, xmlpull.
Colin Crossaf0b54c2017-09-27 17:22:32 -070027//
Neil Fullercf756882018-08-28 18:42:22 +010028// The structure of these is generally:
Colin Crossaf0b54c2017-09-27 17:22:32 -070029//
30// src/
31// main/ # To be shipped on every device.
32// java/ # Java source for library code.
Neil Fullercf756882018-08-28 18:42:22 +010033// native/ # C/C++ source for library code.
Colin Crossaf0b54c2017-09-27 17:22:32 -070034// resources/ # Support files.
35// test/ # Built only on demand, for testing.
36// java/ # Java source for tests.
Neil Fullercf756882018-08-28 18:42:22 +010037// native/ # C/C++ source for tests (rare).
Colin Crossaf0b54c2017-09-27 17:22:32 -070038// resources/ # Support files.
39//
Neil Fullercf756882018-08-28 18:42:22 +010040// All subdirectories are optional.
Colin Crossaf0b54c2017-09-27 17:22:32 -070041
42build = [
43 "openjdk_java_files.bp",
44 "non_openjdk_java_files.bp",
45]
46
47// The Java files and their associated resources.
Tobias Thierer79eea262019-08-01 14:05:11 +010048filegroup {
49 name: "core-luni-resources",
50 visibility: [
51 "//libcore:__subpackages__",
52 ],
53 path: "luni/src/main/java/",
54 srcs: [
Tobias Thierer79eea262019-08-01 14:05:11 +010055 "luni/src/main/java/java/util/logging/logging.properties",
56 "luni/src/main/java/java/security/security.properties",
57 ],
58}
59
60filegroup {
61 name: "core-ojluni-resources",
62 visibility: [
63 "//libcore:__subpackages__",
64 ],
65 path: "ojluni/src/main/resources/",
66 srcs: [
67 "ojluni/src/main/resources/**/*",
68 ],
69}
70
71core_resources = [
72 ":core-luni-resources",
73 ":core-ojluni-resources",
Colin Crossaf0b54c2017-09-27 17:22:32 -070074]
75
Neil Fuller866ed4a2018-09-06 12:05:46 +010076// The source files that go into core-oj.
77filegroup {
78 name: "core_oj_java_files",
Paul Duffinc241d6a2019-06-25 15:40:29 +010079 visibility: [
80 "//libcore:__subpackages__",
81 ],
Neil Fuller866ed4a2018-09-06 12:05:46 +010082 srcs: [":openjdk_java_files"],
83}
84
Neil Fullere32e2e12019-02-26 11:48:30 +000085// OpenJDK source is not annotated with @hide so we need this separate
Neil Fuller866ed4a2018-09-06 12:05:46 +010086// filegroup for just the parts that contribute to the API.
87filegroup {
88 name: "core_oj_api_files",
89 srcs: [":openjdk_javadoc_files"],
90}
91
92// The source files that go into core-libart.
93filegroup {
94 name: "core_libart_java_files",
Paul Duffinc241d6a2019-06-25 15:40:29 +010095 visibility: [
96 "//libcore:__subpackages__",
97 ],
Neil Fuller866ed4a2018-09-06 12:05:46 +010098 srcs: [
99 ":non_openjdk_java_files",
Neil Fuller866ed4a2018-09-06 12:05:46 +0100100 ],
101}
102
Neil Fullere32e2e12019-02-26 11:48:30 +0000103// Some parts of libart are not annotated with @hide so we need this separate
Neil Fuller866ed4a2018-09-06 12:05:46 +0100104// filegroup for just the parts that contribute to the API.
105filegroup {
106 name: "core_libart_api_files",
107 srcs: [
108 ":non_openjdk_javadoc_files",
Neil Fuller866ed4a2018-09-06 12:05:46 +0100109 ],
110}
111
Neil Fullere32e2e12019-02-26 11:48:30 +0000112// The set of files for the core library that have been marked up with @hide
113// for the public SDK APIs. Used from frameworks/base/ to indicate the source
114// files for inclusion in the public SDK docs.
Paul Duffine59d0aa2019-10-04 09:52:59 +0100115//
116// Deprecated: Will be replaced by core-current-stubs-source.
Neil Fullere32e2e12019-02-26 11:48:30 +0000117filegroup {
118 name: "core_public_api_files",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100119 visibility: [
120 "//frameworks/base",
121 ],
Neil Fullere32e2e12019-02-26 11:48:30 +0000122 srcs: [
Victor Chang3719d062019-10-28 19:05:37 +0000123 ":android_icu4j_public_api_files",
Neil Fullere32e2e12019-02-26 11:48:30 +0000124 ],
125}
126
Paul Duffine59d0aa2019-10-04 09:52:59 +0100127// Contains the stubs source for the part of the Android SDK public API which
128// is provided by the core libraries.
129//
130// Currently is only a placeholder that creates an empty srcjar due to issues
131// caused by http://b/142113901.
132//
133// TODO(http://b/142113521) - Add stubs source for the core library modules.
134genrule {
135 name: "core-current-stubs-source",
136 visibility: [
137 "//frameworks/base",
138 ],
139 tools: [
140 "merge_zips",
141 ],
Paul Duffinbd7f9102019-10-04 09:52:59 +0100142 srcs: [
Paul Duffinfe5f63c2019-10-11 09:53:11 +0100143 ":art-module-public-api-stubs-source",
Paul Duffinbd7f9102019-10-04 09:52:59 +0100144 ":conscrypt-module-public-api-stubs-source",
145 ],
Paul Duffine59d0aa2019-10-04 09:52:59 +0100146 out: ["core-current-stubs-source.srcjar"],
Paul Duffinbd7f9102019-10-04 09:52:59 +0100147 cmd: "$(location merge_zips) $(out)" +
Paul Duffinfe5f63c2019-10-11 09:53:11 +0100148 " $(location :art-module-public-api-stubs-source)" +
Paul Duffinbd7f9102019-10-04 09:52:59 +0100149 " $(location :conscrypt-module-public-api-stubs-source)",
Paul Duffine59d0aa2019-10-04 09:52:59 +0100150}
151
Paul Duffina38da2d2019-10-01 17:49:50 +0100152// The set of files for the ART module that contribute to one or more API
153// surfaces. This includes files that are in the public API as well as those
154// that are not but which have been marked up with @hide plus one or more of
155// the API defining annotations.
156//
157// Some source files in :core_oj_api_files and :openjdk_mmodule_extra_files are
158// annotated by applying annotations to the .annotated.java stubs files in
159// ojluni/annotated/mmodules and rather than in the original source. See the comments
160// in openjdk_java_files.bp for more details.
161filegroup {
162 name: "art_module_api_files",
163 visibility: [
164 "//libcore:__subpackages__",
165 ],
166 srcs: [
Neil Fullerd129bc92018-09-26 11:12:58 +0100167 ":apache-xml_api_files",
Neil Fullera77f7102018-09-21 19:04:41 +0100168 ":bouncycastle_java_files",
Neil Fuller866ed4a2018-09-06 12:05:46 +0100169 ":core_oj_api_files",
170 ":core_libart_api_files",
Neil Fuller641d5f92018-09-24 15:40:39 +0100171 ":okhttp_api_files",
Pete Gillinc9935b62018-09-25 14:42:40 +0100172 ":openjdk_mmodule_extra_files",
Neil Fuller866ed4a2018-09-06 12:05:46 +0100173 ],
174}
175
Colin Crossaf0b54c2017-09-27 17:22:32 -0700176java_defaults {
177 name: "libcore_java_defaults",
178 javacflags: [
179 //"-Xlint:all",
180 //"-Xlint:-serial,-deprecation,-unchecked",
181 ],
182 dxflags: ["--core-library"],
Andreas Gampe66b31732018-02-20 09:22:16 -0800183 errorprone: {
184 javacflags: [
Paul Duffinc31f6bb2019-05-15 12:32:44 +0100185 "-Xep:MissingOverride:OFF", // Ignore missing @Override.
186 "-Xep:ConstantOverflow:WARN", // Known constant overflow in SplittableRandom
Andreas Gampe66b31732018-02-20 09:22:16 -0800187 ],
188 },
Colin Crossaf0b54c2017-09-27 17:22:32 -0700189}
190
191//
192// Build for the target (device).
193//
194
Tobias Thierer52331642019-05-29 12:11:39 +0000195// A target used to bootstrap compilation for the core library.
Paul Duffina8173c52019-09-24 13:04:42 +0100196//
Tobias Thierer52331642019-05-29 12:11:39 +0000197// See core-all-system-modules for more details.
198java_library {
199 name: "core-all",
Tobias Thierer52331642019-05-29 12:11:39 +0000200 defaults: ["libcore_java_defaults"],
Colin Crossaf0b54c2017-09-27 17:22:32 -0700201
202 srcs: [
Paul Duffinf975b712019-10-02 12:37:38 +0100203 // Use the source code for the I18N module intra core API as using the
204 // compiled version does not work due to limitations in either soong or the javac
205 // toolchain. See http://b/142056316 for more details.
206 ":i18n-module-intra-core-api-stubs-source",
Neil Fuller866ed4a2018-09-06 12:05:46 +0100207 ":core_oj_java_files",
208 ":core_libart_java_files",
Colin Crossaf0b54c2017-09-27 17:22:32 -0700209 ":openjdk_lambda_stub_files",
Pete Gillin54035812019-05-08 15:09:39 +0100210 ":openjdk_generated_annotation_stub_files",
Colin Crossaf0b54c2017-09-27 17:22:32 -0700211 ],
Colin Crossec80f4f2018-08-15 21:17:11 -0700212
Paul Duffin83c25382019-06-07 14:10:49 +0100213 sdk_version: "none",
Colin Crossec80f4f2018-08-15 21:17:11 -0700214 system_modules: "none",
Paul Duffin1d7d4a72019-10-10 18:15:01 +0100215 patch_module: "java.base",
Colin Crossa4d9fc42017-09-29 18:04:37 -0700216 openjdk9: {
217 srcs: ["luni/src/module/java/module-info.java"],
Colin Crossa4d9fc42017-09-29 18:04:37 -0700218 },
Colin Crossec80f4f2018-08-15 21:17:11 -0700219
Tobias Thierer79eea262019-08-01 14:05:11 +0100220 java_resources: core_resources,
Tobias Thiererde991232018-03-07 15:10:46 +0000221 java_version: "1.9",
Colin Crossaf0b54c2017-09-27 17:22:32 -0700222
Colin Crossaf0b54c2017-09-27 17:22:32 -0700223 installable: false,
atrost98ec08d2019-08-05 12:23:41 +0100224
225 plugins: ["compat-changeid-annotation-processor"],
226}
227
228platform_compat_config {
229 name: "libcore-platform-compat-config",
atrost98ec08d2019-08-05 12:23:41 +0100230 src: ":core-all",
Colin Crossaf0b54c2017-09-27 17:22:32 -0700231}
232
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100233// A system modules definition for use by core library targets only. It only
234// contains the core-all jar, which contains the classes that end up in core-oj,
235// core-libart as well as the lambda stubs needed to compile Java lambda code.
236// It does not contain other parts of core library like conscrypt, bouncycastle,
237// etc. This system_modules definition is used to bootstrap compilation for
Paul Duffin00b174e2019-09-26 16:22:17 +0100238// other parts of the core library like core-oj, core-libart, conscrypt,
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100239// bouncycastle, etc.
Colin Crossa4d9fc42017-09-29 18:04:37 -0700240java_system_modules {
241 name: "core-all-system-modules",
Paul Duffina8173c52019-09-24 13:04:42 +0100242
243 // Visibility is deliberately restricted to a small set of build modules that
244 // the core library team control.
245 visibility: [
246 "//external/apache-harmony:__subpackages__",
247 "//external/apache-xml",
Paul Duffina8173c52019-09-24 13:04:42 +0100248 "//external/okhttp",
249 "//libcore:__subpackages__",
250 ],
251
Colin Crossa4d9fc42017-09-29 18:04:37 -0700252 libs: ["core-all"],
253}
254
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100255// Contains the parts of core library associated with OpenJDK.
Colin Crossaf0b54c2017-09-27 17:22:32 -0700256java_library {
257 name: "core-oj",
Paul Duffin48ac7b62019-03-28 14:28:06 +0000258 visibility: [
259 "//art/build/apex",
260 "//external/wycheproof",
Paul Duffin94f70232019-05-22 16:22:29 +0100261 "//libcore/benchmarks",
Paul Duffin48ac7b62019-03-28 14:28:06 +0000262 ],
Colin Crossaf0b54c2017-09-27 17:22:32 -0700263 defaults: ["libcore_java_defaults"],
Colin Cross5b75cdd2018-06-27 11:00:13 -0700264 installable: true,
Colin Crossbb180be2017-10-09 14:54:53 -0700265 hostdex: true,
Colin Crossaf0b54c2017-09-27 17:22:32 -0700266
Neil Fuller866ed4a2018-09-06 12:05:46 +0100267 srcs: [":core_oj_java_files"],
Tobias Thierer79eea262019-08-01 14:05:11 +0100268 java_resources: core_resources,
Colin Crossec80f4f2018-08-15 21:17:11 -0700269
Paul Duffin83c25382019-06-07 14:10:49 +0100270 sdk_version: "none",
Colin Crossa4d9fc42017-09-29 18:04:37 -0700271 system_modules: "core-all-system-modules",
Paul Duffin1d7d4a72019-10-10 18:15:01 +0100272 patch_module: "java.base",
Colin Crossec80f4f2018-08-15 21:17:11 -0700273
Pete Gillin7a7a6d22017-12-19 14:56:03 +0000274 jacoco: {
Pete Gillin27ca0582018-01-10 17:04:17 +0000275 exclude_filter: [
Pete Gillin3f59bad2018-01-30 11:20:29 +0000276 "java.lang.Class",
277 "java.lang.Long",
278 "java.lang.Number",
279 "java.lang.Object",
280 "java.lang.String",
281 "java.lang.invoke.MethodHandle",
282 "java.lang.ref.Reference",
283 "java.lang.reflect.Proxy",
Pete Gillinb1868ada2018-01-17 11:03:10 +0000284 "java.util.AbstractMap",
Pete Gillin3f59bad2018-01-30 11:20:29 +0000285 "java.util.HashMap",
286 "java.util.HashMap$Node",
Pete Gillinb1868ada2018-01-17 11:03:10 +0000287 "java.util.Map",
Pete Gillin7a7a6d22017-12-19 14:56:03 +0000288 ],
289 },
Colin Crossaf0b54c2017-09-27 17:22:32 -0700290
291 notice: "ojluni/NOTICE",
292
Colin Crossaf0b54c2017-09-27 17:22:32 -0700293}
294
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100295// Contains parts of core library not associated with OpenJDK. Contains not
Victor Changcad47af2019-08-06 16:33:38 +0100296// just java.*, javax.* code but also android.system.* and various internal
297// libcore.* packages.
Colin Crossaf0b54c2017-09-27 17:22:32 -0700298java_library {
299 name: "core-libart",
Paul Duffin48ac7b62019-03-28 14:28:06 +0000300 visibility: [
301 "//art/build/apex",
302 "//external/robolectric-shadows",
303 "//external/wycheproof",
Paul Duffin94f70232019-05-22 16:22:29 +0100304 "//libcore/benchmarks",
Colin Crossf0ef6252019-05-31 08:26:47 -0700305 "//frameworks/layoutlib",
Paul Duffin48ac7b62019-03-28 14:28:06 +0000306 ],
Colin Crossaf0b54c2017-09-27 17:22:32 -0700307 defaults: ["libcore_java_defaults"],
Colin Cross5b75cdd2018-06-27 11:00:13 -0700308 installable: true,
Colin Crossbb180be2017-10-09 14:54:53 -0700309 hostdex: true,
Colin Crossaf0b54c2017-09-27 17:22:32 -0700310
Neil Fuller866ed4a2018-09-06 12:05:46 +0100311 srcs: [":core_libart_java_files"],
Tobias Thiererde991232018-03-07 15:10:46 +0000312 java_version: "1.9",
Colin Crossaf0b54c2017-09-27 17:22:32 -0700313
Paul Duffin83c25382019-06-07 14:10:49 +0100314 sdk_version: "none",
Colin Crossa4d9fc42017-09-29 18:04:37 -0700315 system_modules: "core-all-system-modules",
Paul Duffin1d7d4a72019-10-10 18:15:01 +0100316 patch_module: "java.base",
Colin Crossec80f4f2018-08-15 21:17:11 -0700317
Pete Gillin80ebe872018-02-13 15:21:20 +0000318 jacoco: {
319 exclude_filter: [
320 "java.lang.DexCache",
321 "dalvik.system.ClassExt",
322 ],
323 },
Colin Crossaf0b54c2017-09-27 17:22:32 -0700324
Andreas Gampe9a1ba892019-04-24 12:35:40 -0700325 target: {
326 hostdex: {
327 required: [
Neil Fuller53c5f032019-06-05 13:47:39 +0100328 // Files used to simulate the /system, runtime APEX and tzdata
329 // APEX dir structure on host.
330 "icu_tzdata.dat_host_tzdata_apex",
Andreas Gampe9a1ba892019-04-24 12:35:40 -0700331 "tzdata_host",
Neil Fuller53c5f032019-06-05 13:47:39 +0100332 "tzdata_host_tzdata_apex",
Neil Fuller53c5f032019-06-05 13:47:39 +0100333 "tzlookup.xml_host_tzdata_apex",
Andreas Gampe9a1ba892019-04-24 12:35:40 -0700334 "tz_version_host",
Neil Fuller53c5f032019-06-05 13:47:39 +0100335 "tz_version_host_tzdata_apex",
Andreas Gampe9a1ba892019-04-24 12:35:40 -0700336 ],
337 },
338 },
Colin Crossaf0b54c2017-09-27 17:22:32 -0700339}
340
Paul Duffin7bb8d232018-10-23 11:48:38 +0100341// Provided solely to contribute information about which hidden parts of the
342// core-oj API are used by apps.
Paul Duffinc6bf27b2019-05-15 14:41:00 +0100343//
344// The build system determines that this library provides hiddenapi information
345// for the core-oj bootjar because its name is of the form <x>-hiddenapi, where
346// <x> is the name of a boot jar. That triggers the generation of a flags.csv
347// file which encapsulates information extracted from the UnsupportedAppUsage
348// annotations in the dex. The information from that file is then encoded into
349// the core-oj file.
350//
351// Usually, e.g. for core-libart, the UnsupportedAppUsage annotations are
352// added to the source that is compiled directly into the bootjar and the build
353// system extracts the information about UnsupportedAppUsage directly from
354// there.
355//
356// This approach of having separate annotated source and a separate build
357// target was taken for ojluni to avoid having to maintain local patches in the
358// ojluni source for UnsupportedAppUsage annotations as that would make it more
359// difficult to pull down changes from upstream.
360//
Paul Duffin7bb8d232018-10-23 11:48:38 +0100361java_library {
362 name: "core-oj-hiddenapi",
Paul Duffin48ac7b62019-03-28 14:28:06 +0000363 // Do not allow this to be accessed from outside this directory.
364 visibility: ["//visibility:private"],
Paul Duffin7bb8d232018-10-23 11:48:38 +0100365 defaults: ["libcore_java_defaults"],
366 compile_dex: true,
367
368 srcs: [":openjdk_hiddenapi_javadoc_files"],
369
Paul Duffin83c25382019-06-07 14:10:49 +0100370 sdk_version: "none",
Paul Duffin7bb8d232018-10-23 11:48:38 +0100371 system_modules: "core-all-system-modules",
Paul Duffin1d7d4a72019-10-10 18:15:01 +0100372 patch_module: "java.base",
Paul Duffin7bb8d232018-10-23 11:48:38 +0100373}
374
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100375//
Paul Duffin00b174e2019-09-26 16:22:17 +0100376// Guaranteed unstripped versions of core-oj and core-libart.
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100377//
Colin Cross3c6c2e22017-10-18 13:24:52 -0700378// The build system may or may not strip the core-oj and core-libart jars,
379// but these will not be stripped. See b/24535627.
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100380//
381
Colin Cross3c6c2e22017-10-18 13:24:52 -0700382java_library {
383 name: "core-oj-testdex",
Colin Cross5b75cdd2018-06-27 11:00:13 -0700384 installable: true,
Colin Cross3c6c2e22017-10-18 13:24:52 -0700385 static_libs: ["core-oj"],
Paul Duffin83c25382019-06-07 14:10:49 +0100386 sdk_version: "none",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700387 system_modules: "core-all-system-modules",
388 dxflags: ["--core-library"],
Colin Cross485ed362017-12-05 17:24:22 -0800389 dex_preopt: {
390 enabled: false,
391 },
Tobias Thiererde991232018-03-07 15:10:46 +0000392 java_version: "1.9",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700393 notice: "ojluni/NOTICE",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700394}
395
396java_library {
397 name: "core-libart-testdex",
Colin Cross5b75cdd2018-06-27 11:00:13 -0700398 installable: true,
Colin Cross3c6c2e22017-10-18 13:24:52 -0700399 static_libs: ["core-libart"],
Paul Duffin83c25382019-06-07 14:10:49 +0100400 sdk_version: "none",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700401 system_modules: "core-all-system-modules",
402 dxflags: ["--core-library"],
Colin Cross485ed362017-12-05 17:24:22 -0800403 dex_preopt: {
404 enabled: false,
405 },
Colin Cross3c6c2e22017-10-18 13:24:52 -0700406 notice: "ojluni/NOTICE",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700407}
408
Tobias Thierere0f8b312018-10-23 23:12:30 +0100409java_defaults {
410 name: "core_lambda_stubs_defaults",
Colin Crossaf0b54c2017-09-27 17:22:32 -0700411 defaults: ["libcore_java_defaults"],
Neil Fuller4207c7f2018-10-10 14:01:40 +0100412 hostdex: true,
Colin Crossaf0b54c2017-09-27 17:22:32 -0700413
Paul Duffin83c25382019-06-07 14:10:49 +0100414 sdk_version: "none",
Colin Crossa4d9fc42017-09-29 18:04:37 -0700415 system_modules: "core-all-system-modules",
Paul Duffin1d7d4a72019-10-10 18:15:01 +0100416 patch_module: "java.base",
Colin Crossaf0b54c2017-09-27 17:22:32 -0700417
418 notice: "ojluni/NOTICE",
419
420 installable: false,
421 include_srcs: true,
422}
Colin Crossa4d9fc42017-09-29 18:04:37 -0700423
Tobias Thierere0f8b312018-10-23 23:12:30 +0100424// Creates a jar that exists to satisfy javac when compiling source code that
425// contains lambdas. This contains all classes / methods required by javac
426// when generating invoke-dynamic lambda implementation code, even those that
427// are also in the public SDK API from API level 26 onwards.
428java_library {
429 name: "core-lambda-stubs",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100430 visibility: ["//visibility:public"],
Tobias Thierere0f8b312018-10-23 23:12:30 +0100431 defaults: ["core_lambda_stubs_defaults"],
432 srcs: [
433 ":openjdk_lambda_stub_files",
434 ":openjdk_lambda_duplicate_stub_files",
435 ],
436}
437
438// An alternative to core-lambda-stubs that omits openjdk_lambda_duplicate_stub_files
439// because those classes are also part of the core library public SDK API
440// (since API level 26).
441java_library {
442 name: "core-lambda-stubs-for-system-modules",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100443 visibility: [
444 "//libcore/mmodules/core_platform_api",
445 ],
Tobias Thierere0f8b312018-10-23 23:12:30 +0100446 defaults: ["core_lambda_stubs_defaults"],
447 srcs: [
448 ":openjdk_lambda_stub_files",
449 ],
450}
451
Pete Gillin54035812019-05-08 15:09:39 +0100452// Creates a jar that exists to satisfy javac when compiling source code that
453// contains @Generated annotations, which are produced by some code generation
454// tools (notably dagger) but aren't part of the Android API.
455// See http://b/123891440.
456java_library {
457 name: "core-generated-annotation-stubs",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100458 visibility: [
459 "//libcore/mmodules/core_platform_api",
460 ],
Pete Gillin54035812019-05-08 15:09:39 +0100461 defaults: ["libcore_java_defaults"],
462 srcs: [
463 ":openjdk_generated_annotation_stub_files",
464 ],
465 hostdex: true,
Paul Duffin83c25382019-06-07 14:10:49 +0100466 sdk_version: "none",
Pete Gillin54035812019-05-08 15:09:39 +0100467 system_modules: "core-all-system-modules",
Paul Duffin1d7d4a72019-10-10 18:15:01 +0100468 patch_module: "java.base",
Pete Gillin54035812019-05-08 15:09:39 +0100469 notice: "ojluni/NOTICE",
470 installable: false,
471 include_srcs: true,
472}
473
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100474// Builds libcore test rules
Colin Cross3c6c2e22017-10-18 13:24:52 -0700475java_library_static {
476 name: "core-test-rules",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100477 visibility: [
Paul Duffin01f6c022019-09-24 14:44:15 +0100478 "//external/conscrypt",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100479 "//frameworks/base/location/tests/locationtests",
480 ],
Colin Cross3c6c2e22017-10-18 13:24:52 -0700481 hostdex: true,
Colin Cross3c6c2e22017-10-18 13:24:52 -0700482 srcs: [
483 "dalvik/test-rules/src/main/**/*.java",
484 "test-rules/src/main/**/*.java",
485 ],
486 static_libs: ["junit"],
Neil Fuller4207c7f2018-10-10 14:01:40 +0100487
Paul Duffin83c25382019-06-07 14:10:49 +0100488 sdk_version: "none",
Neil Fuller4207c7f2018-10-10 14:01:40 +0100489 system_modules: "core-all-system-modules",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700490}
491
Andrei Oneae4392252019-09-03 11:54:14 +0100492// Builds platform_compat test rules
493java_library_static {
494 name: "platform_compat-test-rules",
495 visibility: ["//visibility:public"],
496 srcs: [
497 "luni/src/main/java/android/compat/**/*.java",
498 "test-rules/src/platform_compat/**/*.java",
499 "luni/src/main/java/libcore/api/CorePlatformApi.java",
500 "luni/src/main/java/libcore/api/IntraCoreApi.java",
501
502 ],
503 static_libs: [
504 "junit",
505 "guava",
506 "android-support-test",
507 ],
508 platform_apis: true,
Pete Gillin7fb42bb2019-10-14 11:36:45 +0100509 // This builds classes that are in the java.base Java module:
510 patch_module: "java.base",
Andrei Oneae4392252019-09-03 11:54:14 +0100511}
512
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100513// Builds the core-tests-support library used by various tests.
Colin Cross3c6c2e22017-10-18 13:24:52 -0700514java_library_static {
515 name: "core-tests-support",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100516 visibility: [
517 "//cts/apps/CtsVerifier",
518 "//cts/tests/tests/keystore",
519 "//cts/tests/tests/net",
520 "//cts/tests/tests/net/api23Test",
521 "//external/apache-harmony",
522 "//frameworks/base/core/tests/coretests",
523 "//libcore/benchmarks",
524 "//packages/apps/KeyChain/tests",
525 "//system/timezone/distro/core",
526 ],
Colin Cross3c6c2e22017-10-18 13:24:52 -0700527 hostdex: true,
Colin Cross3c6c2e22017-10-18 13:24:52 -0700528 srcs: ["support/src/test/java/**/*.java"],
Neil Fuller4207c7f2018-10-10 14:01:40 +0100529
Paul Duffin53c491f2019-06-12 13:48:14 +0100530 sdk_version: "core_platform",
Neil Fuller4380ab22018-10-18 19:38:53 +0100531 libs: ["junit"],
Colin Cross3c6c2e22017-10-18 13:24:52 -0700532 static_libs: [
Neil Fullerde8b0862018-10-12 21:53:31 +0100533 "bouncycastle-unbundled",
534 "bouncycastle-bcpkix-unbundled",
535 "bouncycastle-ocsp-unbundled",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700536 ],
537}
538
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100539// Builds the jsr166-tests library.
Colin Crossec80f4f2018-08-15 21:17:11 -0700540java_test {
Colin Cross3c6c2e22017-10-18 13:24:52 -0700541 name: "jsr166-tests",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100542 visibility: [
543 "//cts/tests/libcore/jsr166",
544 ],
Colin Cross3c6c2e22017-10-18 13:24:52 -0700545 srcs: ["jsr166-tests/src/test/java/**/*.java"],
Paul Duffin83c25382019-06-07 14:10:49 +0100546 sdk_version: "none",
Paul Duffin0e0f8c42019-09-20 14:49:55 +0100547 system_modules: "core-all-system-modules",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700548 libs: [
549 "junit",
550 ],
551}
Nan Zhang65f27a32018-01-05 10:41:46 -0800552
Pete Gillinec902b82019-06-26 17:23:00 +0100553// A filegroup that provides access to a source file for a toolchain test that
554// checks Java 9 language features are handled properly by JarJar.
555filegroup {
556 name: "core-java-9-language-features-source",
557 srcs: ["luni/src/main/java/libcore/internal/Java9LanguageFeatures.java"],
558 visibility: ["//libcore/luni/src/test/java9language"],
559}
560
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100561// Builds the core-tests library.
Colin Crossec80f4f2018-08-15 21:17:11 -0700562java_test {
563 name: "core-tests",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100564 visibility: [
565 "//cts/tests/libcore/luni",
566 ],
Colin Crossec80f4f2018-08-15 21:17:11 -0700567 defaults: ["libcore_java_defaults"],
568 hostdex: true,
569 srcs: [
570 "dalvik/src/test/java/**/*.java",
571 "dalvik/test-rules/src/test/java/**/*.java",
572 "dom/src/test/java/**/*.java",
573 "harmony-tests/src/test/java/**/*.java",
574 "json/src/test/java/**/*.java",
575 "luni/src/test/java/**/*.java",
Paul Duffin4ba14532019-03-21 10:32:41 +0000576 "test-rules/src/test/java/**/*.java",
Colin Crossec80f4f2018-08-15 21:17:11 -0700577 "xml/src/test/java/**/*.java",
578 ],
579 exclude_srcs: [
580 "luni/src/test/java/libcore/java/util/zip/Zip64Test.java",
581 "luni/src/test/java/libcore/java/util/zip/Zip64FileTest.java",
582 ],
583
584 java_resource_dirs: [
585 "*/src/test/java",
586 "*/src/test/resources",
587 ],
588 exclude_java_resource_dirs: [
589 "ojluni/src/test/java",
590 "ojluni/src/test/resources",
591 ],
592
593 java_resources: [
Paul Duffin16a057f2019-05-13 12:20:55 +0100594 ":annotations-test",
Colin Crossec80f4f2018-08-15 21:17:11 -0700595 ":filesystemstest",
596 ":parameter-metadata-test",
597 ],
598
Paul Duffin83c25382019-06-07 14:10:49 +0100599 sdk_version: "none",
Paul Duffin0e0f8c42019-09-20 14:49:55 +0100600 system_modules: "core-all-system-modules",
Neil Fuller4207c7f2018-10-10 14:01:40 +0100601 libs: [
Neil Fuller4207c7f2018-10-10 14:01:40 +0100602 "okhttp",
603 "bouncycastle",
604 ],
Neil Fuller4207c7f2018-10-10 14:01:40 +0100605
Colin Crossec80f4f2018-08-15 21:17:11 -0700606 static_libs: [
607 "archive-patcher",
Pete Gillin05a43202019-06-27 14:41:21 +0100608 "core-java-9-language-tests",
Colin Crossec80f4f2018-08-15 21:17:11 -0700609 "core-test-rules",
610 "core-tests-support",
611 "junit-params",
612 "mockftpserver",
613 "mockito-target",
614 "mockwebserver",
615 "nist-pkix-tests",
616 "slf4j-jdk14",
617 "sqlite-jdbc",
618 "tzdata-testing",
Paul Duffina4df2372018-12-10 15:48:01 +0000619 "truth-prebuilt",
Colin Crossec80f4f2018-08-15 21:17:11 -0700620 ],
621
622 errorprone: {
623 javacflags: [
624 "-Xep:TryFailThrowable:ERROR",
625 "-Xep:ComparisonOutOfRange:ERROR",
626 ],
627 },
Simran Basi3be01e02018-08-21 17:53:49 -0700628
629 test_config: "AndroidTest-core-tests.xml",
Colin Crossec80f4f2018-08-15 21:17:11 -0700630}
631
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100632// Builds the core-ojtests library that contains test code from OpenJDK.
Colin Crossec80f4f2018-08-15 21:17:11 -0700633java_test {
634 name: "core-ojtests",
635 defaults: ["libcore_java_defaults"],
636 hostdex: true,
637
638 srcs: [
639 "ojluni/src/test/java/**/*.java",
640 ],
641 java_resource_dirs: [
642 "ojluni/src/test/java",
643 "ojluni/src/test/resources",
644 ],
Neil Fullerb669ccb2018-10-04 23:10:27 +0100645
Paul Duffin83c25382019-06-07 14:10:49 +0100646 sdk_version: "none",
Paul Duffin0e0f8c42019-09-20 14:49:55 +0100647 system_modules: "core-all-system-modules",
Neil Fuller4207c7f2018-10-10 14:01:40 +0100648 libs: [
Neil Fuller4207c7f2018-10-10 14:01:40 +0100649 "okhttp",
650 "bouncycastle",
651 ],
Neil Fuller4207c7f2018-10-10 14:01:40 +0100652
Colin Crossec80f4f2018-08-15 21:17:11 -0700653 static_libs: ["testng"],
654
655 // ojluni/src/test/java/util/stream/{bootlib,boottest}
656 // contains tests that are in packages from java.base;
657 // By default, OpenJDK 9's javac will only compile such
658 // code if it's declared to also be in java.base at
659 // compile time.
660 //
Paul Duffin1d7d4a72019-10-10 18:15:01 +0100661 // For now, we use patch_module to put all sources
Colin Crossec80f4f2018-08-15 21:17:11 -0700662 // and dependencies from this make target into java.base;
663 // other source directories in this make target are in
664 // packages not from java.base; if this becomes a problem
665 // in future, this could be addressed eg. by splitting
666 // boot{lib,test} out into a separate make target,
667 // deleting those tests or moving them to a different
668 // package.
669 patch_module: "java.base",
670}
671
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100672// Builds the core-ojtests-public library. Excludes any private API tests.
673// Like core-ojtests but smaller.
Colin Crossec80f4f2018-08-15 21:17:11 -0700674java_test {
675 name: "core-ojtests-public",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100676 visibility: [
677 "//cts/tests/libcore/ojluni",
678 ],
Colin Crossec80f4f2018-08-15 21:17:11 -0700679 defaults: ["libcore_java_defaults"],
680 srcs: [
681 "ojluni/src/test/java/**/*.java",
682 ],
683 // Filter out the following:
684 // 1.) DeserializeMethodTest and SerializedLambdaTest, because they depends on stub classes
685 // and won't actually run, and
686 // 2.) util/stream/boot*. Those directories contain classes in the package java.util.stream;
687 // excluding them means we don't need patch_module: "java.base"
688 exclude_srcs: [
689 "**/DeserializeMethodTest.java",
690 "**/SerializedLambdaTest.java",
691 "ojluni/src/test/java/util/stream/boot*/**/*",
692 ],
693 java_resource_dirs: [
694 "ojluni/src/test/java",
695 "ojluni/src/test/resources",
696 // Include source code as part of JAR
697 "ojluni/src/test/dist",
698 ],
Neil Fuller4207c7f2018-10-10 14:01:40 +0100699
Paul Duffin83c25382019-06-07 14:10:49 +0100700 sdk_version: "none",
Paul Duffin0e0f8c42019-09-20 14:49:55 +0100701 system_modules: "core-all-system-modules",
Neil Fuller4207c7f2018-10-10 14:01:40 +0100702 libs: [
Neil Fuller4207c7f2018-10-10 14:01:40 +0100703 "bouncycastle",
704 "okhttp",
705 "testng",
706 ],
Colin Crossec80f4f2018-08-15 21:17:11 -0700707}
708
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100709// Exports annotated stubs source files in ojluni/annotations/sdk to make them
710// available to metalava. Used for nullability annotations in OpenJDK source.
Pete Gillin7db7faa2018-07-31 13:29:35 +0100711droiddoc_exported_dir {
Pete Gillin0728b742018-09-17 15:41:45 +0100712 name: "ojluni-annotated-sdk-stubs",
713 path: "ojluni/annotations/sdk",
Pete Gillin7db7faa2018-07-31 13:29:35 +0100714}
Paul Duffin48ac7b62019-03-28 14:28:06 +0000715
Pete Gillin600c7cf2018-08-16 19:28:38 +0100716droiddoc_exported_dir {
717 name: "ojluni-annotated-nullability-stubs",
718 path: "ojluni/annotations/sdk/nullability",
719}
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100720
721// Exports annotated stubs source files in ojluni/annotations/mmodules to make
Paul Duffinc241d6a2019-06-25 15:40:29 +0100722// them available to metalava. Used for core platform API and intra-core API
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100723// annotations in OpenJDK source.
Pete Gillinc9935b62018-09-25 14:42:40 +0100724droiddoc_exported_dir {
725 name: "ojluni-annotated-mmodule-stubs",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100726 visibility: [
727 "//libcore/mmodules/core_platform_api",
728 "//libcore/mmodules/intracoreapi",
729 ],
Pete Gillinc9935b62018-09-25 14:42:40 +0100730 path: "ojluni/annotations/mmodule",
731}
Pete Gillin7db7faa2018-07-31 13:29:35 +0100732
Neil Fuller6f16b462018-09-04 15:40:39 +0100733// A file containing the list of tags that are "known" to us from the OpenJdk
734// source code and so should not cause an error or warning.
Nan Zhangd55722b2018-02-27 15:08:20 -0800735filegroup {
736 name: "known-oj-tags",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100737 visibility: [
738 "//frameworks/base",
739 ],
Nan Zhangd55722b2018-02-27 15:08:20 -0800740 srcs: [
741 "known_oj_tags.txt",
742 ],
743}
Nan Zhang602fc0e2018-03-22 16:14:22 -0700744
Paul Duffin5cd69e42019-10-11 17:12:23 +0100745// A special set of stubs containing the minimal set of self consistent
746// classes for which a system module can be created. Every system module must
747// contain the java.lang classes so the set was constructed by starting with
748// the java.lang classes and then adding their transitive dependencies without
749// splitting packages. So, if one class from a package is used then all classes
750// in that package were added to the set.
751//
752// Needed for java-current-stubs-system-modules.
753droidstubs {
754 name: "java-current-stubs-source",
755 srcs: [
756 ":core_oj_api_files",
757 ":core_libart_api_files",
758 ],
759 java_version: "1.9",
760 installable: false,
761 sdk_version: "none",
762 system_modules: "none",
763
764 args: "--stub-packages java.*:javax.*:org.w3c.dom.*:org.xml.sax.*",
765}
766
767java_library {
768 name: "java.current.stubs",
769 srcs: [":java-current-stubs-source"],
770 errorprone: {
771 javacflags: [
772 "-Xep:MissingOverride:OFF",
773 ],
774 },
775 patch_module: "java.base",
776 sdk_version: "none",
777 system_modules: "none",
778}
779
780// A special set of system modules needed to build art.module.public.api.stubs
781// that contain nullability annotations when targeting java language level 1.9
782// and above.
783java_system_modules {
784 name: "java-current-stubs-system-modules",
785 libs: [
786 // Minimal set of classes required for a system module.
787 "java.current.stubs",
788
789 // The nullability annotations used by the generated stubs.
790 "stub-annotations",
791 ],
792}
793
Paul Duffin3f028ca2019-11-11 20:17:28 +0000794// http://b/129765390 Rewrite links to "platform" or "technotes" folders
795// which are siblings (and thus outside of) {@docRoot}.
796//
797// We have to escape \ as \\ and $ as $$ here because they get resolved by
798// different layers of the build tooling. The arguments are wrapped in '' so
799// that the shell doesn't add yet another level of escaping.
800rewrite_openjdk_doc_args = "--replace-documentation " +
801 // packages whose descendants to apply replacement to (all packages from
802 // libcore/ojluni/src/main/java that contribute to documentation).
803 "com.sun:java:javax:jdk.net:sun " +
804 // regex of the string to replace
805 "'(<a\\s+href\\s?=[\\*\\s]*\")(?:(?:\\{@docRoot\\}/\\.\\./)|(?:(?:\\.\\./)+))((?:platform|technotes).+)\">' " +
806 // replacement (with $1, $2 backreferences to the regex groups)
807 "'$$1https://docs.oracle.com/javase/8/docs/$$2\">' "
808
Paul Duffina8bb6062019-09-25 15:50:13 +0100809// Generates stubs for the parts of the public SDK API provided by the ART module.
Paul Duffin0ca3cbe2019-02-14 15:47:58 +0000810//
Paul Duffina8bb6062019-09-25 15:50:13 +0100811// Only for use by art.module.public.api.stubs target below.
Nan Zhangf0207602018-09-10 18:57:38 -0700812droidstubs {
Paul Duffin35149822019-10-11 10:38:51 +0100813 name: "art-module-public-api-stubs-source",
Paul Duffin53690cb2019-09-19 15:11:28 +0100814 srcs: [
Paul Duffina8bb6062019-09-25 15:50:13 +0100815 ":core_oj_api_files",
816 ":core_libart_api_files",
Paul Duffin53690cb2019-09-19 15:11:28 +0100817 ],
Tobias Thiererde991232018-03-07 15:10:46 +0000818 java_version: "1.9",
Nan Zhang602fc0e2018-03-22 16:14:22 -0700819 installable: false,
Paul Duffin419b2422019-06-25 15:42:05 +0100820 sdk_version: "none",
Paul Duffin5cd69e42019-10-11 17:12:23 +0100821 system_modules: "java-current-stubs-system-modules",
Paul Duffinfe5f63c2019-10-11 09:53:11 +0100822 libs: [
823 // Provide access to I18N constants that are used to initialize
824 // constants in the public API. i.e. to allow the value of the
825 // java.text.CollectionElementIterator.NULLORDER to be initialized from
826 // android.icu.text.CollationElementIterator.NULLORDER.
827 "i18n.module.intra.core.api.stubs",
828 ],
Paul Duffin5cd69e42019-10-11 17:12:23 +0100829
Paul Duffin3f028ca2019-11-11 20:17:28 +0000830 args: rewrite_openjdk_doc_args,
831
Paul Duffin5cd69e42019-10-11 17:12:23 +0100832 create_doc_stubs: true,
833
834 // Emit nullability annotations from the source to the stub files.
Paul Duffinc3e1c0a2019-11-01 20:29:36 +0000835 annotations_enabled: true,
836
837 merge_annotations_dirs: [
Paul Duffinc3e1c0a2019-11-01 20:29:36 +0000838 "ojluni-annotated-sdk-stubs",
839 ],
Nan Zhang602fc0e2018-03-22 16:14:22 -0700840}
841
Paul Duffina8bb6062019-09-25 15:50:13 +0100842// A stubs target containing the parts of the public SDK API provided by the ART module.
843java_library {
844 name: "art.module.public.api.stubs",
Paul Duffin35149822019-10-11 10:38:51 +0100845 srcs: [":art-module-public-api-stubs-source"],
Paul Duffina8bb6062019-09-25 15:50:13 +0100846 errorprone: {
847 javacflags: [
848 "-Xep:MissingOverride:OFF",
849 ],
850 },
Paul Duffin1d7d4a72019-10-10 18:15:01 +0100851 patch_module: "java.base",
Paul Duffina8bb6062019-09-25 15:50:13 +0100852 sdk_version: "none",
Paul Duffin5cd69e42019-10-11 17:12:23 +0100853 system_modules: "java-current-stubs-system-modules",
Paul Duffina8bb6062019-09-25 15:50:13 +0100854}
855
856// Used when compiling higher-level code against art.module.public.api.stubs.
Paul Duffinf545bc72019-10-02 14:07:04 +0100857//
858// This is only intended for use within core libraries and must not be used
859// from outside.
Paul Duffina8bb6062019-09-25 15:50:13 +0100860java_system_modules {
861 name: "art-module-public-api-stubs-system-modules",
862 visibility: [
Paul Duffinba71f832019-09-27 14:54:23 +0100863 "//external/conscrypt",
Paul Duffin00b174e2019-09-26 16:22:17 +0100864 "//external/icu/android_icu4j",
Paul Duffina8bb6062019-09-25 15:50:13 +0100865 "//external/wycheproof",
866 ],
867 libs: [
868 "art.module.public.api.stubs",
869 // This one is not on device but it's needed when javac compiles code
870 // containing lambdas.
871 "core-lambda-stubs-for-system-modules",
872 // This one is not on device but it's needed when javac compiles code
873 // containing @Generated annotations produced by some code generation
874 // tools.
875 // See http://b/123891440.
876 "core-generated-annotation-stubs",
Paul Duffinf545bc72019-10-02 14:07:04 +0100877
878 // Ensure that core libraries that depend on the public API can access
879 // the UnsupportedAppUsage, CorePlatformApi and IntraCoreApi
880 // annotations.
Paul Duffin81dd1df2019-10-10 15:44:53 +0100881 "art.module.api.annotations.for.system.modules",
Paul Duffin5cd69e42019-10-11 17:12:23 +0100882
883 // Make nullability annotations available when compiling public stubs.
884 // They are provided as a separate library because while the
885 // annotations are not themselves part of the public API provided by
886 // this module they are used in the stubs.
887 "stub-annotations",
Paul Duffina8bb6062019-09-25 15:50:13 +0100888 ],
889}
890
Paul Duffin0ca3cbe2019-02-14 15:47:58 +0000891// A stubs target containing the parts of the public SDK API provided by the
892// core library.
893//
894// Don't use this directly, use "sdk_version: core_current".
895java_library {
896 name: "core.current.stubs",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100897 visibility: ["//visibility:public"],
Paul Duffina8bb6062019-09-25 15:50:13 +0100898 static_libs: [
899 "art.module.public.api.stubs",
900 "conscrypt.module.public.api.stubs",
901 "i18n.module.public.api.stubs",
902 ],
Paul Duffin83c25382019-06-07 14:10:49 +0100903 sdk_version: "none",
Paul Duffin0ca3cbe2019-02-14 15:47:58 +0000904 system_modules: "none",
Paul Duffin65641182019-04-08 10:24:23 +0100905
906 dist: {
907 targets: [
908 "sdk",
909 "win_sdk",
910 ],
911 },
Paul Duffin0ca3cbe2019-02-14 15:47:58 +0000912}
913
Neil Fuller61dabbf2018-10-21 22:53:18 +0100914// Used when compiling higher-level code against core.current.stubs.
915java_system_modules {
916 name: "core-current-stubs-system-modules",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100917 visibility: ["//visibility:public"],
Neil Fuller61dabbf2018-10-21 22:53:18 +0100918 libs: [
919 "core.current.stubs",
920 // This one is not on device but it's needed when javac compiles code
921 // containing lambdas.
922 "core-lambda-stubs-for-system-modules",
923 // This one is not on device but it's needed when javac compiles code
924 // containing @Generated annotations produced by some code generation
925 // tools.
926 // See http://b/123891440.
927 "core-generated-annotation-stubs",
928 ],
929}
930
Pete Gillin600c7cf2018-08-16 19:28:38 +0100931// Target for validating nullability annotations for correctness and
932// completeness. To check that there are no nullability errors:
Paul Duffinbfbfb672019-10-03 17:53:32 +0100933// m art-module-public-api-stubs-nullability-validation
Pete Gillin600c7cf2018-08-16 19:28:38 +0100934// To check that there are only the expected nullability warnings:
Paul Duffinbfbfb672019-10-03 17:53:32 +0100935// m art-module-public-api-stubs-nullability-validation-check-nullability-warnings
Pete Gillincdca7f82019-10-04 13:28:57 +0100936// (If that check fails, it will provide instructions on how to proceed,
937// including the command to run to update the expected warnings file.)
Pete Gillin600c7cf2018-08-16 19:28:38 +0100938droidstubs {
Paul Duffinbfbfb672019-10-03 17:53:32 +0100939 name: "art-module-public-api-stubs-nullability-validation",
940 srcs: [":art_module_api_files"],
Pete Gillin600c7cf2018-08-16 19:28:38 +0100941 installable: false,
Paul Duffin419b2422019-06-25 15:42:05 +0100942 sdk_version: "none",
Paul Duffinc799a7c2019-10-11 14:19:36 +0100943 system_modules: "none",
Pete Gillin600c7cf2018-08-16 19:28:38 +0100944 annotations_enabled: true,
945 args: "--hide-annotation libcore.api.Hide " +
946 "--validate-nullability-from-merged-stubs ",
947 merge_inclusion_annotations_dirs: ["ojluni-annotated-mmodule-stubs"],
948 merge_annotations_dirs: [
Pete Gillin600c7cf2018-08-16 19:28:38 +0100949 // N.B. Stubs in this filegroup will be validated:
950 "ojluni-annotated-nullability-stubs",
951 ],
Pete Gillinc5f179b2018-11-14 18:42:19 +0000952 // The list of classes which have nullability annotations included in the source.
953 // (This is in addition to those which have annotations in the merged stubs.)
954 validate_nullability_from_list: "nullability_annotated_classes.txt",
Pete Gillin600c7cf2018-08-16 19:28:38 +0100955 // The expected set of warnings about missing annotations:
956 check_nullability_warnings: "nullability_warnings.txt",
957}
958
Neil Fullere784ef22018-11-16 15:54:30 +0000959// A host library containing time zone related classes. Used for
960// host-side tools and tests that have to deal with Android
961// time zone data.
962java_library_host {
963 name: "timezone-host",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100964 visibility: [
965 "//system/timezone/distro/core",
966 ],
Neil Fullere784ef22018-11-16 15:54:30 +0000967 srcs: [":timezone_host_files"],
968}
Andrei Onea24892e22019-04-16 16:48:37 +0100969
Paul Duffinf48513e2019-10-07 14:04:04 +0100970// A special set of system modules for building the following library for use
971// in the art-module-public-api-system-modules.
972java_system_modules {
973 name: "api-annotations-system-modules",
974 libs: [
975 "art.module.public.api.stubs",
976 ],
977}
978
Paul Duffin81dd1df2019-10-10 15:44:53 +0100979// A library that contains annotations that define API surfaces (core
980// platform, intra core and the hidden API) along with some supporting
981// constants. The annotations are source only and do not introduce any runtime
982// dependencies. Specially built for use in system modules definitions to
983// avoid introducing compile time cycles.
Victor Changb28d3f82019-08-09 16:24:46 +0100984java_library {
Paul Duffin81dd1df2019-10-10 15:44:53 +0100985 name: "art.module.api.annotations.for.system.modules",
Victor Changb28d3f82019-08-09 16:24:46 +0100986 srcs: [
Paul Duffin81dd1df2019-10-10 15:44:53 +0100987 ":api_surface_annotation_files",
Victor Changb28d3f82019-08-09 16:24:46 +0100988 ],
989
990 installable: false,
Paul Duffinf545bc72019-10-02 14:07:04 +0100991 sdk_version: "none",
Paul Duffinf48513e2019-10-07 14:04:04 +0100992 system_modules: "api-annotations-system-modules",
993 patch_module: "java.base",
Victor Changb28d3f82019-08-09 16:24:46 +0100994}
995
Paul Duffin81dd1df2019-10-10 15:44:53 +0100996// Create a library containing the api surface annotations, built against
997// core_current for use by the annotation processor in frameworks/base.
998java_library {
999 name: "art.module.api.annotations",
Paul Duffinc241d6a2019-06-25 15:40:29 +01001000 visibility: [
1001 "//frameworks/base",
1002 ],
Paul Duffin81dd1df2019-10-10 15:44:53 +01001003 host_supported: true,
Andrei Onea24892e22019-04-16 16:48:37 +01001004 srcs: [
Paul Duffin81dd1df2019-10-10 15:44:53 +01001005 ":api_surface_annotation_files",
Andrei Onea24892e22019-04-16 16:48:37 +01001006 ],
Pete Gillin40abce82019-10-18 17:58:52 +01001007 java_version: "1.9",
Paul Duffin81dd1df2019-10-10 15:44:53 +01001008 sdk_version: "core_current",
Neil Fuller86345d72019-04-25 09:15:32 +01001009}