blob: bbe15395e9808a525610941dec3f00b0b65287da [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/
22// directories. See the "core-system-modules" definition for the parts.
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.
48core_resource_dirs = [
49 "luni/src/main/java",
50 "ojluni/src/main/resources/",
51]
52
Neil Fuller866ed4a2018-09-06 12:05:46 +010053// The source files that go into core-oj.
54filegroup {
55 name: "core_oj_java_files",
56 srcs: [":openjdk_java_files"],
57}
58
59// OpenJDK source is not annotated with @hide so we need a separate
60// filegroup for just the parts that contribute to the API.
61filegroup {
62 name: "core_oj_api_files",
63 srcs: [":openjdk_javadoc_files"],
64}
65
66// The source files that go into core-libart.
67filegroup {
68 name: "core_libart_java_files",
69 srcs: [
70 ":non_openjdk_java_files",
71 ":android_icu4j_src_files",
72 ],
73}
74
75// Some parts of libart are not annotated with @hide so we need a separate
76// filegroup for just the parts that contribute to the API.
77filegroup {
78 name: "core_libart_api_files",
79 srcs: [
80 ":non_openjdk_javadoc_files",
81 ":android_icu4j_src_files",
82 ],
83}
84
Neil Fuller77e3f3b2018-10-19 10:22:32 +010085// The set of files for the core library that have been marked up with @hide and
86// API-related annotations. Note that this includes the intra-core and
87// core-platform APIs as well as the public APIs.
88//
89// Some source files in :openjdk_mmodule_extra_files are annotated by applying
90// annotations to the .annotated.java stubs files in ojluni/annotated/mmodules
91// and rather than in the original source. See the comments in
92// openjdk_java_files.bp for more details.
Neil Fuller866ed4a2018-09-06 12:05:46 +010093filegroup {
94 name: "core_api_files",
95 srcs: [
Neil Fullerd129bc92018-09-26 11:12:58 +010096 ":apache-xml_api_files",
Neil Fullera77f7102018-09-21 19:04:41 +010097 ":bouncycastle_java_files",
Neil Fuller603e1a72018-09-25 11:55:41 +010098 ":conscrypt_java_files",
Neil Fuller866ed4a2018-09-06 12:05:46 +010099 ":core_oj_api_files",
100 ":core_libart_api_files",
101 ":core_simple_java_files",
Neil Fuller641d5f92018-09-24 15:40:39 +0100102 ":okhttp_api_files",
Pete Gillinc9935b62018-09-25 14:42:40 +0100103 ":openjdk_mmodule_extra_files",
Neil Fuller866ed4a2018-09-06 12:05:46 +0100104 ],
105}
106
Colin Crossaf0b54c2017-09-27 17:22:32 -0700107java_defaults {
108 name: "libcore_java_defaults",
109 javacflags: [
110 //"-Xlint:all",
111 //"-Xlint:-serial,-deprecation,-unchecked",
112 ],
113 dxflags: ["--core-library"],
Andreas Gampe66b31732018-02-20 09:22:16 -0800114 errorprone: {
115 javacflags: [
116 "-Xep:MissingOverride:OFF", // Ignore missing @Override.
Andreas Gampe24a20172018-06-13 11:28:45 -0700117 "-Xep:ConstantOverflow:WARN", // Known constant overflow in SplittableRandom
Andreas Gampe66b31732018-02-20 09:22:16 -0800118 ],
119 },
Colin Crossaf0b54c2017-09-27 17:22:32 -0700120}
121
122//
123// Build for the target (device).
124//
125
Victor Chang7fef4052018-09-25 14:12:03 +0100126// Rule generating resource lib for android_icu4j.
127// In the downstream branch master-icu-dev, the resource files are generated.
128// This rule can't be moved external/icu because soong enforces that no_standard_libs:true can only
129// be used in libcore/ or development/
130java_library {
131 name: "android_icu4j_resources_lib",
132 java_resources: [":android_icu4j_resources"],
133 no_standard_libs: true,
134 system_modules: "none",
135}
136
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100137// A target used to bootstrap compilation for the core library.
138// See core-all-system-modules for more details.
Colin Crossaf0b54c2017-09-27 17:22:32 -0700139java_library {
140 name: "core-all",
141 defaults: ["libcore_java_defaults"],
142
143 srcs: [
Neil Fuller866ed4a2018-09-06 12:05:46 +0100144 ":core_oj_java_files",
145 ":core_libart_java_files",
146 ":core_simple_java_files",
Colin Crossaf0b54c2017-09-27 17:22:32 -0700147 ":openjdk_lambda_stub_files",
148 ],
Colin Crossec80f4f2018-08-15 21:17:11 -0700149
150 no_standard_libs: true,
151 system_modules: "none",
Colin Crossa4d9fc42017-09-29 18:04:37 -0700152 openjdk9: {
153 srcs: ["luni/src/module/java/module-info.java"],
154 javacflags: ["--patch-module=java.base=."],
155 },
Colin Crossec80f4f2018-08-15 21:17:11 -0700156
Colin Crossaf0b54c2017-09-27 17:22:32 -0700157 java_resource_dirs: core_resource_dirs,
Victor Chang7fef4052018-09-25 14:12:03 +0100158 static_libs: ["android_icu4j_resources_lib"],
Colin Crossaf0b54c2017-09-27 17:22:32 -0700159
160 required: [
161 "tzdata",
162 "tzlookup.xml",
163 ],
164
165 installable: false,
166}
167
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100168// A system modules definition for use by core library targets only. It only
169// contains the core-all jar, which contains the classes that end up in core-oj,
170// core-libart as well as the lambda stubs needed to compile Java lambda code.
171// It does not contain other parts of core library like conscrypt, bouncycastle,
172// etc. This system_modules definition is used to bootstrap compilation for
173// other parts of the core library like core-oj, core-libart, conscrypt,
174// bouncycastle, etc.
175//
176// If you want to compile against the entire core library implementation, for
177// example to build core library tests, see "core-system-modules" instead.
Colin Crossa4d9fc42017-09-29 18:04:37 -0700178java_system_modules {
179 name: "core-all-system-modules",
180 libs: ["core-all"],
181}
182
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100183// Contains the parts of core library associated with OpenJDK.
Colin Crossaf0b54c2017-09-27 17:22:32 -0700184java_library {
185 name: "core-oj",
186 defaults: ["libcore_java_defaults"],
Colin Cross5b75cdd2018-06-27 11:00:13 -0700187 installable: true,
Colin Crossbb180be2017-10-09 14:54:53 -0700188 hostdex: true,
Colin Crossaf0b54c2017-09-27 17:22:32 -0700189
Neil Fuller866ed4a2018-09-06 12:05:46 +0100190 srcs: [":core_oj_java_files"],
Colin Crossaf0b54c2017-09-27 17:22:32 -0700191 java_resource_dirs: core_resource_dirs,
Colin Crossec80f4f2018-08-15 21:17:11 -0700192
193 no_standard_libs: true,
Colin Crossaf0b54c2017-09-27 17:22:32 -0700194 libs: ["core-all"],
Colin Crossa4d9fc42017-09-29 18:04:37 -0700195 system_modules: "core-all-system-modules",
196 openjdk9: {
197 javacflags: ["--patch-module=java.base=."],
198 },
Colin Crossec80f4f2018-08-15 21:17:11 -0700199
Pete Gillin7a7a6d22017-12-19 14:56:03 +0000200 jacoco: {
Pete Gillin27ca0582018-01-10 17:04:17 +0000201 exclude_filter: [
Pete Gillin3f59bad2018-01-30 11:20:29 +0000202 "java.lang.Class",
203 "java.lang.Long",
204 "java.lang.Number",
205 "java.lang.Object",
206 "java.lang.String",
207 "java.lang.invoke.MethodHandle",
208 "java.lang.ref.Reference",
209 "java.lang.reflect.Proxy",
Pete Gillinb1868ada2018-01-17 11:03:10 +0000210 "java.util.AbstractMap",
Pete Gillin3f59bad2018-01-30 11:20:29 +0000211 "java.util.HashMap",
212 "java.util.HashMap$Node",
Pete Gillinb1868ada2018-01-17 11:03:10 +0000213 "java.util.Map",
Pete Gillin7a7a6d22017-12-19 14:56:03 +0000214 ],
215 },
Colin Crossaf0b54c2017-09-27 17:22:32 -0700216
217 notice: "ojluni/NOTICE",
218
219 required: [
220 "tzdata",
221 "tzlookup.xml",
222 ],
Colin Crossbb180be2017-10-09 14:54:53 -0700223
Colin Crossaf0b54c2017-09-27 17:22:32 -0700224}
225
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100226// Contains parts of core library not associated with OpenJDK. Contains not
227// just java.*, javax.* code but also android.icu.*, android.system.* and
228// various internal libcore.* packages.
Colin Crossaf0b54c2017-09-27 17:22:32 -0700229java_library {
230 name: "core-libart",
231 defaults: ["libcore_java_defaults"],
Colin Cross5b75cdd2018-06-27 11:00:13 -0700232 installable: true,
Colin Crossbb180be2017-10-09 14:54:53 -0700233 hostdex: true,
Colin Crossaf0b54c2017-09-27 17:22:32 -0700234
Neil Fuller866ed4a2018-09-06 12:05:46 +0100235 srcs: [":core_libart_java_files"],
Victor Chang7fef4052018-09-25 14:12:03 +0100236 static_libs: ["android_icu4j_resources_lib"],
Colin Crossaf0b54c2017-09-27 17:22:32 -0700237
Colin Crossec80f4f2018-08-15 21:17:11 -0700238 no_standard_libs: true,
Colin Crossaf0b54c2017-09-27 17:22:32 -0700239 libs: ["core-all"],
Colin Crossa4d9fc42017-09-29 18:04:37 -0700240 system_modules: "core-all-system-modules",
241 openjdk9: {
242 javacflags: ["--patch-module=java.base=."],
243 },
Colin Crossec80f4f2018-08-15 21:17:11 -0700244
Pete Gillin80ebe872018-02-13 15:21:20 +0000245 jacoco: {
246 exclude_filter: [
247 "java.lang.DexCache",
248 "dalvik.system.ClassExt",
249 ],
250 },
Colin Crossaf0b54c2017-09-27 17:22:32 -0700251
252 required: [
253 "tzdata",
254 "tzlookup.xml",
255 ],
256}
257
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100258//
259// Guaranteed unstripped versions of core-oj and core-libart.
260//
Colin Cross3c6c2e22017-10-18 13:24:52 -0700261// The build system may or may not strip the core-oj and core-libart jars,
262// but these will not be stripped. See b/24535627.
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100263//
264
Colin Cross3c6c2e22017-10-18 13:24:52 -0700265java_library {
266 name: "core-oj-testdex",
Colin Cross5b75cdd2018-06-27 11:00:13 -0700267 installable: true,
Colin Cross3c6c2e22017-10-18 13:24:52 -0700268 static_libs: ["core-oj"],
269 no_standard_libs: true,
270 libs: ["core-all"],
271 system_modules: "core-all-system-modules",
272 dxflags: ["--core-library"],
Colin Cross485ed362017-12-05 17:24:22 -0800273 dex_preopt: {
274 enabled: false,
275 },
Colin Cross3c6c2e22017-10-18 13:24:52 -0700276 notice: "ojluni/NOTICE",
277 required: [
278 "tzdata",
279 "tzlookup.xml",
280 ],
281}
282
283java_library {
284 name: "core-libart-testdex",
Colin Cross5b75cdd2018-06-27 11:00:13 -0700285 installable: true,
Colin Cross3c6c2e22017-10-18 13:24:52 -0700286 static_libs: ["core-libart"],
287 no_standard_libs: true,
288 libs: ["core-all"],
289 system_modules: "core-all-system-modules",
290 dxflags: ["--core-library"],
Colin Cross485ed362017-12-05 17:24:22 -0800291 dex_preopt: {
292 enabled: false,
293 },
Colin Cross3c6c2e22017-10-18 13:24:52 -0700294 notice: "ojluni/NOTICE",
295 required: [
296 "tzdata",
297 "tzlookup.xml",
298 ],
299}
300
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100301// Creates a jar that exists to satisfy javac when compiling source code that
302// contains lambdas.
Colin Crossaf0b54c2017-09-27 17:22:32 -0700303java_library {
304 name: "core-lambda-stubs",
305 defaults: ["libcore_java_defaults"],
Neil Fuller4207c7f2018-10-10 14:01:40 +0100306 hostdex: true,
Colin Crossaf0b54c2017-09-27 17:22:32 -0700307
308 srcs: [
309 ":openjdk_lambda_stub_files",
310 ":openjdk_lambda_duplicate_stub_files",
311 ],
312
Colin Crossec80f4f2018-08-15 21:17:11 -0700313 no_standard_libs: true,
Colin Crossaf0b54c2017-09-27 17:22:32 -0700314 libs: ["core-all"],
Colin Crossa4d9fc42017-09-29 18:04:37 -0700315 system_modules: "core-all-system-modules",
316 openjdk9: {
317 javacflags: ["--patch-module=java.base=."],
318 },
Colin Crossaf0b54c2017-09-27 17:22:32 -0700319
320 notice: "ojluni/NOTICE",
321
322 installable: false,
323 include_srcs: true,
324}
Colin Crossa4d9fc42017-09-29 18:04:37 -0700325
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100326// A system modules definition containing the implementations for the various
327// parts that make up the core library.
328//
329// This system module is intended for use by tests that may need access to
330// core library internals. It should not be generally used; most of the
331// platform build should build against API stubs instead. See
332// "core-platform-api-stubs-system-modules", which is the default used by the
333// Android build.
334//
335// This module also includes lambda stubs for compiling source containing
336// Java lambdas.
Colin Crossa4d9fc42017-09-29 18:04:37 -0700337java_system_modules {
338 name: "core-system-modules",
339 libs: [
340 "core-oj",
341 "core-libart",
Neil Fuller866ed4a2018-09-06 12:05:46 +0100342 "core-simple",
Neil Fullerb669ccb2018-10-04 23:10:27 +0100343 "bouncycastle",
344 "conscrypt",
345 "okhttp",
Neil Fuller05723a52018-10-19 10:55:05 +0100346 "apache-xml",
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100347 // This one is not on device but it's needed when javac compiles code
348 // containing lambdas.
349 "core-lambda-stubs",
Colin Crossa4d9fc42017-09-29 18:04:37 -0700350 ],
351}
Colin Cross3c6c2e22017-10-18 13:24:52 -0700352
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100353// Builds libcore test rules
Colin Cross3c6c2e22017-10-18 13:24:52 -0700354java_library_static {
355 name: "core-test-rules",
356 hostdex: true,
Colin Cross3c6c2e22017-10-18 13:24:52 -0700357 srcs: [
358 "dalvik/test-rules/src/main/**/*.java",
359 "test-rules/src/main/**/*.java",
360 ],
361 static_libs: ["junit"],
Neil Fuller4207c7f2018-10-10 14:01:40 +0100362
363 no_standard_libs: true,
364 libs: ["core-all"],
365 system_modules: "core-all-system-modules",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700366}
367
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100368// Builds the core-tests-support library used by various tests.
Colin Cross3c6c2e22017-10-18 13:24:52 -0700369java_library_static {
370 name: "core-tests-support",
371 hostdex: true,
Colin Cross3c6c2e22017-10-18 13:24:52 -0700372 srcs: ["support/src/test/java/**/*.java"],
Neil Fuller4207c7f2018-10-10 14:01:40 +0100373
Neil Fullerde8b0862018-10-12 21:53:31 +0100374 sdk_version: "core_platform_current",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700375 libs: [
376 "junit",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700377 ],
378 static_libs: [
Neil Fullerde8b0862018-10-12 21:53:31 +0100379 "bouncycastle-unbundled",
380 "bouncycastle-bcpkix-unbundled",
381 "bouncycastle-ocsp-unbundled",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700382 ],
383}
384
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100385// Builds the jsr166-tests library.
Colin Crossec80f4f2018-08-15 21:17:11 -0700386java_test {
Colin Cross3c6c2e22017-10-18 13:24:52 -0700387 name: "jsr166-tests",
388 srcs: ["jsr166-tests/src/test/java/**/*.java"],
Neil Fuller4207c7f2018-10-10 14:01:40 +0100389 no_standard_libs: true,
Colin Cross3c6c2e22017-10-18 13:24:52 -0700390 libs: [
Neil Fuller4207c7f2018-10-10 14:01:40 +0100391 "core-all",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700392 "junit",
393 ],
Neil Fuller4207c7f2018-10-10 14:01:40 +0100394 system_modules: "core-all-system-modules",
Colin Cross3c6c2e22017-10-18 13:24:52 -0700395}
Nan Zhang65f27a32018-01-05 10:41:46 -0800396
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100397// Builds a library just containing files from luni/src/test/filesystems
398// for use in tests.
Colin Crossec80f4f2018-08-15 21:17:11 -0700399java_library {
400 name: "filesystemstest",
401 compile_dex: true,
402 srcs: ["luni/src/test/filesystems/src/**/*.java"],
403 java_resource_dirs: ["luni/src/test/filesystems/resources"],
404 no_framework_libs: true,
405 errorprone: {
406 javacflags: ["-Xep:MissingOverride:OFF"],
407 },
408}
409
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100410// Builds a library just containing files from luni/src/test/parameter_metadata
411// for use in tests.
Colin Crossec80f4f2018-08-15 21:17:11 -0700412java_library {
413 name: "parameter-metadata-test",
414 compile_dex: true,
415 srcs: ["luni/src/test/parameter_metadata/src/**/*.java"],
416 no_framework_libs: true,
417 javacflags: ["-parameters"],
418 errorprone: {
419 javacflags: ["-Xep:MissingOverride:OFF"],
420 },
421}
422
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100423// Builds the core-tests library.
Colin Crossec80f4f2018-08-15 21:17:11 -0700424java_test {
425 name: "core-tests",
426 defaults: ["libcore_java_defaults"],
427 hostdex: true,
428 srcs: [
429 "dalvik/src/test/java/**/*.java",
430 "dalvik/test-rules/src/test/java/**/*.java",
431 "dom/src/test/java/**/*.java",
432 "harmony-tests/src/test/java/**/*.java",
433 "json/src/test/java/**/*.java",
434 "luni/src/test/java/**/*.java",
435 "xml/src/test/java/**/*.java",
436 ],
437 exclude_srcs: [
438 "luni/src/test/java/libcore/java/util/zip/Zip64Test.java",
439 "luni/src/test/java/libcore/java/util/zip/Zip64FileTest.java",
440 ],
441
442 java_resource_dirs: [
443 "*/src/test/java",
444 "*/src/test/resources",
445 ],
446 exclude_java_resource_dirs: [
447 "ojluni/src/test/java",
448 "ojluni/src/test/resources",
449 ],
450
451 java_resources: [
452 ":filesystemstest",
453 ":parameter-metadata-test",
454 ],
455
Neil Fuller4207c7f2018-10-10 14:01:40 +0100456 no_standard_libs: true,
457 libs: [
458 "core-all",
459 "okhttp",
460 "bouncycastle",
461 ],
462 system_modules: "core-all-system-modules",
463
Colin Crossec80f4f2018-08-15 21:17:11 -0700464 static_libs: [
465 "archive-patcher",
466 "core-test-rules",
467 "core-tests-support",
468 "junit-params",
469 "mockftpserver",
470 "mockito-target",
471 "mockwebserver",
472 "nist-pkix-tests",
473 "slf4j-jdk14",
474 "sqlite-jdbc",
475 "tzdata-testing",
476 ],
477
478 errorprone: {
479 javacflags: [
480 "-Xep:TryFailThrowable:ERROR",
481 "-Xep:ComparisonOutOfRange:ERROR",
482 ],
483 },
Simran Basi3be01e02018-08-21 17:53:49 -0700484
485 test_config: "AndroidTest-core-tests.xml",
Colin Crossec80f4f2018-08-15 21:17:11 -0700486}
487
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100488// Builds the core-ojtests library that contains test code from OpenJDK.
Colin Crossec80f4f2018-08-15 21:17:11 -0700489java_test {
490 name: "core-ojtests",
491 defaults: ["libcore_java_defaults"],
492 hostdex: true,
493
494 srcs: [
495 "ojluni/src/test/java/**/*.java",
496 ],
497 java_resource_dirs: [
498 "ojluni/src/test/java",
499 "ojluni/src/test/resources",
500 ],
Neil Fullerb669ccb2018-10-04 23:10:27 +0100501
Neil Fuller4207c7f2018-10-10 14:01:40 +0100502 no_standard_libs: true,
503 libs: [
504 "core-all",
505 "okhttp",
506 "bouncycastle",
507 ],
508 system_modules: "core-all-system-modules",
509
Colin Crossec80f4f2018-08-15 21:17:11 -0700510 static_libs: ["testng"],
511
512 // ojluni/src/test/java/util/stream/{bootlib,boottest}
513 // contains tests that are in packages from java.base;
514 // By default, OpenJDK 9's javac will only compile such
515 // code if it's declared to also be in java.base at
516 // compile time.
517 //
518 // For now, we use --patch-module to put all sources
519 // and dependencies from this make target into java.base;
520 // other source directories in this make target are in
521 // packages not from java.base; if this becomes a problem
522 // in future, this could be addressed eg. by splitting
523 // boot{lib,test} out into a separate make target,
524 // deleting those tests or moving them to a different
525 // package.
526 patch_module: "java.base",
527}
528
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100529// Builds the core-ojtests-public library. Excludes any private API tests.
530// Like core-ojtests but smaller.
Colin Crossec80f4f2018-08-15 21:17:11 -0700531java_test {
532 name: "core-ojtests-public",
533 defaults: ["libcore_java_defaults"],
534 srcs: [
535 "ojluni/src/test/java/**/*.java",
536 ],
537 // Filter out the following:
538 // 1.) DeserializeMethodTest and SerializedLambdaTest, because they depends on stub classes
539 // and won't actually run, and
540 // 2.) util/stream/boot*. Those directories contain classes in the package java.util.stream;
541 // excluding them means we don't need patch_module: "java.base"
542 exclude_srcs: [
543 "**/DeserializeMethodTest.java",
544 "**/SerializedLambdaTest.java",
545 "ojluni/src/test/java/util/stream/boot*/**/*",
546 ],
547 java_resource_dirs: [
548 "ojluni/src/test/java",
549 "ojluni/src/test/resources",
550 // Include source code as part of JAR
551 "ojluni/src/test/dist",
552 ],
Neil Fuller4207c7f2018-10-10 14:01:40 +0100553
554 no_standard_libs: true,
555 libs: [
556 "core-all",
557 "bouncycastle",
558 "okhttp",
559 "testng",
560 ],
561 system_modules: "core-all-system-modules",
Colin Crossec80f4f2018-08-15 21:17:11 -0700562}
563
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100564// Exports annotated stubs source files in ojluni/annotations/sdk to make them
565// available to metalava. Used for nullability annotations in OpenJDK source.
Pete Gillin7db7faa2018-07-31 13:29:35 +0100566droiddoc_exported_dir {
Pete Gillin0728b742018-09-17 15:41:45 +0100567 name: "ojluni-annotated-sdk-stubs",
568 path: "ojluni/annotations/sdk",
Pete Gillin7db7faa2018-07-31 13:29:35 +0100569}
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100570
571// Exports annotated stubs source files in ojluni/annotations/mmodules to make
572// them available to metalava. Used for core platform API and intra-code API
573// annotations in OpenJDK source.
Pete Gillinc9935b62018-09-25 14:42:40 +0100574droiddoc_exported_dir {
575 name: "ojluni-annotated-mmodule-stubs",
576 path: "ojluni/annotations/mmodule",
577}
Pete Gillin7db7faa2018-07-31 13:29:35 +0100578
Neil Fuller6f16b462018-09-04 15:40:39 +0100579// A file containing the list of tags that are "known" to us from the OpenJdk
580// source code and so should not cause an error or warning.
Nan Zhangd55722b2018-02-27 15:08:20 -0800581filegroup {
582 name: "known-oj-tags",
583 srcs: [
584 "known_oj_tags.txt",
585 ],
586}
Nan Zhang602fc0e2018-03-22 16:14:22 -0700587
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100588// Generates stubs for the parts of the public SDK API provided by the core
589// library.
Nan Zhangf0207602018-09-10 18:57:38 -0700590droidstubs {
591 name: "core-current-stubs-gen",
Neil Fuller866ed4a2018-09-06 12:05:46 +0100592 srcs: [":core_api_files"],
Nan Zhang602fc0e2018-03-22 16:14:22 -0700593 installable: false,
594 no_framework_libs: true,
Neil Fullerbe9258e2018-09-24 17:11:27 +0100595 args: " --exclude-annotations "
596 + "--hide-annotation libcore.api.Hide",
597 merge_inclusion_annotations_dirs: ["ojluni-annotated-mmodule-stubs"],
Nan Zhang602fc0e2018-03-22 16:14:22 -0700598}
599
Neil Fuller77e3f3b2018-10-19 10:22:32 +0100600// A stubs target containing the parts of the public SDK API provided by the
601// core library.
602//
Neil Fullera6ba3592018-09-21 13:19:37 +0100603// Don't use this directly, use "sdk_version: core_current".
604java_library {
Nan Zhang602fc0e2018-03-22 16:14:22 -0700605 name: "core.current.stubs",
Nan Zhangf0207602018-09-10 18:57:38 -0700606 srcs: [":core-current-stubs-gen"],
Nan Zhang602fc0e2018-03-22 16:14:22 -0700607 errorprone: {
608 javacflags: [
609 "-Xep:MissingOverride:OFF",
610 ],
611 },
Tobias Thierer496a9382018-06-12 14:09:11 +0100612 openjdk9: {
613 javacflags: ["--patch-module=java.base=."],
614 },
Nan Zhang602fc0e2018-03-22 16:14:22 -0700615 no_standard_libs: true,
616 system_modules: "none",
617}