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