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 | // |
| 16 | // Definitions for building the Java library and associated tests. |
| 17 | // |
| 18 | |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 19 | // libcore has some sub-directories that follow a common structure: |
| 20 | // e.g. dalvik, dom, harmony-tests, json, jsr166-tests, luni, libart, ojluni, |
| 21 | // support, xml, xmlpull. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 22 | // |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 23 | // The structure of these is generally: |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 24 | // |
| 25 | // src/ |
| 26 | // main/ # To be shipped on every device. |
| 27 | // java/ # Java source for library code. |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 28 | // native/ # C/C++ source for library code. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 29 | // resources/ # Support files. |
| 30 | // test/ # Built only on demand, for testing. |
| 31 | // java/ # Java source for tests. |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 32 | // native/ # C/C++ source for tests (rare). |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 33 | // resources/ # Support files. |
| 34 | // |
Neil Fuller | cf75688 | 2018-08-28 18:42:22 +0100 | [diff] [blame] | 35 | // All subdirectories are optional. |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 36 | |
| 37 | build = [ |
| 38 | "openjdk_java_files.bp", |
| 39 | "non_openjdk_java_files.bp", |
| 40 | ] |
| 41 | |
| 42 | // The Java files and their associated resources. |
| 43 | core_resource_dirs = [ |
| 44 | "luni/src/main/java", |
| 45 | "ojluni/src/main/resources/", |
| 46 | ] |
| 47 | |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 48 | // The source files that go into core-oj. |
| 49 | filegroup { |
| 50 | name: "core_oj_java_files", |
| 51 | srcs: [":openjdk_java_files"], |
| 52 | } |
| 53 | |
| 54 | // OpenJDK source is not annotated with @hide so we need a separate |
| 55 | // filegroup for just the parts that contribute to the API. |
| 56 | filegroup { |
| 57 | name: "core_oj_api_files", |
| 58 | srcs: [":openjdk_javadoc_files"], |
| 59 | } |
| 60 | |
| 61 | // The source files that go into core-libart. |
| 62 | filegroup { |
| 63 | name: "core_libart_java_files", |
| 64 | srcs: [ |
| 65 | ":non_openjdk_java_files", |
| 66 | ":android_icu4j_src_files", |
| 67 | ], |
| 68 | } |
| 69 | |
| 70 | // Some parts of libart are not annotated with @hide so we need a separate |
| 71 | // filegroup for just the parts that contribute to the API. |
| 72 | filegroup { |
| 73 | name: "core_libart_api_files", |
| 74 | srcs: [ |
| 75 | ":non_openjdk_javadoc_files", |
| 76 | ":android_icu4j_src_files", |
| 77 | ], |
| 78 | } |
| 79 | |
| 80 | // The set of files in core that have been marked up with @hide and API-related |
| 81 | // annotations. |
| 82 | filegroup { |
| 83 | name: "core_api_files", |
| 84 | srcs: [ |
Neil Fuller | a77f710 | 2018-09-21 19:04:41 +0100 | [diff] [blame] | 85 | ":bouncycastle_java_files", |
Neil Fuller | 603e1a7 | 2018-09-25 11:55:41 +0100 | [diff] [blame^] | 86 | ":conscrypt_java_files", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 87 | ":core_oj_api_files", |
| 88 | ":core_libart_api_files", |
| 89 | ":core_simple_java_files", |
Neil Fuller | 641d5f9 | 2018-09-24 15:40:39 +0100 | [diff] [blame] | 90 | ":okhttp_api_files", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 91 | ], |
| 92 | } |
| 93 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 94 | java_defaults { |
| 95 | name: "libcore_java_defaults", |
| 96 | javacflags: [ |
| 97 | //"-Xlint:all", |
| 98 | //"-Xlint:-serial,-deprecation,-unchecked", |
| 99 | ], |
| 100 | dxflags: ["--core-library"], |
Andreas Gampe | 66b3173 | 2018-02-20 09:22:16 -0800 | [diff] [blame] | 101 | errorprone: { |
| 102 | javacflags: [ |
| 103 | "-Xep:MissingOverride:OFF", // Ignore missing @Override. |
Andreas Gampe | 24a2017 | 2018-06-13 11:28:45 -0700 | [diff] [blame] | 104 | "-Xep:ConstantOverflow:WARN", // Known constant overflow in SplittableRandom |
Andreas Gampe | 66b3173 | 2018-02-20 09:22:16 -0800 | [diff] [blame] | 105 | ], |
| 106 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | // |
| 110 | // Build for the target (device). |
| 111 | // |
| 112 | |
| 113 | java_library { |
| 114 | name: "core-all", |
| 115 | defaults: ["libcore_java_defaults"], |
| 116 | |
| 117 | srcs: [ |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 118 | ":core_oj_java_files", |
| 119 | ":core_libart_java_files", |
| 120 | ":core_simple_java_files", |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 121 | ":openjdk_lambda_stub_files", |
| 122 | ], |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 123 | |
| 124 | no_standard_libs: true, |
| 125 | system_modules: "none", |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 126 | openjdk9: { |
| 127 | srcs: ["luni/src/module/java/module-info.java"], |
| 128 | javacflags: ["--patch-module=java.base=."], |
| 129 | }, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 130 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 131 | java_resource_dirs: core_resource_dirs, |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 132 | java_resources: [":android_icu4j_resources"], |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 133 | |
| 134 | required: [ |
| 135 | "tzdata", |
| 136 | "tzlookup.xml", |
| 137 | ], |
| 138 | |
| 139 | installable: false, |
| 140 | } |
| 141 | |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 142 | java_system_modules { |
| 143 | name: "core-all-system-modules", |
| 144 | libs: ["core-all"], |
| 145 | } |
| 146 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 147 | java_library { |
| 148 | name: "core-oj", |
| 149 | defaults: ["libcore_java_defaults"], |
Colin Cross | 5b75cdd | 2018-06-27 11:00:13 -0700 | [diff] [blame] | 150 | installable: true, |
Colin Cross | bb180be | 2017-10-09 14:54:53 -0700 | [diff] [blame] | 151 | hostdex: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 152 | |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 153 | srcs: [":core_oj_java_files"], |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 154 | java_resource_dirs: core_resource_dirs, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 155 | |
| 156 | no_standard_libs: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 157 | libs: ["core-all"], |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 158 | system_modules: "core-all-system-modules", |
| 159 | openjdk9: { |
| 160 | javacflags: ["--patch-module=java.base=."], |
| 161 | }, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 162 | |
Pete Gillin | 7a7a6d2 | 2017-12-19 14:56:03 +0000 | [diff] [blame] | 163 | jacoco: { |
Pete Gillin | 27ca058 | 2018-01-10 17:04:17 +0000 | [diff] [blame] | 164 | exclude_filter: [ |
Pete Gillin | 3f59bad | 2018-01-30 11:20:29 +0000 | [diff] [blame] | 165 | "java.lang.Class", |
| 166 | "java.lang.Long", |
| 167 | "java.lang.Number", |
| 168 | "java.lang.Object", |
| 169 | "java.lang.String", |
| 170 | "java.lang.invoke.MethodHandle", |
| 171 | "java.lang.ref.Reference", |
| 172 | "java.lang.reflect.Proxy", |
Pete Gillin | b1868ada | 2018-01-17 11:03:10 +0000 | [diff] [blame] | 173 | "java.util.AbstractMap", |
Pete Gillin | 3f59bad | 2018-01-30 11:20:29 +0000 | [diff] [blame] | 174 | "java.util.HashMap", |
| 175 | "java.util.HashMap$Node", |
Pete Gillin | b1868ada | 2018-01-17 11:03:10 +0000 | [diff] [blame] | 176 | "java.util.Map", |
Pete Gillin | 7a7a6d2 | 2017-12-19 14:56:03 +0000 | [diff] [blame] | 177 | ], |
| 178 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 179 | |
| 180 | notice: "ojluni/NOTICE", |
| 181 | |
| 182 | required: [ |
| 183 | "tzdata", |
| 184 | "tzlookup.xml", |
| 185 | ], |
Colin Cross | bb180be | 2017-10-09 14:54:53 -0700 | [diff] [blame] | 186 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 187 | } |
| 188 | |
| 189 | // Definitions to make the core library. |
| 190 | java_library { |
| 191 | name: "core-libart", |
| 192 | defaults: ["libcore_java_defaults"], |
Colin Cross | 5b75cdd | 2018-06-27 11:00:13 -0700 | [diff] [blame] | 193 | installable: true, |
Colin Cross | bb180be | 2017-10-09 14:54:53 -0700 | [diff] [blame] | 194 | hostdex: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 195 | |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 196 | srcs: [":core_libart_java_files"], |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 197 | java_resources: [":android_icu4j_resources"], |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 198 | |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 199 | no_standard_libs: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 200 | libs: ["core-all"], |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 201 | system_modules: "core-all-system-modules", |
| 202 | openjdk9: { |
| 203 | javacflags: ["--patch-module=java.base=."], |
| 204 | }, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 205 | |
Pete Gillin | 80ebe87 | 2018-02-13 15:21:20 +0000 | [diff] [blame] | 206 | jacoco: { |
| 207 | exclude_filter: [ |
| 208 | "java.lang.DexCache", |
| 209 | "dalvik.system.ClassExt", |
| 210 | ], |
| 211 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 212 | |
| 213 | required: [ |
| 214 | "tzdata", |
| 215 | "tzlookup.xml", |
| 216 | ], |
| 217 | } |
| 218 | |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 219 | // A guaranteed unstripped version of core-oj and core-libart. |
| 220 | // The build system may or may not strip the core-oj and core-libart jars, |
| 221 | // but these will not be stripped. See b/24535627. |
| 222 | java_library { |
| 223 | name: "core-oj-testdex", |
Colin Cross | 5b75cdd | 2018-06-27 11:00:13 -0700 | [diff] [blame] | 224 | installable: true, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 225 | static_libs: ["core-oj"], |
| 226 | no_standard_libs: true, |
| 227 | libs: ["core-all"], |
| 228 | system_modules: "core-all-system-modules", |
| 229 | dxflags: ["--core-library"], |
Colin Cross | 485ed36 | 2017-12-05 17:24:22 -0800 | [diff] [blame] | 230 | dex_preopt: { |
| 231 | enabled: false, |
| 232 | }, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 233 | notice: "ojluni/NOTICE", |
| 234 | required: [ |
| 235 | "tzdata", |
| 236 | "tzlookup.xml", |
| 237 | ], |
| 238 | } |
| 239 | |
| 240 | java_library { |
| 241 | name: "core-libart-testdex", |
Colin Cross | 5b75cdd | 2018-06-27 11:00:13 -0700 | [diff] [blame] | 242 | installable: true, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 243 | static_libs: ["core-libart"], |
| 244 | no_standard_libs: true, |
| 245 | libs: ["core-all"], |
| 246 | system_modules: "core-all-system-modules", |
| 247 | dxflags: ["--core-library"], |
Colin Cross | 485ed36 | 2017-12-05 17:24:22 -0800 | [diff] [blame] | 248 | dex_preopt: { |
| 249 | enabled: false, |
| 250 | }, |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 251 | notice: "ojluni/NOTICE", |
| 252 | required: [ |
| 253 | "tzdata", |
| 254 | "tzlookup.xml", |
| 255 | ], |
| 256 | } |
| 257 | |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 258 | // A library that exists to satisfy javac when |
| 259 | // compiling source code that contains lambdas. |
| 260 | java_library { |
| 261 | name: "core-lambda-stubs", |
| 262 | defaults: ["libcore_java_defaults"], |
| 263 | |
| 264 | srcs: [ |
| 265 | ":openjdk_lambda_stub_files", |
| 266 | ":openjdk_lambda_duplicate_stub_files", |
| 267 | ], |
| 268 | |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 269 | no_standard_libs: true, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 270 | libs: ["core-all"], |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 271 | system_modules: "core-all-system-modules", |
| 272 | openjdk9: { |
| 273 | javacflags: ["--patch-module=java.base=."], |
| 274 | }, |
Colin Cross | af0b54c | 2017-09-27 17:22:32 -0700 | [diff] [blame] | 275 | |
| 276 | notice: "ojluni/NOTICE", |
| 277 | |
| 278 | installable: false, |
| 279 | include_srcs: true, |
| 280 | } |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 281 | |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 282 | // The libraries that make up core. |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 283 | java_system_modules { |
| 284 | name: "core-system-modules", |
| 285 | libs: [ |
| 286 | "core-oj", |
| 287 | "core-libart", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 288 | "core-simple", |
| 289 | // This one is not on device but it's needed when javac compiles code |
| 290 | // containing lambdas. |
| 291 | "core-lambda-stubs" |
Colin Cross | a4d9fc4 | 2017-09-29 18:04:37 -0700 | [diff] [blame] | 292 | ], |
| 293 | } |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 294 | |
| 295 | // Build libcore test rules |
| 296 | java_library_static { |
| 297 | name: "core-test-rules", |
| 298 | hostdex: true, |
| 299 | no_framework_libs: true, |
| 300 | srcs: [ |
| 301 | "dalvik/test-rules/src/main/**/*.java", |
| 302 | "test-rules/src/main/**/*.java", |
| 303 | ], |
| 304 | static_libs: ["junit"], |
| 305 | } |
| 306 | |
| 307 | // Make the core-tests-support library. |
| 308 | java_library_static { |
| 309 | name: "core-tests-support", |
| 310 | hostdex: true, |
| 311 | no_framework_libs: true, |
| 312 | srcs: ["support/src/test/java/**/*.java"], |
| 313 | libs: [ |
| 314 | "junit", |
| 315 | "bouncycastle", |
| 316 | ], |
| 317 | static_libs: [ |
| 318 | "bouncycastle-bcpkix", |
| 319 | "bouncycastle-ocsp", |
| 320 | ], |
| 321 | } |
| 322 | |
| 323 | // Make the jsr166-tests library. |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 324 | java_test { |
Colin Cross | 3c6c2e2 | 2017-10-18 13:24:52 -0700 | [diff] [blame] | 325 | name: "jsr166-tests", |
| 326 | srcs: ["jsr166-tests/src/test/java/**/*.java"], |
| 327 | no_framework_libs: true, |
| 328 | libs: [ |
| 329 | "junit", |
| 330 | ], |
| 331 | } |
Nan Zhang | 65f27a3 | 2018-01-05 10:41:46 -0800 | [diff] [blame] | 332 | |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 333 | // Build a library just containing files from luni/src/test/filesystems for use in tests. |
| 334 | java_library { |
| 335 | name: "filesystemstest", |
| 336 | compile_dex: true, |
| 337 | srcs: ["luni/src/test/filesystems/src/**/*.java"], |
| 338 | java_resource_dirs: ["luni/src/test/filesystems/resources"], |
| 339 | no_framework_libs: true, |
| 340 | errorprone: { |
| 341 | javacflags: ["-Xep:MissingOverride:OFF"], |
| 342 | }, |
| 343 | } |
| 344 | |
| 345 | // Build a library just containing files from luni/src/test/parameter_metadata for use in tests. |
| 346 | java_library { |
| 347 | name: "parameter-metadata-test", |
| 348 | compile_dex: true, |
| 349 | srcs: ["luni/src/test/parameter_metadata/src/**/*.java"], |
| 350 | no_framework_libs: true, |
| 351 | javacflags: ["-parameters"], |
| 352 | errorprone: { |
| 353 | javacflags: ["-Xep:MissingOverride:OFF"], |
| 354 | }, |
| 355 | } |
| 356 | |
| 357 | // Make the core-tests library. |
| 358 | java_test { |
| 359 | name: "core-tests", |
| 360 | defaults: ["libcore_java_defaults"], |
| 361 | hostdex: true, |
Roland Levillain | 5e028a2 | 2018-08-17 17:33:59 +0100 | [diff] [blame] | 362 | no_framework_libs: true, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 363 | srcs: [ |
| 364 | "dalvik/src/test/java/**/*.java", |
| 365 | "dalvik/test-rules/src/test/java/**/*.java", |
| 366 | "dom/src/test/java/**/*.java", |
| 367 | "harmony-tests/src/test/java/**/*.java", |
| 368 | "json/src/test/java/**/*.java", |
| 369 | "luni/src/test/java/**/*.java", |
| 370 | "xml/src/test/java/**/*.java", |
| 371 | ], |
| 372 | exclude_srcs: [ |
| 373 | "luni/src/test/java/libcore/java/util/zip/Zip64Test.java", |
| 374 | "luni/src/test/java/libcore/java/util/zip/Zip64FileTest.java", |
| 375 | ], |
| 376 | |
| 377 | java_resource_dirs: [ |
| 378 | "*/src/test/java", |
| 379 | "*/src/test/resources", |
| 380 | ], |
| 381 | exclude_java_resource_dirs: [ |
| 382 | "ojluni/src/test/java", |
| 383 | "ojluni/src/test/resources", |
| 384 | ], |
| 385 | |
| 386 | java_resources: [ |
| 387 | ":filesystemstest", |
| 388 | ":parameter-metadata-test", |
| 389 | ], |
| 390 | |
| 391 | libs: [ |
| 392 | "okhttp", |
| 393 | "bouncycastle", |
| 394 | ], |
| 395 | static_libs: [ |
| 396 | "archive-patcher", |
| 397 | "core-test-rules", |
| 398 | "core-tests-support", |
| 399 | "junit-params", |
| 400 | "mockftpserver", |
| 401 | "mockito-target", |
| 402 | "mockwebserver", |
| 403 | "nist-pkix-tests", |
| 404 | "slf4j-jdk14", |
| 405 | "sqlite-jdbc", |
| 406 | "tzdata-testing", |
| 407 | ], |
| 408 | |
| 409 | errorprone: { |
| 410 | javacflags: [ |
| 411 | "-Xep:TryFailThrowable:ERROR", |
| 412 | "-Xep:ComparisonOutOfRange:ERROR", |
| 413 | ], |
| 414 | }, |
Simran Basi | 3be01e0 | 2018-08-21 17:53:49 -0700 | [diff] [blame] | 415 | |
| 416 | test_config: "AndroidTest-core-tests.xml", |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 417 | } |
| 418 | |
| 419 | // Make the core-ojtests library. |
| 420 | java_test { |
| 421 | name: "core-ojtests", |
| 422 | defaults: ["libcore_java_defaults"], |
| 423 | hostdex: true, |
Roland Levillain | 5e028a2 | 2018-08-17 17:33:59 +0100 | [diff] [blame] | 424 | no_framework_libs: true, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 425 | |
| 426 | srcs: [ |
| 427 | "ojluni/src/test/java/**/*.java", |
| 428 | ], |
| 429 | java_resource_dirs: [ |
| 430 | "ojluni/src/test/java", |
| 431 | "ojluni/src/test/resources", |
| 432 | ], |
| 433 | libs: [ |
| 434 | "okhttp", |
| 435 | "bouncycastle", |
| 436 | ], |
| 437 | static_libs: ["testng"], |
| 438 | |
| 439 | // ojluni/src/test/java/util/stream/{bootlib,boottest} |
| 440 | // contains tests that are in packages from java.base; |
| 441 | // By default, OpenJDK 9's javac will only compile such |
| 442 | // code if it's declared to also be in java.base at |
| 443 | // compile time. |
| 444 | // |
| 445 | // For now, we use --patch-module to put all sources |
| 446 | // and dependencies from this make target into java.base; |
| 447 | // other source directories in this make target are in |
| 448 | // packages not from java.base; if this becomes a problem |
| 449 | // in future, this could be addressed eg. by splitting |
| 450 | // boot{lib,test} out into a separate make target, |
| 451 | // deleting those tests or moving them to a different |
| 452 | // package. |
| 453 | patch_module: "java.base", |
| 454 | } |
| 455 | |
| 456 | // Make the core-ojtests-public library. Excludes any private API tests. |
| 457 | java_test { |
| 458 | name: "core-ojtests-public", |
| 459 | defaults: ["libcore_java_defaults"], |
Roland Levillain | 5e028a2 | 2018-08-17 17:33:59 +0100 | [diff] [blame] | 460 | no_framework_libs: true, |
Colin Cross | ec80f4f | 2018-08-15 21:17:11 -0700 | [diff] [blame] | 461 | srcs: [ |
| 462 | "ojluni/src/test/java/**/*.java", |
| 463 | ], |
| 464 | // Filter out the following: |
| 465 | // 1.) DeserializeMethodTest and SerializedLambdaTest, because they depends on stub classes |
| 466 | // and won't actually run, and |
| 467 | // 2.) util/stream/boot*. Those directories contain classes in the package java.util.stream; |
| 468 | // excluding them means we don't need patch_module: "java.base" |
| 469 | exclude_srcs: [ |
| 470 | "**/DeserializeMethodTest.java", |
| 471 | "**/SerializedLambdaTest.java", |
| 472 | "ojluni/src/test/java/util/stream/boot*/**/*", |
| 473 | ], |
| 474 | java_resource_dirs: [ |
| 475 | "ojluni/src/test/java", |
| 476 | "ojluni/src/test/resources", |
| 477 | // Include source code as part of JAR |
| 478 | "ojluni/src/test/dist", |
| 479 | ], |
| 480 | libs: [ |
| 481 | "bouncycastle", |
| 482 | "okhttp", |
| 483 | "testng", |
| 484 | ], |
| 485 | } |
| 486 | |
Pete Gillin | 7db7faa | 2018-07-31 13:29:35 +0100 | [diff] [blame] | 487 | // Make the annotated stubs in ojluni/annotations available to metalava: |
| 488 | droiddoc_exported_dir { |
Pete Gillin | 0728b74 | 2018-09-17 15:41:45 +0100 | [diff] [blame] | 489 | name: "ojluni-annotated-sdk-stubs", |
| 490 | path: "ojluni/annotations/sdk", |
Pete Gillin | 7db7faa | 2018-07-31 13:29:35 +0100 | [diff] [blame] | 491 | } |
| 492 | |
Neil Fuller | 6f16b46 | 2018-09-04 15:40:39 +0100 | [diff] [blame] | 493 | // A file containing the list of tags that are "known" to us from the OpenJdk |
| 494 | // source code and so should not cause an error or warning. |
Nan Zhang | d55722b | 2018-02-27 15:08:20 -0800 | [diff] [blame] | 495 | filegroup { |
| 496 | name: "known-oj-tags", |
| 497 | srcs: [ |
| 498 | "known_oj_tags.txt", |
| 499 | ], |
| 500 | } |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 501 | |
Neil Fuller | a6ba359 | 2018-09-21 13:19:37 +0100 | [diff] [blame] | 502 | // Stubs for the parts of the public SDK API provided by the core libraries. |
Nan Zhang | f020760 | 2018-09-10 18:57:38 -0700 | [diff] [blame] | 503 | droidstubs { |
| 504 | name: "core-current-stubs-gen", |
Neil Fuller | 866ed4a | 2018-09-06 12:05:46 +0100 | [diff] [blame] | 505 | srcs: [":core_api_files"], |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 506 | installable: false, |
| 507 | no_framework_libs: true, |
Nan Zhang | 68c55b4 | 2018-08-21 17:31:51 +0000 | [diff] [blame] | 508 | args: " --exclude-annotations", |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 509 | } |
| 510 | |
Neil Fuller | a6ba359 | 2018-09-21 13:19:37 +0100 | [diff] [blame] | 511 | // A library containing the parts of the public SDK API provided by the core libraries. |
| 512 | // Don't use this directly, use "sdk_version: core_current". |
| 513 | java_library { |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 514 | name: "core.current.stubs", |
Nan Zhang | f020760 | 2018-09-10 18:57:38 -0700 | [diff] [blame] | 515 | srcs: [":core-current-stubs-gen"], |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 516 | errorprone: { |
| 517 | javacflags: [ |
| 518 | "-Xep:MissingOverride:OFF", |
| 519 | ], |
| 520 | }, |
Tobias Thierer | 496a938 | 2018-06-12 14:09:11 +0100 | [diff] [blame] | 521 | openjdk9: { |
| 522 | javacflags: ["--patch-module=java.base=."], |
| 523 | }, |
Nan Zhang | 602fc0e | 2018-03-22 16:14:22 -0700 | [diff] [blame] | 524 | no_standard_libs: true, |
| 525 | system_modules: "none", |
| 526 | } |