blob: 68629879b854cb259fb1ecaa94db027832fd3b61 [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 Changcad47af2019-08-06 16:33:38 +0100123 ":android_icu4j_src_files",
Neil Fullere32e2e12019-02-26 11:48:30 +0000124 ":core_oj_api_files",
125 ":core_libart_api_files",
126 ":conscrypt_public_api_files",
127 ],
128}
129
Paul Duffine59d0aa2019-10-04 09:52:59 +0100130// Contains the stubs source for the part of the Android SDK public API which
131// is provided by the core libraries.
132//
133// Currently is only a placeholder that creates an empty srcjar due to issues
134// caused by http://b/142113901.
135//
136// TODO(http://b/142113521) - Add stubs source for the core library modules.
137genrule {
138 name: "core-current-stubs-source",
139 visibility: [
140 "//frameworks/base",
141 ],
142 tools: [
143 "merge_zips",
144 ],
145 out: ["core-current-stubs-source.srcjar"],
146 cmd: "$(location merge_zips) $(out)",
147}
148
Paul Duffina38da2d2019-10-01 17:49:50 +0100149// The set of files for the ART module that contribute to one or more API
150// surfaces. This includes files that are in the public API as well as those
151// that are not but which have been marked up with @hide plus one or more of
152// the API defining annotations.
153//
154// Some source files in :core_oj_api_files and :openjdk_mmodule_extra_files are
155// annotated by applying annotations to the .annotated.java stubs files in
156// ojluni/annotated/mmodules and rather than in the original source. See the comments
157// in openjdk_java_files.bp for more details.
158filegroup {
159 name: "art_module_api_files",
160 visibility: [
161 "//libcore:__subpackages__",
162 ],
163 srcs: [
Neil Fullerd129bc92018-09-26 11:12:58 +0100164 ":apache-xml_api_files",
Neil Fullera77f7102018-09-21 19:04:41 +0100165 ":bouncycastle_java_files",
Neil Fuller866ed4a2018-09-06 12:05:46 +0100166 ":core_oj_api_files",
167 ":core_libart_api_files",
Neil Fuller641d5f92018-09-24 15:40:39 +0100168 ":okhttp_api_files",
Pete Gillinc9935b62018-09-25 14:42:40 +0100169 ":openjdk_mmodule_extra_files",
Neil Fuller866ed4a2018-09-06 12:05:46 +0100170 ],
171}
172
Colin Crossaf0b54c2017-09-27 17:22:32 -0700173java_defaults {
174 name: "libcore_java_defaults",
175 javacflags: [
176 //"-Xlint:all",
177 //"-Xlint:-serial,-deprecation,-unchecked",
178 ],
179 dxflags: ["--core-library"],
Andreas Gampe66b31732018-02-20 09:22:16 -0800180 errorprone: {
181 javacflags: [
Paul Duffinc31f6bb2019-05-15 12:32:44 +0100182 "-Xep:MissingOverride:OFF", // Ignore missing @Override.
183 "-Xep:ConstantOverflow:WARN", // Known constant overflow in SplittableRandom
Andreas Gampe66b31732018-02-20 09:22:16 -0800184 ],
185 },
Colin Crossaf0b54c2017-09-27 17:22:32 -0700186}
187
188//
189// Build for the target (device).
190//
191
Tobias Thierer52331642019-05-29 12:11:39 +0000192// A target used to bootstrap compilation for the core library.
Paul Duffina8173c52019-09-24 13:04:42 +0100193//
Tobias Thierer52331642019-05-29 12:11:39 +0000194// See core-all-system-modules for more details.
195java_library {
196 name: "core-all",
Tobias Thierer52331642019-05-29 12:11:39 +0000197 defaults: ["libcore_java_defaults"],
Colin Crossaf0b54c2017-09-27 17:22:32 -0700198
199 srcs: [
Paul Duffinf975b712019-10-02 12:37:38 +0100200 // Use the source code for the I18N module intra core API as using the
201 // compiled version does not work due to limitations in either soong or the javac
202 // toolchain. See http://b/142056316 for more details.
203 ":i18n-module-intra-core-api-stubs-source",
Neil Fuller866ed4a2018-09-06 12:05:46 +0100204 ":core_oj_java_files",
205 ":core_libart_java_files",
Colin Crossaf0b54c2017-09-27 17:22:32 -0700206 ":openjdk_lambda_stub_files",
Pete Gillin54035812019-05-08 15:09:39 +0100207 ":openjdk_generated_annotation_stub_files",
Colin Crossaf0b54c2017-09-27 17:22:32 -0700208 ],
Colin Crossec80f4f2018-08-15 21:17:11 -0700209
Paul Duffin83c25382019-06-07 14:10:49 +0100210 sdk_version: "none",
Colin Crossec80f4f2018-08-15 21:17:11 -0700211 system_modules: "none",
Paul Duffin1d7d4a72019-10-10 18:15:01 +0100212 patch_module: "java.base",
Colin Crossa4d9fc42017-09-29 18:04:37 -0700213 openjdk9: {
214 srcs: ["luni/src/module/java/module-info.java"],
Colin Crossa4d9fc42017-09-29 18:04:37 -0700215 },
Colin Crossec80f4f2018-08-15 21:17:11 -0700216
Tobias Thierer79eea262019-08-01 14:05:11 +0100217 java_resources: core_resources,
Tobias Thiererde991232018-03-07 15:10:46 +0000218 java_version: "1.9",
Colin Crossaf0b54c2017-09-27 17:22:32 -0700219
Colin Crossaf0b54c2017-09-27 17:22:32 -0700220 installable: false,
atrost98ec08d2019-08-05 12:23:41 +0100221
222 plugins: ["compat-changeid-annotation-processor"],
223}
224
225platform_compat_config {
226 name: "libcore-platform-compat-config",
atrost98ec08d2019-08-05 12:23:41 +0100227 src: ":core-all",
Colin Crossaf0b54c2017-09-27 17:22:32 -0700228}
229
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100230// A system modules definition for use by core library targets only. It only
231// contains the core-all jar, which contains the classes that end up in core-oj,
232// core-libart as well as the lambda stubs needed to compile Java lambda code.
233// It does not contain other parts of core library like conscrypt, bouncycastle,
234// etc. This system_modules definition is used to bootstrap compilation for
Paul Duffin00b174e2019-09-26 16:22:17 +0100235// other parts of the core library like core-oj, core-libart, conscrypt,
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100236// bouncycastle, etc.
Colin Crossa4d9fc42017-09-29 18:04:37 -0700237java_system_modules {
238 name: "core-all-system-modules",
Paul Duffina8173c52019-09-24 13:04:42 +0100239
240 // Visibility is deliberately restricted to a small set of build modules that
241 // the core library team control.
242 visibility: [
243 "//external/apache-harmony:__subpackages__",
244 "//external/apache-xml",
Paul Duffina8173c52019-09-24 13:04:42 +0100245 "//external/okhttp",
246 "//libcore:__subpackages__",
247 ],
248
Colin Crossa4d9fc42017-09-29 18:04:37 -0700249 libs: ["core-all"],
250}
251
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100252// Contains the parts of core library associated with OpenJDK.
Colin Crossaf0b54c2017-09-27 17:22:32 -0700253java_library {
254 name: "core-oj",
Paul Duffin48ac7b62019-03-28 14:28:06 +0000255 visibility: [
256 "//art/build/apex",
257 "//external/wycheproof",
Paul Duffin94f70232019-05-22 16:22:29 +0100258 "//libcore/benchmarks",
Paul Duffin48ac7b62019-03-28 14:28:06 +0000259 ],
Colin Crossaf0b54c2017-09-27 17:22:32 -0700260 defaults: ["libcore_java_defaults"],
Colin Cross5b75cdd2018-06-27 11:00:13 -0700261 installable: true,
Colin Crossbb180be2017-10-09 14:54:53 -0700262 hostdex: true,
Colin Crossaf0b54c2017-09-27 17:22:32 -0700263
Neil Fuller866ed4a2018-09-06 12:05:46 +0100264 srcs: [":core_oj_java_files"],
Tobias Thierer79eea262019-08-01 14:05:11 +0100265 java_resources: core_resources,
Colin Crossec80f4f2018-08-15 21:17:11 -0700266
Paul Duffin83c25382019-06-07 14:10:49 +0100267 sdk_version: "none",
Colin Crossa4d9fc42017-09-29 18:04:37 -0700268 system_modules: "core-all-system-modules",
Paul Duffin1d7d4a72019-10-10 18:15:01 +0100269 patch_module: "java.base",
Colin Crossec80f4f2018-08-15 21:17:11 -0700270
Pete Gillin7a7a6d22017-12-19 14:56:03 +0000271 jacoco: {
Pete Gillin27ca0582018-01-10 17:04:17 +0000272 exclude_filter: [
Pete Gillin3f59bad2018-01-30 11:20:29 +0000273 "java.lang.Class",
274 "java.lang.Long",
275 "java.lang.Number",
276 "java.lang.Object",
277 "java.lang.String",
278 "java.lang.invoke.MethodHandle",
279 "java.lang.ref.Reference",
280 "java.lang.reflect.Proxy",
Pete Gillinb1868ada2018-01-17 11:03:10 +0000281 "java.util.AbstractMap",
Pete Gillin3f59bad2018-01-30 11:20:29 +0000282 "java.util.HashMap",
283 "java.util.HashMap$Node",
Pete Gillinb1868ada2018-01-17 11:03:10 +0000284 "java.util.Map",
Pete Gillin7a7a6d22017-12-19 14:56:03 +0000285 ],
286 },
Colin Crossaf0b54c2017-09-27 17:22:32 -0700287
288 notice: "ojluni/NOTICE",
289
Colin Crossaf0b54c2017-09-27 17:22:32 -0700290}
291
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100292// Contains parts of core library not associated with OpenJDK. Contains not
Victor Changcad47af2019-08-06 16:33:38 +0100293// just java.*, javax.* code but also android.system.* and various internal
294// libcore.* packages.
Colin Crossaf0b54c2017-09-27 17:22:32 -0700295java_library {
296 name: "core-libart",
Paul Duffin48ac7b62019-03-28 14:28:06 +0000297 visibility: [
298 "//art/build/apex",
299 "//external/robolectric-shadows",
300 "//external/wycheproof",
Paul Duffin94f70232019-05-22 16:22:29 +0100301 "//libcore/benchmarks",
Colin Crossf0ef6252019-05-31 08:26:47 -0700302 "//frameworks/layoutlib",
Paul Duffin48ac7b62019-03-28 14:28:06 +0000303 ],
Colin Crossaf0b54c2017-09-27 17:22:32 -0700304 defaults: ["libcore_java_defaults"],
Colin Cross5b75cdd2018-06-27 11:00:13 -0700305 installable: true,
Colin Crossbb180be2017-10-09 14:54:53 -0700306 hostdex: true,
Colin Crossaf0b54c2017-09-27 17:22:32 -0700307
Neil Fuller866ed4a2018-09-06 12:05:46 +0100308 srcs: [":core_libart_java_files"],
Tobias Thiererde991232018-03-07 15:10:46 +0000309 java_version: "1.9",
Colin Crossaf0b54c2017-09-27 17:22:32 -0700310
Paul Duffin83c25382019-06-07 14:10:49 +0100311 sdk_version: "none",
Colin Crossa4d9fc42017-09-29 18:04:37 -0700312 system_modules: "core-all-system-modules",
Paul Duffin1d7d4a72019-10-10 18:15:01 +0100313 patch_module: "java.base",
Colin Crossec80f4f2018-08-15 21:17:11 -0700314
Pete Gillin80ebe872018-02-13 15:21:20 +0000315 jacoco: {
316 exclude_filter: [
317 "java.lang.DexCache",
318 "dalvik.system.ClassExt",
319 ],
320 },
Colin Crossaf0b54c2017-09-27 17:22:32 -0700321
Andreas Gampe9a1ba892019-04-24 12:35:40 -0700322 target: {
323 hostdex: {
324 required: [
Neil Fuller53c5f032019-06-05 13:47:39 +0100325 // Files used to simulate the /system, runtime APEX and tzdata
326 // APEX dir structure on host.
327 "icu_tzdata.dat_host_tzdata_apex",
Andreas Gampe9a1ba892019-04-24 12:35:40 -0700328 "tzdata_host",
Neil Fuller53c5f032019-06-05 13:47:39 +0100329 "tzdata_host_tzdata_apex",
Neil Fuller53c5f032019-06-05 13:47:39 +0100330 "tzlookup.xml_host_tzdata_apex",
Andreas Gampe9a1ba892019-04-24 12:35:40 -0700331 "tz_version_host",
Neil Fuller53c5f032019-06-05 13:47:39 +0100332 "tz_version_host_tzdata_apex",
Andreas Gampe9a1ba892019-04-24 12:35:40 -0700333 ],
334 },
335 },
Colin Crossaf0b54c2017-09-27 17:22:32 -0700336}
337
Paul Duffin7bb8d232018-10-23 11:48:38 +0100338// Provided solely to contribute information about which hidden parts of the
339// core-oj API are used by apps.
Paul Duffinc6bf27b2019-05-15 14:41:00 +0100340//
341// The build system determines that this library provides hiddenapi information
342// for the core-oj bootjar because its name is of the form <x>-hiddenapi, where
343// <x> is the name of a boot jar. That triggers the generation of a flags.csv
344// file which encapsulates information extracted from the UnsupportedAppUsage
345// annotations in the dex. The information from that file is then encoded into
346// the core-oj file.
347//
348// Usually, e.g. for core-libart, the UnsupportedAppUsage annotations are
349// added to the source that is compiled directly into the bootjar and the build
350// system extracts the information about UnsupportedAppUsage directly from
351// there.
352//
353// This approach of having separate annotated source and a separate build
354// target was taken for ojluni to avoid having to maintain local patches in the
355// ojluni source for UnsupportedAppUsage annotations as that would make it more
356// difficult to pull down changes from upstream.
357//
Paul Duffin7bb8d232018-10-23 11:48:38 +0100358java_library {
359 name: "core-oj-hiddenapi",
Paul Duffin48ac7b62019-03-28 14:28:06 +0000360 // Do not allow this to be accessed from outside this directory.
361 visibility: ["//visibility:private"],
Paul Duffin7bb8d232018-10-23 11:48:38 +0100362 defaults: ["libcore_java_defaults"],
363 compile_dex: true,
364
365 srcs: [":openjdk_hiddenapi_javadoc_files"],
366
Paul Duffin83c25382019-06-07 14:10:49 +0100367 sdk_version: "none",
Paul Duffin7bb8d232018-10-23 11:48:38 +0100368 system_modules: "core-all-system-modules",
Paul Duffin1d7d4a72019-10-10 18:15:01 +0100369 patch_module: "java.base",
Paul Duffin7bb8d232018-10-23 11:48:38 +0100370}
371
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100372//
Paul Duffin00b174e2019-09-26 16:22:17 +0100373// Guaranteed unstripped versions of core-oj and core-libart.
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100374//
Colin Cross3c6c2e22017-10-18 13:24:52 -0700375// The build system may or may not strip the core-oj and core-libart jars,
376// but these will not be stripped. See b/24535627.
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100377//
378
Colin Cross3c6c2e22017-10-18 13:24:52 -0700379java_library {
380 name: "core-oj-testdex",
Colin Cross5b75cdd2018-06-27 11:00:13 -0700381 installable: true,
Colin Cross3c6c2e22017-10-18 13:24:52 -0700382 static_libs: ["core-oj"],
Paul Duffin83c25382019-06-07 14:10:49 +0100383 sdk_version: "none",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700384 system_modules: "core-all-system-modules",
385 dxflags: ["--core-library"],
Colin Cross485ed362017-12-05 17:24:22 -0800386 dex_preopt: {
387 enabled: false,
388 },
Tobias Thiererde991232018-03-07 15:10:46 +0000389 java_version: "1.9",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700390 notice: "ojluni/NOTICE",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700391}
392
393java_library {
394 name: "core-libart-testdex",
Colin Cross5b75cdd2018-06-27 11:00:13 -0700395 installable: true,
Colin Cross3c6c2e22017-10-18 13:24:52 -0700396 static_libs: ["core-libart"],
Paul Duffin83c25382019-06-07 14:10:49 +0100397 sdk_version: "none",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700398 system_modules: "core-all-system-modules",
399 dxflags: ["--core-library"],
Colin Cross485ed362017-12-05 17:24:22 -0800400 dex_preopt: {
401 enabled: false,
402 },
Colin Cross3c6c2e22017-10-18 13:24:52 -0700403 notice: "ojluni/NOTICE",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700404}
405
Tobias Thierere0f8b312018-10-23 23:12:30 +0100406java_defaults {
407 name: "core_lambda_stubs_defaults",
Colin Crossaf0b54c2017-09-27 17:22:32 -0700408 defaults: ["libcore_java_defaults"],
Neil Fuller4207c7f2018-10-10 14:01:40 +0100409 hostdex: true,
Colin Crossaf0b54c2017-09-27 17:22:32 -0700410
Paul Duffin83c25382019-06-07 14:10:49 +0100411 sdk_version: "none",
Colin Crossa4d9fc42017-09-29 18:04:37 -0700412 system_modules: "core-all-system-modules",
Paul Duffin1d7d4a72019-10-10 18:15:01 +0100413 patch_module: "java.base",
Colin Crossaf0b54c2017-09-27 17:22:32 -0700414
415 notice: "ojluni/NOTICE",
416
417 installable: false,
418 include_srcs: true,
419}
Colin Crossa4d9fc42017-09-29 18:04:37 -0700420
Tobias Thierere0f8b312018-10-23 23:12:30 +0100421// Creates a jar that exists to satisfy javac when compiling source code that
422// contains lambdas. This contains all classes / methods required by javac
423// when generating invoke-dynamic lambda implementation code, even those that
424// are also in the public SDK API from API level 26 onwards.
425java_library {
426 name: "core-lambda-stubs",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100427 visibility: ["//visibility:public"],
Tobias Thierere0f8b312018-10-23 23:12:30 +0100428 defaults: ["core_lambda_stubs_defaults"],
429 srcs: [
430 ":openjdk_lambda_stub_files",
431 ":openjdk_lambda_duplicate_stub_files",
432 ],
433}
434
435// An alternative to core-lambda-stubs that omits openjdk_lambda_duplicate_stub_files
436// because those classes are also part of the core library public SDK API
437// (since API level 26).
438java_library {
439 name: "core-lambda-stubs-for-system-modules",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100440 visibility: [
441 "//libcore/mmodules/core_platform_api",
442 ],
Tobias Thierere0f8b312018-10-23 23:12:30 +0100443 defaults: ["core_lambda_stubs_defaults"],
444 srcs: [
445 ":openjdk_lambda_stub_files",
446 ],
447}
448
Pete Gillin54035812019-05-08 15:09:39 +0100449// Creates a jar that exists to satisfy javac when compiling source code that
450// contains @Generated annotations, which are produced by some code generation
451// tools (notably dagger) but aren't part of the Android API.
452// See http://b/123891440.
453java_library {
454 name: "core-generated-annotation-stubs",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100455 visibility: [
456 "//libcore/mmodules/core_platform_api",
457 ],
Pete Gillin54035812019-05-08 15:09:39 +0100458 defaults: ["libcore_java_defaults"],
459 srcs: [
460 ":openjdk_generated_annotation_stub_files",
461 ],
462 hostdex: true,
Paul Duffin83c25382019-06-07 14:10:49 +0100463 sdk_version: "none",
Pete Gillin54035812019-05-08 15:09:39 +0100464 system_modules: "core-all-system-modules",
Paul Duffin1d7d4a72019-10-10 18:15:01 +0100465 patch_module: "java.base",
Pete Gillin54035812019-05-08 15:09:39 +0100466 notice: "ojluni/NOTICE",
467 installable: false,
468 include_srcs: true,
469}
470
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100471// Builds libcore test rules
Colin Cross3c6c2e22017-10-18 13:24:52 -0700472java_library_static {
473 name: "core-test-rules",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100474 visibility: [
Paul Duffin01f6c022019-09-24 14:44:15 +0100475 "//external/conscrypt",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100476 "//frameworks/base/location/tests/locationtests",
477 ],
Colin Cross3c6c2e22017-10-18 13:24:52 -0700478 hostdex: true,
Colin Cross3c6c2e22017-10-18 13:24:52 -0700479 srcs: [
480 "dalvik/test-rules/src/main/**/*.java",
481 "test-rules/src/main/**/*.java",
482 ],
483 static_libs: ["junit"],
Neil Fuller4207c7f2018-10-10 14:01:40 +0100484
Paul Duffin83c25382019-06-07 14:10:49 +0100485 sdk_version: "none",
Neil Fuller4207c7f2018-10-10 14:01:40 +0100486 system_modules: "core-all-system-modules",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700487}
488
Andrei Oneae4392252019-09-03 11:54:14 +0100489// Builds platform_compat test rules
490java_library_static {
491 name: "platform_compat-test-rules",
492 visibility: ["//visibility:public"],
493 srcs: [
494 "luni/src/main/java/android/compat/**/*.java",
495 "test-rules/src/platform_compat/**/*.java",
496 "luni/src/main/java/libcore/api/CorePlatformApi.java",
497 "luni/src/main/java/libcore/api/IntraCoreApi.java",
498
499 ],
500 static_libs: [
501 "junit",
502 "guava",
503 "android-support-test",
504 ],
505 platform_apis: true,
Pete Gillin7fb42bb2019-10-14 11:36:45 +0100506 // This builds classes that are in the java.base Java module:
507 patch_module: "java.base",
Andrei Oneae4392252019-09-03 11:54:14 +0100508}
509
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100510// Builds the core-tests-support library used by various tests.
Colin Cross3c6c2e22017-10-18 13:24:52 -0700511java_library_static {
512 name: "core-tests-support",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100513 visibility: [
514 "//cts/apps/CtsVerifier",
515 "//cts/tests/tests/keystore",
516 "//cts/tests/tests/net",
517 "//cts/tests/tests/net/api23Test",
518 "//external/apache-harmony",
519 "//frameworks/base/core/tests/coretests",
520 "//libcore/benchmarks",
521 "//packages/apps/KeyChain/tests",
522 "//system/timezone/distro/core",
523 ],
Colin Cross3c6c2e22017-10-18 13:24:52 -0700524 hostdex: true,
Colin Cross3c6c2e22017-10-18 13:24:52 -0700525 srcs: ["support/src/test/java/**/*.java"],
Neil Fuller4207c7f2018-10-10 14:01:40 +0100526
Paul Duffin53c491f2019-06-12 13:48:14 +0100527 sdk_version: "core_platform",
Neil Fuller4380ab22018-10-18 19:38:53 +0100528 libs: ["junit"],
Colin Cross3c6c2e22017-10-18 13:24:52 -0700529 static_libs: [
Neil Fullerde8b0862018-10-12 21:53:31 +0100530 "bouncycastle-unbundled",
531 "bouncycastle-bcpkix-unbundled",
532 "bouncycastle-ocsp-unbundled",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700533 ],
534}
535
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100536// Builds the jsr166-tests library.
Colin Crossec80f4f2018-08-15 21:17:11 -0700537java_test {
Colin Cross3c6c2e22017-10-18 13:24:52 -0700538 name: "jsr166-tests",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100539 visibility: [
540 "//cts/tests/libcore/jsr166",
541 ],
Colin Cross3c6c2e22017-10-18 13:24:52 -0700542 srcs: ["jsr166-tests/src/test/java/**/*.java"],
Paul Duffin83c25382019-06-07 14:10:49 +0100543 sdk_version: "none",
Paul Duffin0e0f8c42019-09-20 14:49:55 +0100544 system_modules: "core-all-system-modules",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700545 libs: [
546 "junit",
547 ],
548}
Nan Zhang65f27a32018-01-05 10:41:46 -0800549
Pete Gillinec902b82019-06-26 17:23:00 +0100550// A filegroup that provides access to a source file for a toolchain test that
551// checks Java 9 language features are handled properly by JarJar.
552filegroup {
553 name: "core-java-9-language-features-source",
554 srcs: ["luni/src/main/java/libcore/internal/Java9LanguageFeatures.java"],
555 visibility: ["//libcore/luni/src/test/java9language"],
556}
557
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100558// Builds the core-tests library.
Colin Crossec80f4f2018-08-15 21:17:11 -0700559java_test {
560 name: "core-tests",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100561 visibility: [
562 "//cts/tests/libcore/luni",
563 ],
Colin Crossec80f4f2018-08-15 21:17:11 -0700564 defaults: ["libcore_java_defaults"],
565 hostdex: true,
566 srcs: [
567 "dalvik/src/test/java/**/*.java",
568 "dalvik/test-rules/src/test/java/**/*.java",
569 "dom/src/test/java/**/*.java",
570 "harmony-tests/src/test/java/**/*.java",
571 "json/src/test/java/**/*.java",
572 "luni/src/test/java/**/*.java",
Paul Duffin4ba14532019-03-21 10:32:41 +0000573 "test-rules/src/test/java/**/*.java",
Colin Crossec80f4f2018-08-15 21:17:11 -0700574 "xml/src/test/java/**/*.java",
575 ],
576 exclude_srcs: [
577 "luni/src/test/java/libcore/java/util/zip/Zip64Test.java",
578 "luni/src/test/java/libcore/java/util/zip/Zip64FileTest.java",
579 ],
580
581 java_resource_dirs: [
582 "*/src/test/java",
583 "*/src/test/resources",
584 ],
585 exclude_java_resource_dirs: [
586 "ojluni/src/test/java",
587 "ojluni/src/test/resources",
588 ],
589
590 java_resources: [
Paul Duffin16a057f2019-05-13 12:20:55 +0100591 ":annotations-test",
Colin Crossec80f4f2018-08-15 21:17:11 -0700592 ":filesystemstest",
593 ":parameter-metadata-test",
594 ],
595
Paul Duffin83c25382019-06-07 14:10:49 +0100596 sdk_version: "none",
Paul Duffin0e0f8c42019-09-20 14:49:55 +0100597 system_modules: "core-all-system-modules",
Neil Fuller4207c7f2018-10-10 14:01:40 +0100598 libs: [
Neil Fuller4207c7f2018-10-10 14:01:40 +0100599 "okhttp",
600 "bouncycastle",
601 ],
Neil Fuller4207c7f2018-10-10 14:01:40 +0100602
Colin Crossec80f4f2018-08-15 21:17:11 -0700603 static_libs: [
604 "archive-patcher",
Pete Gillin05a43202019-06-27 14:41:21 +0100605 "core-java-9-language-tests",
Colin Crossec80f4f2018-08-15 21:17:11 -0700606 "core-test-rules",
607 "core-tests-support",
608 "junit-params",
609 "mockftpserver",
610 "mockito-target",
611 "mockwebserver",
612 "nist-pkix-tests",
613 "slf4j-jdk14",
614 "sqlite-jdbc",
615 "tzdata-testing",
Paul Duffina4df2372018-12-10 15:48:01 +0000616 "truth-prebuilt",
Colin Crossec80f4f2018-08-15 21:17:11 -0700617 ],
618
619 errorprone: {
620 javacflags: [
621 "-Xep:TryFailThrowable:ERROR",
622 "-Xep:ComparisonOutOfRange:ERROR",
623 ],
624 },
Simran Basi3be01e02018-08-21 17:53:49 -0700625
626 test_config: "AndroidTest-core-tests.xml",
Colin Crossec80f4f2018-08-15 21:17:11 -0700627}
628
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100629// Builds the core-ojtests library that contains test code from OpenJDK.
Colin Crossec80f4f2018-08-15 21:17:11 -0700630java_test {
631 name: "core-ojtests",
632 defaults: ["libcore_java_defaults"],
633 hostdex: true,
634
635 srcs: [
636 "ojluni/src/test/java/**/*.java",
637 ],
638 java_resource_dirs: [
639 "ojluni/src/test/java",
640 "ojluni/src/test/resources",
641 ],
Neil Fullerb669ccb2018-10-04 23:10:27 +0100642
Paul Duffin83c25382019-06-07 14:10:49 +0100643 sdk_version: "none",
Paul Duffin0e0f8c42019-09-20 14:49:55 +0100644 system_modules: "core-all-system-modules",
Neil Fuller4207c7f2018-10-10 14:01:40 +0100645 libs: [
Neil Fuller4207c7f2018-10-10 14:01:40 +0100646 "okhttp",
647 "bouncycastle",
648 ],
Neil Fuller4207c7f2018-10-10 14:01:40 +0100649
Colin Crossec80f4f2018-08-15 21:17:11 -0700650 static_libs: ["testng"],
651
652 // ojluni/src/test/java/util/stream/{bootlib,boottest}
653 // contains tests that are in packages from java.base;
654 // By default, OpenJDK 9's javac will only compile such
655 // code if it's declared to also be in java.base at
656 // compile time.
657 //
Paul Duffin1d7d4a72019-10-10 18:15:01 +0100658 // For now, we use patch_module to put all sources
Colin Crossec80f4f2018-08-15 21:17:11 -0700659 // and dependencies from this make target into java.base;
660 // other source directories in this make target are in
661 // packages not from java.base; if this becomes a problem
662 // in future, this could be addressed eg. by splitting
663 // boot{lib,test} out into a separate make target,
664 // deleting those tests or moving them to a different
665 // package.
666 patch_module: "java.base",
667}
668
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100669// Builds the core-ojtests-public library. Excludes any private API tests.
670// Like core-ojtests but smaller.
Colin Crossec80f4f2018-08-15 21:17:11 -0700671java_test {
672 name: "core-ojtests-public",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100673 visibility: [
674 "//cts/tests/libcore/ojluni",
675 ],
Colin Crossec80f4f2018-08-15 21:17:11 -0700676 defaults: ["libcore_java_defaults"],
677 srcs: [
678 "ojluni/src/test/java/**/*.java",
679 ],
680 // Filter out the following:
681 // 1.) DeserializeMethodTest and SerializedLambdaTest, because they depends on stub classes
682 // and won't actually run, and
683 // 2.) util/stream/boot*. Those directories contain classes in the package java.util.stream;
684 // excluding them means we don't need patch_module: "java.base"
685 exclude_srcs: [
686 "**/DeserializeMethodTest.java",
687 "**/SerializedLambdaTest.java",
688 "ojluni/src/test/java/util/stream/boot*/**/*",
689 ],
690 java_resource_dirs: [
691 "ojluni/src/test/java",
692 "ojluni/src/test/resources",
693 // Include source code as part of JAR
694 "ojluni/src/test/dist",
695 ],
Neil Fuller4207c7f2018-10-10 14:01:40 +0100696
Paul Duffin83c25382019-06-07 14:10:49 +0100697 sdk_version: "none",
Paul Duffin0e0f8c42019-09-20 14:49:55 +0100698 system_modules: "core-all-system-modules",
Neil Fuller4207c7f2018-10-10 14:01:40 +0100699 libs: [
Neil Fuller4207c7f2018-10-10 14:01:40 +0100700 "bouncycastle",
701 "okhttp",
702 "testng",
703 ],
Colin Crossec80f4f2018-08-15 21:17:11 -0700704}
705
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100706// Exports annotated stubs source files in ojluni/annotations/sdk to make them
707// available to metalava. Used for nullability annotations in OpenJDK source.
Pete Gillin7db7faa2018-07-31 13:29:35 +0100708droiddoc_exported_dir {
Pete Gillin0728b742018-09-17 15:41:45 +0100709 name: "ojluni-annotated-sdk-stubs",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100710 visibility: [
711 "//frameworks/base",
712 ],
Pete Gillin0728b742018-09-17 15:41:45 +0100713 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 Duffina8bb6062019-09-25 15:50:13 +0100794// Generates stubs for the parts of the public SDK API provided by the ART module.
Paul Duffin0ca3cbe2019-02-14 15:47:58 +0000795//
Paul Duffina8bb6062019-09-25 15:50:13 +0100796// Only for use by art.module.public.api.stubs target below.
Nan Zhangf0207602018-09-10 18:57:38 -0700797droidstubs {
Paul Duffin35149822019-10-11 10:38:51 +0100798 name: "art-module-public-api-stubs-source",
Paul Duffin53690cb2019-09-19 15:11:28 +0100799 srcs: [
Paul Duffina8bb6062019-09-25 15:50:13 +0100800 ":core_oj_api_files",
801 ":core_libart_api_files",
Paul Duffin53690cb2019-09-19 15:11:28 +0100802 ],
Tobias Thiererde991232018-03-07 15:10:46 +0000803 java_version: "1.9",
Nan Zhang602fc0e2018-03-22 16:14:22 -0700804 installable: false,
Paul Duffin419b2422019-06-25 15:42:05 +0100805 sdk_version: "none",
Paul Duffin5cd69e42019-10-11 17:12:23 +0100806 system_modules: "java-current-stubs-system-modules",
807
808 create_doc_stubs: true,
809
810 // Emit nullability annotations from the source to the stub files.
811 args: "--include-annotations",
Nan Zhang602fc0e2018-03-22 16:14:22 -0700812}
813
Paul Duffina8bb6062019-09-25 15:50:13 +0100814// A stubs target containing the parts of the public SDK API provided by the ART module.
815java_library {
816 name: "art.module.public.api.stubs",
Paul Duffin35149822019-10-11 10:38:51 +0100817 srcs: [":art-module-public-api-stubs-source"],
Paul Duffina8bb6062019-09-25 15:50:13 +0100818 errorprone: {
819 javacflags: [
820 "-Xep:MissingOverride:OFF",
821 ],
822 },
Paul Duffin1d7d4a72019-10-10 18:15:01 +0100823 patch_module: "java.base",
Paul Duffina8bb6062019-09-25 15:50:13 +0100824 sdk_version: "none",
Paul Duffin5cd69e42019-10-11 17:12:23 +0100825 system_modules: "java-current-stubs-system-modules",
Paul Duffina8bb6062019-09-25 15:50:13 +0100826}
827
828// Used when compiling higher-level code against art.module.public.api.stubs.
Paul Duffinf545bc72019-10-02 14:07:04 +0100829//
830// This is only intended for use within core libraries and must not be used
831// from outside.
Paul Duffina8bb6062019-09-25 15:50:13 +0100832java_system_modules {
833 name: "art-module-public-api-stubs-system-modules",
834 visibility: [
Paul Duffinba71f832019-09-27 14:54:23 +0100835 "//external/conscrypt",
Paul Duffin00b174e2019-09-26 16:22:17 +0100836 "//external/icu/android_icu4j",
Paul Duffina8bb6062019-09-25 15:50:13 +0100837 "//external/wycheproof",
838 ],
839 libs: [
840 "art.module.public.api.stubs",
841 // This one is not on device but it's needed when javac compiles code
842 // containing lambdas.
843 "core-lambda-stubs-for-system-modules",
844 // This one is not on device but it's needed when javac compiles code
845 // containing @Generated annotations produced by some code generation
846 // tools.
847 // See http://b/123891440.
848 "core-generated-annotation-stubs",
Paul Duffinf545bc72019-10-02 14:07:04 +0100849
850 // Ensure that core libraries that depend on the public API can access
851 // the UnsupportedAppUsage, CorePlatformApi and IntraCoreApi
852 // annotations.
Paul Duffin81dd1df2019-10-10 15:44:53 +0100853 "art.module.api.annotations.for.system.modules",
Paul Duffin5cd69e42019-10-11 17:12:23 +0100854
855 // Make nullability annotations available when compiling public stubs.
856 // They are provided as a separate library because while the
857 // annotations are not themselves part of the public API provided by
858 // this module they are used in the stubs.
859 "stub-annotations",
Paul Duffina8bb6062019-09-25 15:50:13 +0100860 ],
861}
862
Paul Duffin0ca3cbe2019-02-14 15:47:58 +0000863// A stubs target containing the parts of the public SDK API provided by the
864// core library.
865//
866// Don't use this directly, use "sdk_version: core_current".
867java_library {
868 name: "core.current.stubs",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100869 visibility: ["//visibility:public"],
Paul Duffina8bb6062019-09-25 15:50:13 +0100870 static_libs: [
871 "art.module.public.api.stubs",
872 "conscrypt.module.public.api.stubs",
873 "i18n.module.public.api.stubs",
874 ],
Paul Duffin83c25382019-06-07 14:10:49 +0100875 sdk_version: "none",
Paul Duffin0ca3cbe2019-02-14 15:47:58 +0000876 system_modules: "none",
Paul Duffin65641182019-04-08 10:24:23 +0100877
878 dist: {
879 targets: [
880 "sdk",
881 "win_sdk",
882 ],
883 },
Paul Duffin0ca3cbe2019-02-14 15:47:58 +0000884}
885
Neil Fuller61dabbf2018-10-21 22:53:18 +0100886// Used when compiling higher-level code against core.current.stubs.
887java_system_modules {
888 name: "core-current-stubs-system-modules",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100889 visibility: ["//visibility:public"],
Neil Fuller61dabbf2018-10-21 22:53:18 +0100890 libs: [
891 "core.current.stubs",
892 // This one is not on device but it's needed when javac compiles code
893 // containing lambdas.
894 "core-lambda-stubs-for-system-modules",
895 // This one is not on device but it's needed when javac compiles code
896 // containing @Generated annotations produced by some code generation
897 // tools.
898 // See http://b/123891440.
899 "core-generated-annotation-stubs",
900 ],
901}
902
Pete Gillin600c7cf2018-08-16 19:28:38 +0100903// Target for validating nullability annotations for correctness and
904// completeness. To check that there are no nullability errors:
Paul Duffinbfbfb672019-10-03 17:53:32 +0100905// m art-module-public-api-stubs-nullability-validation
Pete Gillin600c7cf2018-08-16 19:28:38 +0100906// To check that there are only the expected nullability warnings:
Paul Duffinbfbfb672019-10-03 17:53:32 +0100907// m art-module-public-api-stubs-nullability-validation-check-nullability-warnings
Pete Gillincdca7f82019-10-04 13:28:57 +0100908// (If that check fails, it will provide instructions on how to proceed,
909// including the command to run to update the expected warnings file.)
Pete Gillin600c7cf2018-08-16 19:28:38 +0100910droidstubs {
Paul Duffinbfbfb672019-10-03 17:53:32 +0100911 name: "art-module-public-api-stubs-nullability-validation",
912 srcs: [":art_module_api_files"],
Pete Gillin600c7cf2018-08-16 19:28:38 +0100913 installable: false,
Paul Duffin419b2422019-06-25 15:42:05 +0100914 sdk_version: "none",
Paul Duffinc799a7c2019-10-11 14:19:36 +0100915 system_modules: "none",
Pete Gillin600c7cf2018-08-16 19:28:38 +0100916 annotations_enabled: true,
917 args: "--hide-annotation libcore.api.Hide " +
918 "--validate-nullability-from-merged-stubs ",
919 merge_inclusion_annotations_dirs: ["ojluni-annotated-mmodule-stubs"],
920 merge_annotations_dirs: [
921 "metalava-manual",
922 // N.B. Stubs in this filegroup will be validated:
923 "ojluni-annotated-nullability-stubs",
924 ],
Pete Gillinc5f179b2018-11-14 18:42:19 +0000925 // The list of classes which have nullability annotations included in the source.
926 // (This is in addition to those which have annotations in the merged stubs.)
927 validate_nullability_from_list: "nullability_annotated_classes.txt",
Pete Gillin600c7cf2018-08-16 19:28:38 +0100928 // The expected set of warnings about missing annotations:
929 check_nullability_warnings: "nullability_warnings.txt",
930}
931
Neil Fullere784ef22018-11-16 15:54:30 +0000932// A host library containing time zone related classes. Used for
933// host-side tools and tests that have to deal with Android
934// time zone data.
935java_library_host {
936 name: "timezone-host",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100937 visibility: [
938 "//system/timezone/distro/core",
939 ],
Neil Fullere784ef22018-11-16 15:54:30 +0000940 srcs: [":timezone_host_files"],
941}
Andrei Onea24892e22019-04-16 16:48:37 +0100942
Paul Duffinf48513e2019-10-07 14:04:04 +0100943// A special set of system modules for building the following library for use
944// in the art-module-public-api-system-modules.
945java_system_modules {
946 name: "api-annotations-system-modules",
947 libs: [
948 "art.module.public.api.stubs",
949 ],
950}
951
Paul Duffin81dd1df2019-10-10 15:44:53 +0100952// A library that contains annotations that define API surfaces (core
953// platform, intra core and the hidden API) along with some supporting
954// constants. The annotations are source only and do not introduce any runtime
955// dependencies. Specially built for use in system modules definitions to
956// avoid introducing compile time cycles.
Victor Changb28d3f82019-08-09 16:24:46 +0100957java_library {
Paul Duffin81dd1df2019-10-10 15:44:53 +0100958 name: "art.module.api.annotations.for.system.modules",
Victor Changb28d3f82019-08-09 16:24:46 +0100959 srcs: [
Paul Duffin81dd1df2019-10-10 15:44:53 +0100960 ":api_surface_annotation_files",
Victor Changb28d3f82019-08-09 16:24:46 +0100961 ],
962
963 installable: false,
Paul Duffinf545bc72019-10-02 14:07:04 +0100964 sdk_version: "none",
Paul Duffinf48513e2019-10-07 14:04:04 +0100965 system_modules: "api-annotations-system-modules",
966 patch_module: "java.base",
Victor Changb28d3f82019-08-09 16:24:46 +0100967}
968
Paul Duffin81dd1df2019-10-10 15:44:53 +0100969// Create a library containing the api surface annotations, built against
970// core_current for use by the annotation processor in frameworks/base.
971java_library {
972 name: "art.module.api.annotations",
Paul Duffinc241d6a2019-06-25 15:40:29 +0100973 visibility: [
974 "//frameworks/base",
975 ],
Paul Duffin81dd1df2019-10-10 15:44:53 +0100976 host_supported: true,
Andrei Onea24892e22019-04-16 16:48:37 +0100977 srcs: [
Paul Duffin81dd1df2019-10-10 15:44:53 +0100978 ":api_surface_annotation_files",
Andrei Onea24892e22019-04-16 16:48:37 +0100979 ],
Pete Gillin40abce82019-10-18 17:58:52 +0100980 java_version: "1.9",
Paul Duffin81dd1df2019-10-10 15:44:53 +0100981 sdk_version: "core_current",
Neil Fuller86345d72019-04-25 09:15:32 +0100982}