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