Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 1 | // 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 Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 16 | // Definitions for building the Android core library and associated tests. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 17 | // |
| 18 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 19 | // 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 Duffin | fb46f73 | 2019-09-25 16:04:21 +0100 | [diff] [blame^] | 22 | // directories. |
| 23 | // |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 24 | // 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 Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 27 | // |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 28 | // The structure of these is generally: |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 29 | // |
| 30 | // src/ |
| 31 | // main/ # To be shipped on every device. |
| 32 | // java/ # Java source for library code. |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 33 | // native/ # C/C++ source for library code. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 34 | // resources/ # Support files. |
| 35 | // test/ # Built only on demand, for testing. |
| 36 | // java/ # Java source for tests. |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 37 | // native/ # C/C++ source for tests (rare). |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 38 | // resources/ # Support files. |
| 39 | // |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 40 | // All subdirectories are optional. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 41 | |
| 42 | build = [ |
| 43 | "openjdk_java_files.bp", |
| 44 | "non_openjdk_java_files.bp", |
| 45 | ] |
| 46 | |
| 47 | // The Java files and their associated resources. |
Tobias Thierer | 79eea26 | 2019-08-01 14:05:11 +0100 | [diff] [blame] | 48 | filegroup { |
| 49 | name: "core-luni-resources", |
| 50 | visibility: [ |
| 51 | "//libcore:__subpackages__", |
| 52 | ], |
| 53 | path: "luni/src/main/java/", |
| 54 | srcs: [ |
Tobias Thierer | aef55ca | 2019-08-28 22:41:57 +0000 | [diff] [blame] | 55 | "luni/src/main/java/libcore/net/android.mime.types", |
Tobias Thierer | 79eea26 | 2019-08-01 14:05:11 +0100 | [diff] [blame] | 56 | "luni/src/main/java/java/util/logging/logging.properties", |
| 57 | "luni/src/main/java/java/security/security.properties", |
| 58 | ], |
| 59 | } |
| 60 | |
| 61 | filegroup { |
| 62 | name: "core-ojluni-resources", |
| 63 | visibility: [ |
| 64 | "//libcore:__subpackages__", |
| 65 | ], |
| 66 | path: "ojluni/src/main/resources/", |
| 67 | srcs: [ |
| 68 | "ojluni/src/main/resources/**/*", |
| 69 | ], |
| 70 | } |
| 71 | |
| 72 | core_resources = [ |
| 73 | ":core-luni-resources", |
| 74 | ":core-ojluni-resources", |
Tobias Thierer | aef55ca | 2019-08-28 22:41:57 +0000 | [diff] [blame] | 75 | ":debian.mime.types", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 76 | ] |
| 77 | |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 78 | // The source files that go into core-oj. |
| 79 | filegroup { |
| 80 | name: "core_oj_java_files", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 81 | visibility: [ |
| 82 | "//libcore:__subpackages__", |
| 83 | ], |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 84 | srcs: [":openjdk_java_files"], |
| 85 | } |
| 86 | |
Neil Fuller | e32e2e1 | 2019-02-26 11:48:30 +0000 | [diff] [blame] | 87 | // OpenJDK source is not annotated with @hide so we need this separate |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 88 | // filegroup for just the parts that contribute to the API. |
| 89 | filegroup { |
| 90 | name: "core_oj_api_files", |
| 91 | srcs: [":openjdk_javadoc_files"], |
| 92 | } |
| 93 | |
| 94 | // The source files that go into core-libart. |
| 95 | filegroup { |
| 96 | name: "core_libart_java_files", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 97 | visibility: [ |
| 98 | "//libcore:__subpackages__", |
| 99 | ], |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 100 | srcs: [ |
| 101 | ":non_openjdk_java_files", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 102 | ], |
| 103 | } |
| 104 | |
Neil Fuller | e32e2e1 | 2019-02-26 11:48:30 +0000 | [diff] [blame] | 105 | // Some parts of libart are not annotated with @hide so we need this separate |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 106 | // filegroup for just the parts that contribute to the API. |
| 107 | filegroup { |
| 108 | name: "core_libart_api_files", |
| 109 | srcs: [ |
| 110 | ":non_openjdk_javadoc_files", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 111 | ], |
| 112 | } |
| 113 | |
Neil Fuller | e32e2e1 | 2019-02-26 11:48:30 +0000 | [diff] [blame] | 114 | // The set of files for the core library that have been marked up with @hide |
| 115 | // for the public SDK APIs. Used from frameworks/base/ to indicate the source |
| 116 | // files for inclusion in the public SDK docs. |
| 117 | filegroup { |
| 118 | name: "core_public_api_files", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 119 | visibility: [ |
| 120 | "//frameworks/base", |
| 121 | ], |
Neil Fuller | e32e2e1 | 2019-02-26 11:48:30 +0000 | [diff] [blame] | 122 | srcs: [ |
Victor Chang | cad47af | 2019-08-06 16:33:38 +0100 | [diff] [blame] | 123 | ":android_icu4j_src_files", |
Neil Fuller | e32e2e1 | 2019-02-26 11:48:30 +0000 | [diff] [blame] | 124 | ":core_oj_api_files", |
| 125 | ":core_libart_api_files", |
| 126 | ":conscrypt_public_api_files", |
| 127 | ], |
| 128 | } |
| 129 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 130 | // The set of files for the core library that have been marked up with @hide and |
| 131 | // API-related annotations. Note that this includes the intra-core and |
| 132 | // core-platform APIs as well as the public APIs. |
| 133 | // |
Neil Fuller | e32e2e1 | 2019-02-26 11:48:30 +0000 | [diff] [blame] | 134 | // Some source files in :core_oj_api_files and :openjdk_mmodule_extra_files are |
| 135 | // annotated by applying annotations to the .annotated.java stubs files in |
| 136 | // ojluni/annotated/mmodules and rather than in the original source. See the comments |
| 137 | // in openjdk_java_files.bp for more details. |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 138 | filegroup { |
| 139 | name: "core_api_files", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 140 | visibility: [ |
| 141 | "//libcore:__subpackages__", |
| 142 | ], |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 143 | srcs: [ |
Victor Chang | cad47af | 2019-08-06 16:33:38 +0100 | [diff] [blame] | 144 | ":android_icu4j_src_files", |
Neil Fuller | d129bc9 | 2018-09-26 11:12:58 +0100 | [diff] [blame] | 145 | ":apache-xml_api_files", |
Neil Fuller | a77f710 | 2018-09-21 19:04:41 +0100 | [diff] [blame] | 146 | ":bouncycastle_java_files", |
Neil Fuller | 603e1a7 | 2018-09-25 11:55:41 +0100 | [diff] [blame] | 147 | ":conscrypt_java_files", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 148 | ":core_oj_api_files", |
| 149 | ":core_libart_api_files", |
Neil Fuller | 641d5f9 | 2018-09-24 15:40:39 +0100 | [diff] [blame] | 150 | ":okhttp_api_files", |
Pete Gillin | c9935b6 | 2018-09-25 14:42:40 +0100 | [diff] [blame] | 151 | ":openjdk_mmodule_extra_files", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 152 | ], |
| 153 | } |
| 154 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 155 | java_defaults { |
| 156 | name: "libcore_java_defaults", |
| 157 | javacflags: [ |
| 158 | //"-Xlint:all", |
| 159 | //"-Xlint:-serial,-deprecation,-unchecked", |
| 160 | ], |
| 161 | dxflags: ["--core-library"], |
Andreas Gampe | 66b3173 | 2018-02-20 09:22:16 -0800 | [diff] [blame] | 162 | errorprone: { |
| 163 | javacflags: [ |
Paul Duffin | c31f6bb | 2019-05-15 12:32:44 +0100 | [diff] [blame] | 164 | "-Xep:MissingOverride:OFF", // Ignore missing @Override. |
| 165 | "-Xep:ConstantOverflow:WARN", // Known constant overflow in SplittableRandom |
Andreas Gampe | 66b3173 | 2018-02-20 09:22:16 -0800 | [diff] [blame] | 166 | ], |
| 167 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 168 | } |
| 169 | |
| 170 | // |
| 171 | // Build for the target (device). |
| 172 | // |
| 173 | |
Tobias Thierer | cf66bfd | 2019-05-29 13:18:25 +0100 | [diff] [blame] | 174 | // Visibility of core-all* build modules; we restrict visibility of core-all deliberately to |
| 175 | // a small set of build modules that the core library team control. See core-all-system-modules |
| 176 | // for more details. |
| 177 | core_all_visibility = [ |
| 178 | "//external/apache-harmony:__subpackages__", |
| 179 | "//external/apache-xml", |
| 180 | "//external/bouncycastle", |
| 181 | "//external/conscrypt", |
| 182 | "//external/icu/android_icu4j", |
| 183 | "//external/okhttp", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 184 | "//libcore:__subpackages__", |
Tobias Thierer | cf66bfd | 2019-05-29 13:18:25 +0100 | [diff] [blame] | 185 | ] |
| 186 | |
Tobias Thierer | 5233164 | 2019-05-29 12:11:39 +0000 | [diff] [blame] | 187 | // A target used to bootstrap compilation for the core library. |
| 188 | // See core-all-system-modules for more details. |
| 189 | java_library { |
| 190 | name: "core-all", |
Tobias Thierer | cf66bfd | 2019-05-29 13:18:25 +0100 | [diff] [blame] | 191 | visibility: core_all_visibility, |
Tobias Thierer | 5233164 | 2019-05-29 12:11:39 +0000 | [diff] [blame] | 192 | defaults: ["libcore_java_defaults"], |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 193 | |
| 194 | srcs: [ |
Victor Chang | cad47af | 2019-08-06 16:33:38 +0100 | [diff] [blame] | 195 | ":android_icu4j_src_files", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 196 | ":core_oj_java_files", |
| 197 | ":core_libart_java_files", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 198 | ":openjdk_lambda_stub_files", |
Pete Gillin | 5403581 | 2019-05-08 15:09:39 +0100 | [diff] [blame] | 199 | ":openjdk_generated_annotation_stub_files", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 200 | ], |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 201 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 202 | sdk_version: "none", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 203 | system_modules: "none", |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 204 | openjdk9: { |
| 205 | srcs: ["luni/src/module/java/module-info.java"], |
| 206 | javacflags: ["--patch-module=java.base=."], |
| 207 | }, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 208 | |
Tobias Thierer | 79eea26 | 2019-08-01 14:05:11 +0100 | [diff] [blame] | 209 | java_resources: core_resources, |
Victor Chang | 7fef405 | 2018-09-25 14:12:03 +0100 | [diff] [blame] | 210 | static_libs: ["android_icu4j_resources_lib"], |
Tobias Thierer | de99123 | 2018-03-07 15:10:46 +0000 | [diff] [blame] | 211 | java_version: "1.9", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 212 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 213 | installable: false, |
atrost | 98ec08d | 2019-08-05 12:23:41 +0100 | [diff] [blame] | 214 | |
| 215 | plugins: ["compat-changeid-annotation-processor"], |
| 216 | } |
| 217 | |
| 218 | platform_compat_config { |
| 219 | name: "libcore-platform-compat-config", |
atrost | 98ec08d | 2019-08-05 12:23:41 +0100 | [diff] [blame] | 220 | src: ":core-all", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 221 | } |
| 222 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 223 | // A system modules definition for use by core library targets only. It only |
| 224 | // contains the core-all jar, which contains the classes that end up in core-oj, |
| 225 | // core-libart as well as the lambda stubs needed to compile Java lambda code. |
| 226 | // It does not contain other parts of core library like conscrypt, bouncycastle, |
| 227 | // etc. This system_modules definition is used to bootstrap compilation for |
Victor Chang | cad47af | 2019-08-06 16:33:38 +0100 | [diff] [blame] | 228 | // other parts of the core library like core-oj, core-libart, core-icu4j, conscrypt, |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 229 | // bouncycastle, etc. |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 230 | java_system_modules { |
| 231 | name: "core-all-system-modules", |
Tobias Thierer | cf66bfd | 2019-05-29 13:18:25 +0100 | [diff] [blame] | 232 | visibility: core_all_visibility, |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 233 | libs: ["core-all"], |
| 234 | } |
| 235 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 236 | // Contains the parts of core library associated with OpenJDK. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 237 | java_library { |
| 238 | name: "core-oj", |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 239 | visibility: [ |
| 240 | "//art/build/apex", |
| 241 | "//external/wycheproof", |
Paul Duffin | 94f7023 | 2019-05-22 16:22:29 +0100 | [diff] [blame] | 242 | "//libcore/benchmarks", |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 243 | ], |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 244 | defaults: ["libcore_java_defaults"], |
Colin Cross | 5b75cdd | 2018-06-27 11:00:13 -0700 | [diff] [blame] | 245 | installable: true, |
Colin Cross | bb180be | 2017-10-09 14:54:53 -0700 | [diff] [blame] | 246 | hostdex: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 247 | |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 248 | srcs: [":core_oj_java_files"], |
Tobias Thierer | 79eea26 | 2019-08-01 14:05:11 +0100 | [diff] [blame] | 249 | java_resources: core_resources, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 250 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 251 | sdk_version: "none", |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 252 | system_modules: "core-all-system-modules", |
| 253 | openjdk9: { |
| 254 | javacflags: ["--patch-module=java.base=."], |
| 255 | }, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 256 | |
Pete Gillin | 7a7a6d2 | 2017-12-19 14:56:03 +0000 | [diff] [blame] | 257 | jacoco: { |
Pete Gillin | 27ca058 | 2018-01-10 17:04:17 +0000 | [diff] [blame] | 258 | exclude_filter: [ |
Pete Gillin | 3f59bad | 2018-01-30 11:20:29 +0000 | [diff] [blame] | 259 | "java.lang.Class", |
| 260 | "java.lang.Long", |
| 261 | "java.lang.Number", |
| 262 | "java.lang.Object", |
| 263 | "java.lang.String", |
| 264 | "java.lang.invoke.MethodHandle", |
| 265 | "java.lang.ref.Reference", |
| 266 | "java.lang.reflect.Proxy", |
Pete Gillin | b1868ada | 2018-01-17 11:03:10 +0000 | [diff] [blame] | 267 | "java.util.AbstractMap", |
Pete Gillin | 3f59bad | 2018-01-30 11:20:29 +0000 | [diff] [blame] | 268 | "java.util.HashMap", |
| 269 | "java.util.HashMap$Node", |
Pete Gillin | b1868ada | 2018-01-17 11:03:10 +0000 | [diff] [blame] | 270 | "java.util.Map", |
Pete Gillin | 7a7a6d2 | 2017-12-19 14:56:03 +0000 | [diff] [blame] | 271 | ], |
| 272 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 273 | |
| 274 | notice: "ojluni/NOTICE", |
| 275 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 276 | } |
| 277 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 278 | // Contains parts of core library not associated with OpenJDK. Contains not |
Victor Chang | cad47af | 2019-08-06 16:33:38 +0100 | [diff] [blame] | 279 | // just java.*, javax.* code but also android.system.* and various internal |
| 280 | // libcore.* packages. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 281 | java_library { |
| 282 | name: "core-libart", |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 283 | visibility: [ |
| 284 | "//art/build/apex", |
| 285 | "//external/robolectric-shadows", |
| 286 | "//external/wycheproof", |
Paul Duffin | 94f7023 | 2019-05-22 16:22:29 +0100 | [diff] [blame] | 287 | "//libcore/benchmarks", |
Colin Cross | f0ef625 | 2019-05-31 08:26:47 -0700 | [diff] [blame] | 288 | "//frameworks/layoutlib", |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 289 | ], |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 290 | defaults: ["libcore_java_defaults"], |
Colin Cross | 5b75cdd | 2018-06-27 11:00:13 -0700 | [diff] [blame] | 291 | installable: true, |
Colin Cross | bb180be | 2017-10-09 14:54:53 -0700 | [diff] [blame] | 292 | hostdex: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 293 | |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 294 | srcs: [":core_libart_java_files"], |
Tobias Thierer | de99123 | 2018-03-07 15:10:46 +0000 | [diff] [blame] | 295 | java_version: "1.9", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 296 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 297 | sdk_version: "none", |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 298 | system_modules: "core-all-system-modules", |
| 299 | openjdk9: { |
| 300 | javacflags: ["--patch-module=java.base=."], |
| 301 | }, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 302 | |
Pete Gillin | 80ebe87 | 2018-02-13 15:21:20 +0000 | [diff] [blame] | 303 | jacoco: { |
| 304 | exclude_filter: [ |
| 305 | "java.lang.DexCache", |
| 306 | "dalvik.system.ClassExt", |
| 307 | ], |
| 308 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 309 | |
Andreas Gampe | 9a1ba89 | 2019-04-24 12:35:40 -0700 | [diff] [blame] | 310 | target: { |
| 311 | hostdex: { |
| 312 | required: [ |
Neil Fuller | 53c5f03 | 2019-06-05 13:47:39 +0100 | [diff] [blame] | 313 | // Files used to simulate the /system, runtime APEX and tzdata |
| 314 | // APEX dir structure on host. |
| 315 | "icu_tzdata.dat_host_tzdata_apex", |
Andreas Gampe | 9a1ba89 | 2019-04-24 12:35:40 -0700 | [diff] [blame] | 316 | "tzdata_host", |
Neil Fuller | 53c5f03 | 2019-06-05 13:47:39 +0100 | [diff] [blame] | 317 | "tzdata_host_tzdata_apex", |
Neil Fuller | 53c5f03 | 2019-06-05 13:47:39 +0100 | [diff] [blame] | 318 | "tzlookup.xml_host_tzdata_apex", |
Andreas Gampe | 9a1ba89 | 2019-04-24 12:35:40 -0700 | [diff] [blame] | 319 | "tz_version_host", |
Neil Fuller | 53c5f03 | 2019-06-05 13:47:39 +0100 | [diff] [blame] | 320 | "tz_version_host_tzdata_apex", |
Andreas Gampe | 9a1ba89 | 2019-04-24 12:35:40 -0700 | [diff] [blame] | 321 | ], |
| 322 | }, |
| 323 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 324 | } |
| 325 | |
Victor Chang | b28d3f8 | 2019-08-09 16:24:46 +0100 | [diff] [blame] | 326 | // A separated core library that contains ICU4J because ICU4J will be in a different APEX module, |
| 327 | // not in Runtime module. |
Victor Chang | cad47af | 2019-08-06 16:33:38 +0100 | [diff] [blame] | 328 | java_library { |
| 329 | name: "core-icu4j", |
| 330 | visibility: [ |
| 331 | "//art/build/apex", |
| 332 | "//external/robolectric-shadows", |
| 333 | "//frameworks/layoutlib", |
| 334 | ], |
| 335 | defaults: ["libcore_java_defaults"], |
| 336 | installable: true, |
| 337 | hostdex: true, |
| 338 | |
| 339 | srcs: [":android_icu4j_src_files"], |
Victor Chang | b28d3f8 | 2019-08-09 16:24:46 +0100 | [diff] [blame] | 340 | libs: ["libcore-unsupportedappusage-annotation"], |
| 341 | static_libs: ["android_icu4j_resources_lib_sdk_core_current"], |
Victor Chang | cad47af | 2019-08-06 16:33:38 +0100 | [diff] [blame] | 342 | |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 343 | // We use art-module-public-api-stubs-system-modules when compiling core-icu4j as ICU4J does not |
| 344 | // use any internal or android specific code. If it ever did then it could depend on |
| 345 | // core-intra-stubs-system-modules (a superset) instead. |
| 346 | // It is important that core-icu4j is restricted to only use stable APIs from the ART module |
| 347 | // since it is in a different APEX module that can be updated independently. |
| 348 | sdk_version: "none", |
| 349 | system_modules: "art-module-public-api-stubs-system-modules", |
Victor Chang | cad47af | 2019-08-06 16:33:38 +0100 | [diff] [blame] | 350 | openjdk9: { |
| 351 | javacflags: ["--patch-module=java.base=."], |
| 352 | }, |
| 353 | } |
| 354 | |
Paul Duffin | 7bb8d23 | 2018-10-23 11:48:38 +0100 | [diff] [blame] | 355 | // Provided solely to contribute information about which hidden parts of the |
| 356 | // core-oj API are used by apps. |
Paul Duffin | c6bf27b | 2019-05-15 14:41:00 +0100 | [diff] [blame] | 357 | // |
| 358 | // The build system determines that this library provides hiddenapi information |
| 359 | // for the core-oj bootjar because its name is of the form <x>-hiddenapi, where |
| 360 | // <x> is the name of a boot jar. That triggers the generation of a flags.csv |
| 361 | // file which encapsulates information extracted from the UnsupportedAppUsage |
| 362 | // annotations in the dex. The information from that file is then encoded into |
| 363 | // the core-oj file. |
| 364 | // |
| 365 | // Usually, e.g. for core-libart, the UnsupportedAppUsage annotations are |
| 366 | // added to the source that is compiled directly into the bootjar and the build |
| 367 | // system extracts the information about UnsupportedAppUsage directly from |
| 368 | // there. |
| 369 | // |
| 370 | // This approach of having separate annotated source and a separate build |
| 371 | // target was taken for ojluni to avoid having to maintain local patches in the |
| 372 | // ojluni source for UnsupportedAppUsage annotations as that would make it more |
| 373 | // difficult to pull down changes from upstream. |
| 374 | // |
Paul Duffin | 7bb8d23 | 2018-10-23 11:48:38 +0100 | [diff] [blame] | 375 | java_library { |
| 376 | name: "core-oj-hiddenapi", |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 377 | // Do not allow this to be accessed from outside this directory. |
| 378 | visibility: ["//visibility:private"], |
Paul Duffin | 7bb8d23 | 2018-10-23 11:48:38 +0100 | [diff] [blame] | 379 | defaults: ["libcore_java_defaults"], |
| 380 | compile_dex: true, |
| 381 | |
| 382 | srcs: [":openjdk_hiddenapi_javadoc_files"], |
| 383 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 384 | sdk_version: "none", |
Paul Duffin | 7bb8d23 | 2018-10-23 11:48:38 +0100 | [diff] [blame] | 385 | system_modules: "core-all-system-modules", |
| 386 | openjdk9: { |
| 387 | javacflags: ["--patch-module=java.base=."], |
| 388 | }, |
| 389 | } |
| 390 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 391 | // |
Victor Chang | cad47af | 2019-08-06 16:33:38 +0100 | [diff] [blame] | 392 | // Guaranteed unstripped versions of core-icu4j, core-oj and core-libart. |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 393 | // |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 394 | // The build system may or may not strip the core-oj and core-libart jars, |
| 395 | // but these will not be stripped. See b/24535627. |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 396 | // |
| 397 | |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 398 | java_library { |
| 399 | name: "core-oj-testdex", |
Colin Cross | 5b75cdd | 2018-06-27 11:00:13 -0700 | [diff] [blame] | 400 | installable: true, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 401 | static_libs: ["core-oj"], |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 402 | sdk_version: "none", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 403 | system_modules: "core-all-system-modules", |
| 404 | dxflags: ["--core-library"], |
Colin Cross | 485ed36 | 2017-12-05 17:24:22 -0800 | [diff] [blame] | 405 | dex_preopt: { |
| 406 | enabled: false, |
| 407 | }, |
Tobias Thierer | de99123 | 2018-03-07 15:10:46 +0000 | [diff] [blame] | 408 | java_version: "1.9", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 409 | notice: "ojluni/NOTICE", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 410 | } |
| 411 | |
| 412 | java_library { |
| 413 | name: "core-libart-testdex", |
Colin Cross | 5b75cdd | 2018-06-27 11:00:13 -0700 | [diff] [blame] | 414 | installable: true, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 415 | static_libs: ["core-libart"], |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 416 | sdk_version: "none", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 417 | system_modules: "core-all-system-modules", |
| 418 | dxflags: ["--core-library"], |
Colin Cross | 485ed36 | 2017-12-05 17:24:22 -0800 | [diff] [blame] | 419 | dex_preopt: { |
| 420 | enabled: false, |
| 421 | }, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 422 | notice: "ojluni/NOTICE", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 423 | } |
| 424 | |
Victor Chang | cad47af | 2019-08-06 16:33:38 +0100 | [diff] [blame] | 425 | java_library { |
| 426 | name: "core-icu4j-testdex", |
| 427 | installable: true, |
| 428 | static_libs: ["core-icu4j"], |
| 429 | sdk_version: "none", |
Victor Chang | cad47af | 2019-08-06 16:33:38 +0100 | [diff] [blame] | 430 | system_modules: "core-all-system-modules", |
| 431 | dxflags: ["--core-library"], |
| 432 | dex_preopt: { |
| 433 | enabled: false, |
| 434 | }, |
| 435 | } |
| 436 | |
Tobias Thierer | e0f8b31 | 2018-10-23 23:12:30 +0100 | [diff] [blame] | 437 | java_defaults { |
| 438 | name: "core_lambda_stubs_defaults", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 439 | defaults: ["libcore_java_defaults"], |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 440 | hostdex: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 441 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 442 | sdk_version: "none", |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 443 | system_modules: "core-all-system-modules", |
| 444 | openjdk9: { |
| 445 | javacflags: ["--patch-module=java.base=."], |
| 446 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 447 | |
| 448 | notice: "ojluni/NOTICE", |
| 449 | |
| 450 | installable: false, |
| 451 | include_srcs: true, |
| 452 | } |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 453 | |
Tobias Thierer | e0f8b31 | 2018-10-23 23:12:30 +0100 | [diff] [blame] | 454 | // Creates a jar that exists to satisfy javac when compiling source code that |
| 455 | // contains lambdas. This contains all classes / methods required by javac |
| 456 | // when generating invoke-dynamic lambda implementation code, even those that |
| 457 | // are also in the public SDK API from API level 26 onwards. |
| 458 | java_library { |
| 459 | name: "core-lambda-stubs", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 460 | visibility: ["//visibility:public"], |
Tobias Thierer | e0f8b31 | 2018-10-23 23:12:30 +0100 | [diff] [blame] | 461 | defaults: ["core_lambda_stubs_defaults"], |
| 462 | srcs: [ |
| 463 | ":openjdk_lambda_stub_files", |
| 464 | ":openjdk_lambda_duplicate_stub_files", |
| 465 | ], |
| 466 | } |
| 467 | |
| 468 | // An alternative to core-lambda-stubs that omits openjdk_lambda_duplicate_stub_files |
| 469 | // because those classes are also part of the core library public SDK API |
| 470 | // (since API level 26). |
| 471 | java_library { |
| 472 | name: "core-lambda-stubs-for-system-modules", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 473 | visibility: [ |
| 474 | "//libcore/mmodules/core_platform_api", |
| 475 | ], |
Tobias Thierer | e0f8b31 | 2018-10-23 23:12:30 +0100 | [diff] [blame] | 476 | defaults: ["core_lambda_stubs_defaults"], |
| 477 | srcs: [ |
| 478 | ":openjdk_lambda_stub_files", |
| 479 | ], |
| 480 | } |
| 481 | |
Pete Gillin | 5403581 | 2019-05-08 15:09:39 +0100 | [diff] [blame] | 482 | // Creates a jar that exists to satisfy javac when compiling source code that |
| 483 | // contains @Generated annotations, which are produced by some code generation |
| 484 | // tools (notably dagger) but aren't part of the Android API. |
| 485 | // See http://b/123891440. |
| 486 | java_library { |
| 487 | name: "core-generated-annotation-stubs", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 488 | visibility: [ |
| 489 | "//libcore/mmodules/core_platform_api", |
| 490 | ], |
Pete Gillin | 5403581 | 2019-05-08 15:09:39 +0100 | [diff] [blame] | 491 | defaults: ["libcore_java_defaults"], |
| 492 | srcs: [ |
| 493 | ":openjdk_generated_annotation_stub_files", |
| 494 | ], |
| 495 | hostdex: true, |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 496 | sdk_version: "none", |
Pete Gillin | 5403581 | 2019-05-08 15:09:39 +0100 | [diff] [blame] | 497 | system_modules: "core-all-system-modules", |
| 498 | openjdk9: { |
| 499 | javacflags: ["--patch-module=java.base=."], |
| 500 | }, |
| 501 | notice: "ojluni/NOTICE", |
| 502 | installable: false, |
| 503 | include_srcs: true, |
| 504 | } |
| 505 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 506 | // Builds libcore test rules |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 507 | java_library_static { |
| 508 | name: "core-test-rules", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 509 | visibility: [ |
Paul Duffin | 01f6c02 | 2019-09-24 14:44:15 +0100 | [diff] [blame] | 510 | "//external/conscrypt", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 511 | "//frameworks/base/location/tests/locationtests", |
| 512 | ], |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 513 | hostdex: true, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 514 | srcs: [ |
| 515 | "dalvik/test-rules/src/main/**/*.java", |
| 516 | "test-rules/src/main/**/*.java", |
| 517 | ], |
| 518 | static_libs: ["junit"], |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 519 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 520 | sdk_version: "none", |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 521 | system_modules: "core-all-system-modules", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 522 | } |
| 523 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 524 | // Builds the core-tests-support library used by various tests. |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 525 | java_library_static { |
| 526 | name: "core-tests-support", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 527 | visibility: [ |
| 528 | "//cts/apps/CtsVerifier", |
| 529 | "//cts/tests/tests/keystore", |
| 530 | "//cts/tests/tests/net", |
| 531 | "//cts/tests/tests/net/api23Test", |
| 532 | "//external/apache-harmony", |
| 533 | "//frameworks/base/core/tests/coretests", |
| 534 | "//libcore/benchmarks", |
| 535 | "//packages/apps/KeyChain/tests", |
| 536 | "//system/timezone/distro/core", |
| 537 | ], |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 538 | hostdex: true, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 539 | srcs: ["support/src/test/java/**/*.java"], |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 540 | |
Paul Duffin | 53c491f | 2019-06-12 13:48:14 +0100 | [diff] [blame] | 541 | sdk_version: "core_platform", |
Neil Fuller | 4380ab2 | 2018-10-18 19:38:53 +0100 | [diff] [blame] | 542 | libs: ["junit"], |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 543 | static_libs: [ |
Neil Fuller | de8b086 | 2018-10-12 21:53:31 +0100 | [diff] [blame] | 544 | "bouncycastle-unbundled", |
| 545 | "bouncycastle-bcpkix-unbundled", |
| 546 | "bouncycastle-ocsp-unbundled", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 547 | ], |
| 548 | } |
| 549 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 550 | // Builds the jsr166-tests library. |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 551 | java_test { |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 552 | name: "jsr166-tests", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 553 | visibility: [ |
| 554 | "//cts/tests/libcore/jsr166", |
| 555 | ], |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 556 | srcs: ["jsr166-tests/src/test/java/**/*.java"], |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 557 | sdk_version: "none", |
Paul Duffin | 0e0f8c4 | 2019-09-20 14:49:55 +0100 | [diff] [blame] | 558 | system_modules: "core-all-system-modules", |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 559 | libs: [ |
| 560 | "junit", |
| 561 | ], |
| 562 | } |
Nan Zhang | 65f27a3 | 2018-01-05 10:41:46 -0800 | [diff] [blame] | 563 | |
Pete Gillin | ec902b8 | 2019-06-26 17:23:00 +0100 | [diff] [blame] | 564 | // A filegroup that provides access to a source file for a toolchain test that |
| 565 | // checks Java 9 language features are handled properly by JarJar. |
| 566 | filegroup { |
| 567 | name: "core-java-9-language-features-source", |
| 568 | srcs: ["luni/src/main/java/libcore/internal/Java9LanguageFeatures.java"], |
| 569 | visibility: ["//libcore/luni/src/test/java9language"], |
| 570 | } |
| 571 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 572 | // Builds the core-tests library. |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 573 | java_test { |
| 574 | name: "core-tests", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 575 | visibility: [ |
| 576 | "//cts/tests/libcore/luni", |
| 577 | ], |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 578 | defaults: ["libcore_java_defaults"], |
| 579 | hostdex: true, |
| 580 | srcs: [ |
| 581 | "dalvik/src/test/java/**/*.java", |
| 582 | "dalvik/test-rules/src/test/java/**/*.java", |
| 583 | "dom/src/test/java/**/*.java", |
| 584 | "harmony-tests/src/test/java/**/*.java", |
| 585 | "json/src/test/java/**/*.java", |
| 586 | "luni/src/test/java/**/*.java", |
Paul Duffin | 4ba1453 | 2019-03-21 10:32:41 +0000 | [diff] [blame] | 587 | "test-rules/src/test/java/**/*.java", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 588 | "xml/src/test/java/**/*.java", |
| 589 | ], |
| 590 | exclude_srcs: [ |
| 591 | "luni/src/test/java/libcore/java/util/zip/Zip64Test.java", |
| 592 | "luni/src/test/java/libcore/java/util/zip/Zip64FileTest.java", |
| 593 | ], |
| 594 | |
| 595 | java_resource_dirs: [ |
| 596 | "*/src/test/java", |
| 597 | "*/src/test/resources", |
| 598 | ], |
| 599 | exclude_java_resource_dirs: [ |
| 600 | "ojluni/src/test/java", |
| 601 | "ojluni/src/test/resources", |
| 602 | ], |
| 603 | |
| 604 | java_resources: [ |
Paul Duffin | 16a057f | 2019-05-13 12:20:55 +0100 | [diff] [blame] | 605 | ":annotations-test", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 606 | ":filesystemstest", |
| 607 | ":parameter-metadata-test", |
| 608 | ], |
| 609 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 610 | sdk_version: "none", |
Paul Duffin | 0e0f8c4 | 2019-09-20 14:49:55 +0100 | [diff] [blame] | 611 | system_modules: "core-all-system-modules", |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 612 | libs: [ |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 613 | "okhttp", |
| 614 | "bouncycastle", |
| 615 | ], |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 616 | |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 617 | static_libs: [ |
| 618 | "archive-patcher", |
Pete Gillin | 05a4320 | 2019-06-27 14:41:21 +0100 | [diff] [blame] | 619 | "core-java-9-language-tests", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 620 | "core-test-rules", |
| 621 | "core-tests-support", |
| 622 | "junit-params", |
| 623 | "mockftpserver", |
| 624 | "mockito-target", |
| 625 | "mockwebserver", |
| 626 | "nist-pkix-tests", |
| 627 | "slf4j-jdk14", |
| 628 | "sqlite-jdbc", |
| 629 | "tzdata-testing", |
Paul Duffin | a4df237 | 2018-12-10 15:48:01 +0000 | [diff] [blame] | 630 | "truth-prebuilt", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 631 | ], |
| 632 | |
| 633 | errorprone: { |
| 634 | javacflags: [ |
| 635 | "-Xep:TryFailThrowable:ERROR", |
| 636 | "-Xep:ComparisonOutOfRange:ERROR", |
| 637 | ], |
| 638 | }, |
Simran Basi | 3be01e0 | 2018-08-21 17:53:49 -0700 | [diff] [blame] | 639 | |
| 640 | test_config: "AndroidTest-core-tests.xml", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 641 | } |
| 642 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 643 | // Builds the core-ojtests library that contains test code from OpenJDK. |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 644 | java_test { |
| 645 | name: "core-ojtests", |
| 646 | defaults: ["libcore_java_defaults"], |
| 647 | hostdex: true, |
| 648 | |
| 649 | srcs: [ |
| 650 | "ojluni/src/test/java/**/*.java", |
| 651 | ], |
| 652 | java_resource_dirs: [ |
| 653 | "ojluni/src/test/java", |
| 654 | "ojluni/src/test/resources", |
| 655 | ], |
Neil Fuller | b669ccb | 2018-10-04 23:10:27 +0100 | [diff] [blame] | 656 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 657 | sdk_version: "none", |
Paul Duffin | 0e0f8c4 | 2019-09-20 14:49:55 +0100 | [diff] [blame] | 658 | system_modules: "core-all-system-modules", |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 659 | libs: [ |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 660 | "okhttp", |
| 661 | "bouncycastle", |
| 662 | ], |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 663 | |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 664 | static_libs: ["testng"], |
| 665 | |
| 666 | // ojluni/src/test/java/util/stream/{bootlib,boottest} |
| 667 | // contains tests that are in packages from java.base; |
| 668 | // By default, OpenJDK 9's javac will only compile such |
| 669 | // code if it's declared to also be in java.base at |
| 670 | // compile time. |
| 671 | // |
| 672 | // For now, we use --patch-module to put all sources |
| 673 | // and dependencies from this make target into java.base; |
| 674 | // other source directories in this make target are in |
| 675 | // packages not from java.base; if this becomes a problem |
| 676 | // in future, this could be addressed eg. by splitting |
| 677 | // boot{lib,test} out into a separate make target, |
| 678 | // deleting those tests or moving them to a different |
| 679 | // package. |
| 680 | patch_module: "java.base", |
| 681 | } |
| 682 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 683 | // Builds the core-ojtests-public library. Excludes any private API tests. |
| 684 | // Like core-ojtests but smaller. |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 685 | java_test { |
| 686 | name: "core-ojtests-public", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 687 | visibility: [ |
| 688 | "//cts/tests/libcore/ojluni", |
| 689 | ], |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 690 | defaults: ["libcore_java_defaults"], |
| 691 | srcs: [ |
| 692 | "ojluni/src/test/java/**/*.java", |
| 693 | ], |
| 694 | // Filter out the following: |
| 695 | // 1.) DeserializeMethodTest and SerializedLambdaTest, because they depends on stub classes |
| 696 | // and won't actually run, and |
| 697 | // 2.) util/stream/boot*. Those directories contain classes in the package java.util.stream; |
| 698 | // excluding them means we don't need patch_module: "java.base" |
| 699 | exclude_srcs: [ |
| 700 | "**/DeserializeMethodTest.java", |
| 701 | "**/SerializedLambdaTest.java", |
| 702 | "ojluni/src/test/java/util/stream/boot*/**/*", |
| 703 | ], |
| 704 | java_resource_dirs: [ |
| 705 | "ojluni/src/test/java", |
| 706 | "ojluni/src/test/resources", |
| 707 | // Include source code as part of JAR |
| 708 | "ojluni/src/test/dist", |
| 709 | ], |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 710 | |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 711 | sdk_version: "none", |
Paul Duffin | 0e0f8c4 | 2019-09-20 14:49:55 +0100 | [diff] [blame] | 712 | system_modules: "core-all-system-modules", |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 713 | libs: [ |
Neil Fuller | 4207c7f | 2018-10-10 14:01:40 +0100 | [diff] [blame] | 714 | "bouncycastle", |
| 715 | "okhttp", |
| 716 | "testng", |
| 717 | ], |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 718 | } |
| 719 | |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 720 | // Exports annotated stubs source files in ojluni/annotations/sdk to make them |
| 721 | // available to metalava. Used for nullability annotations in OpenJDK source. |
Pete Gillin | 7db7faa | 2018-07-31 13:29:35 +0100 | [diff] [blame] | 722 | droiddoc_exported_dir { |
Pete Gillin | 0728b74 | 2018-09-17 15:41:45 +0100 | [diff] [blame] | 723 | name: "ojluni-annotated-sdk-stubs", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 724 | visibility: [ |
| 725 | "//frameworks/base", |
| 726 | ], |
Pete Gillin | 0728b74 | 2018-09-17 15:41:45 +0100 | [diff] [blame] | 727 | path: "ojluni/annotations/sdk", |
Pete Gillin | 7db7faa | 2018-07-31 13:29:35 +0100 | [diff] [blame] | 728 | } |
Paul Duffin | 48ac7b6 | 2019-03-28 14:28:06 +0000 | [diff] [blame] | 729 | |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 730 | droiddoc_exported_dir { |
| 731 | name: "ojluni-annotated-nullability-stubs", |
| 732 | path: "ojluni/annotations/sdk/nullability", |
| 733 | } |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 734 | |
| 735 | // Exports annotated stubs source files in ojluni/annotations/mmodules to make |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 736 | // them available to metalava. Used for core platform API and intra-core API |
Neil Fuller | 77e3f3b | 2018-10-19 10:22:32 +0100 | [diff] [blame] | 737 | // annotations in OpenJDK source. |
Pete Gillin | c9935b6 | 2018-09-25 14:42:40 +0100 | [diff] [blame] | 738 | droiddoc_exported_dir { |
| 739 | name: "ojluni-annotated-mmodule-stubs", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 740 | visibility: [ |
| 741 | "//libcore/mmodules/core_platform_api", |
| 742 | "//libcore/mmodules/intracoreapi", |
| 743 | ], |
Pete Gillin | c9935b6 | 2018-09-25 14:42:40 +0100 | [diff] [blame] | 744 | path: "ojluni/annotations/mmodule", |
| 745 | } |
Pete Gillin | 7db7faa | 2018-07-31 13:29:35 +0100 | [diff] [blame] | 746 | |
Neil Fuller | 6f16b46 | 2018-09-04 15:40:39 +0100 | [diff] [blame] | 747 | // A file containing the list of tags that are "known" to us from the OpenJdk |
| 748 | // source code and so should not cause an error or warning. |
Nan Zhang | d55722b | 2018-02-27 15:08:20 -0800 | [diff] [blame] | 749 | filegroup { |
| 750 | name: "known-oj-tags", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 751 | visibility: [ |
| 752 | "//frameworks/base", |
| 753 | ], |
Nan Zhang | d55722b | 2018-02-27 15:08:20 -0800 | [diff] [blame] | 754 | srcs: [ |
| 755 | "known_oj_tags.txt", |
| 756 | ], |
| 757 | } |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 758 | |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 759 | // Generates stubs for the parts of the public SDK API provided by the ART module. |
Paul Duffin | 0ca3cbe | 2019-02-14 15:47:58 +0000 | [diff] [blame] | 760 | // |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 761 | // Only for use by art.module.public.api.stubs target below. |
Nan Zhang | f020760 | 2018-09-10 18:57:38 -0700 | [diff] [blame] | 762 | droidstubs { |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 763 | name: "art-module-public-api-stubs-gen", |
Paul Duffin | 53690cb | 2019-09-19 15:11:28 +0100 | [diff] [blame] | 764 | srcs: [ |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 765 | ":core_oj_api_files", |
| 766 | ":core_libart_api_files", |
Paul Duffin | 53690cb | 2019-09-19 15:11:28 +0100 | [diff] [blame] | 767 | ], |
Tobias Thierer | de99123 | 2018-03-07 15:10:46 +0000 | [diff] [blame] | 768 | java_version: "1.9", |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 769 | installable: false, |
Paul Duffin | 419b242 | 2019-06-25 15:42:05 +0100 | [diff] [blame] | 770 | sdk_version: "none", |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 771 | } |
| 772 | |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 773 | // A stubs target containing the parts of the public SDK API provided by the ART module. |
| 774 | java_library { |
| 775 | name: "art.module.public.api.stubs", |
| 776 | srcs: [":art-module-public-api-stubs-gen"], |
| 777 | errorprone: { |
| 778 | javacflags: [ |
| 779 | "-Xep:MissingOverride:OFF", |
| 780 | ], |
| 781 | }, |
| 782 | openjdk9: { |
| 783 | javacflags: ["--patch-module=java.base=."], |
| 784 | }, |
| 785 | sdk_version: "none", |
| 786 | system_modules: "none", |
| 787 | } |
| 788 | |
| 789 | // Used when compiling higher-level code against art.module.public.api.stubs. |
| 790 | java_system_modules { |
| 791 | name: "art-module-public-api-stubs-system-modules", |
| 792 | visibility: [ |
| 793 | "//external/wycheproof", |
| 794 | ], |
| 795 | libs: [ |
| 796 | "art.module.public.api.stubs", |
| 797 | // This one is not on device but it's needed when javac compiles code |
| 798 | // containing lambdas. |
| 799 | "core-lambda-stubs-for-system-modules", |
| 800 | // This one is not on device but it's needed when javac compiles code |
| 801 | // containing @Generated annotations produced by some code generation |
| 802 | // tools. |
| 803 | // See http://b/123891440. |
| 804 | "core-generated-annotation-stubs", |
| 805 | ], |
| 806 | } |
| 807 | |
| 808 | // Generates stubs for the parts of the public SDK API provided by the conscrypt module. |
| 809 | // |
| 810 | // Only for use by conscrypt.module.public.api.stubs target below. |
| 811 | droidstubs { |
| 812 | name: "conscrypt-module-public-api-stubs-gen", |
| 813 | srcs: [ |
| 814 | ":conscrypt_public_api_files", |
| 815 | ], |
| 816 | java_version: "1.9", |
| 817 | installable: false, |
| 818 | sdk_version: "none", |
| 819 | libs: [ |
| 820 | "art.module.public.api.stubs", |
| 821 | ], |
| 822 | } |
| 823 | |
| 824 | // A stubs target containing the parts of the public SDK API provided by the conscrypt module. |
| 825 | java_library { |
| 826 | name: "conscrypt.module.public.api.stubs", |
| 827 | srcs: [":conscrypt-module-public-api-stubs-gen"], |
| 828 | errorprone: { |
| 829 | javacflags: [ |
| 830 | "-Xep:MissingOverride:OFF", |
| 831 | ], |
| 832 | }, |
| 833 | openjdk9: { |
| 834 | javacflags: ["--patch-module=java.base=."], |
| 835 | }, |
| 836 | sdk_version: "none", |
| 837 | system_modules: "none", |
| 838 | libs: [ |
| 839 | "art.module.public.api.stubs", |
| 840 | ], |
| 841 | } |
| 842 | |
| 843 | // Generates stubs for the parts of the public SDK API provided by the i18n module. |
| 844 | // |
| 845 | // Only for use by i18n.module.public.api.stubs target below. |
| 846 | droidstubs { |
| 847 | name: "i18n-module-public-api-stubs-gen", |
| 848 | srcs: [ |
| 849 | ":android_icu4j_src_files", |
| 850 | ], |
| 851 | java_version: "1.9", |
| 852 | installable: false, |
| 853 | sdk_version: "none", |
| 854 | libs: [ |
| 855 | "art.module.public.api.stubs", |
| 856 | ], |
| 857 | } |
| 858 | |
| 859 | // A stubs target containing the parts of the public SDK API provided by the i18n module. |
| 860 | java_library { |
| 861 | name: "i18n.module.public.api.stubs", |
| 862 | srcs: [":i18n-module-public-api-stubs-gen"], |
| 863 | errorprone: { |
| 864 | javacflags: [ |
| 865 | "-Xep:MissingOverride:OFF", |
| 866 | ], |
| 867 | }, |
| 868 | openjdk9: { |
| 869 | javacflags: ["--patch-module=java.base=."], |
| 870 | }, |
| 871 | sdk_version: "none", |
| 872 | system_modules: "none", |
| 873 | libs: [ |
| 874 | "art.module.public.api.stubs", |
| 875 | ], |
| 876 | } |
| 877 | |
Paul Duffin | 0ca3cbe | 2019-02-14 15:47:58 +0000 | [diff] [blame] | 878 | // A stubs target containing the parts of the public SDK API provided by the |
| 879 | // core library. |
| 880 | // |
| 881 | // Don't use this directly, use "sdk_version: core_current". |
| 882 | java_library { |
| 883 | name: "core.current.stubs", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 884 | visibility: ["//visibility:public"], |
Paul Duffin | a8bb606 | 2019-09-25 15:50:13 +0100 | [diff] [blame] | 885 | static_libs: [ |
| 886 | "art.module.public.api.stubs", |
| 887 | "conscrypt.module.public.api.stubs", |
| 888 | "i18n.module.public.api.stubs", |
| 889 | ], |
Paul Duffin | 0ca3cbe | 2019-02-14 15:47:58 +0000 | [diff] [blame] | 890 | openjdk9: { |
| 891 | javacflags: ["--patch-module=java.base=."], |
| 892 | }, |
Paul Duffin | 83c2538 | 2019-06-07 14:10:49 +0100 | [diff] [blame] | 893 | sdk_version: "none", |
Paul Duffin | 0ca3cbe | 2019-02-14 15:47:58 +0000 | [diff] [blame] | 894 | system_modules: "none", |
Paul Duffin | 6564118 | 2019-04-08 10:24:23 +0100 | [diff] [blame] | 895 | |
| 896 | dist: { |
| 897 | targets: [ |
| 898 | "sdk", |
| 899 | "win_sdk", |
| 900 | ], |
| 901 | }, |
Paul Duffin | 0ca3cbe | 2019-02-14 15:47:58 +0000 | [diff] [blame] | 902 | } |
| 903 | |
Neil Fuller | 61dabbf | 2018-10-21 22:53:18 +0100 | [diff] [blame] | 904 | // Used when compiling higher-level code against core.current.stubs. |
| 905 | java_system_modules { |
| 906 | name: "core-current-stubs-system-modules", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 907 | visibility: ["//visibility:public"], |
Neil Fuller | 61dabbf | 2018-10-21 22:53:18 +0100 | [diff] [blame] | 908 | libs: [ |
| 909 | "core.current.stubs", |
| 910 | // This one is not on device but it's needed when javac compiles code |
| 911 | // containing lambdas. |
| 912 | "core-lambda-stubs-for-system-modules", |
| 913 | // This one is not on device but it's needed when javac compiles code |
| 914 | // containing @Generated annotations produced by some code generation |
| 915 | // tools. |
| 916 | // See http://b/123891440. |
| 917 | "core-generated-annotation-stubs", |
| 918 | ], |
| 919 | } |
| 920 | |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 921 | // Target for validating nullability annotations for correctness and |
| 922 | // completeness. To check that there are no nullability errors: |
| 923 | // make core-current-stubs-nullability-validation |
| 924 | // To check that there are only the expected nullability warnings: |
| 925 | // make core-current-stubs-nullability-validation-check-nullability-warnings |
| 926 | // To update the the list of known expected nullability warnings: |
| 927 | // make core-current-stubs-nullability-validation-update-nullability-warnings |
| 928 | droidstubs { |
| 929 | name: "core-current-stubs-nullability-validation", |
| 930 | srcs: [":core_api_files"], |
| 931 | installable: false, |
Paul Duffin | 419b242 | 2019-06-25 15:42:05 +0100 | [diff] [blame] | 932 | sdk_version: "none", |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 933 | annotations_enabled: true, |
| 934 | args: "--hide-annotation libcore.api.Hide " + |
| 935 | "--validate-nullability-from-merged-stubs ", |
| 936 | merge_inclusion_annotations_dirs: ["ojluni-annotated-mmodule-stubs"], |
| 937 | merge_annotations_dirs: [ |
| 938 | "metalava-manual", |
| 939 | // N.B. Stubs in this filegroup will be validated: |
| 940 | "ojluni-annotated-nullability-stubs", |
| 941 | ], |
Pete Gillin | c5f179b | 2018-11-14 18:42:19 +0000 | [diff] [blame] | 942 | // The list of classes which have nullability annotations included in the source. |
| 943 | // (This is in addition to those which have annotations in the merged stubs.) |
| 944 | validate_nullability_from_list: "nullability_annotated_classes.txt", |
Pete Gillin | 600c7cf | 2018-08-16 19:28:38 +0100 | [diff] [blame] | 945 | // The expected set of warnings about missing annotations: |
| 946 | check_nullability_warnings: "nullability_warnings.txt", |
| 947 | } |
| 948 | |
Neil Fuller | e784ef2 | 2018-11-16 15:54:30 +0000 | [diff] [blame] | 949 | // A host library containing time zone related classes. Used for |
| 950 | // host-side tools and tests that have to deal with Android |
| 951 | // time zone data. |
| 952 | java_library_host { |
| 953 | name: "timezone-host", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 954 | visibility: [ |
| 955 | "//system/timezone/distro/core", |
| 956 | ], |
Neil Fuller | e784ef2 | 2018-11-16 15:54:30 +0000 | [diff] [blame] | 957 | srcs: [":timezone_host_files"], |
| 958 | } |
Andrei Onea | 24892e2 | 2019-04-16 16:48:37 +0100 | [diff] [blame] | 959 | |
Victor Chang | b28d3f8 | 2019-08-09 16:24:46 +0100 | [diff] [blame] | 960 | // A library that contains annotations not retented in runtime and inline-able constants |
| 961 | // that should not introduce any runtime dependency for compiling core libraries, e.g. core-icu4j, |
| 962 | java_library { |
| 963 | name: "libcore-unsupportedappusage-annotation", |
| 964 | srcs: [ |
| 965 | ":unsupportedappusage_annotation_files", |
| 966 | ], |
| 967 | |
| 968 | installable: false, |
| 969 | sdk_version: "core_current", |
| 970 | } |
| 971 | |
Andrei Onea | 24892e2 | 2019-04-16 16:48:37 +0100 | [diff] [blame] | 972 | // The source files that contain the UnsupportedAppUsage annotation and its dependencies. |
| 973 | filegroup { |
| 974 | name: "unsupportedappusage_annotation_files", |
Paul Duffin | c241d6a | 2019-06-25 15:40:29 +0100 | [diff] [blame] | 975 | visibility: [ |
| 976 | "//frameworks/base", |
| 977 | ], |
Andrei Onea | 24892e2 | 2019-04-16 16:48:37 +0100 | [diff] [blame] | 978 | srcs: [ |
| 979 | "dalvik/src/main/java/dalvik/annotation/compat/UnsupportedAppUsage.java", |
| 980 | "dalvik/src/main/java/dalvik/system/VersionCodes.java", |
| 981 | "luni/src/main/java/libcore/api/CorePlatformApi.java", |
| 982 | "luni/src/main/java/libcore/api/IntraCoreApi.java", |
| 983 | ], |
Neil Fuller | 86345d7 | 2019-04-25 09:15:32 +0100 | [diff] [blame] | 984 | } |