1// 2// Copyright (C) 2016 The Android Open Source Project 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15// 16 17package { 18 default_visibility: [ 19 ":__subpackages__", 20 ], 21 default_applicable_licenses: ["external_conscrypt_license"], 22} 23 24// Added automatically by a large-scale-change that took the approach of 25// 'apply every license found to every target'. While this makes sure we respect 26// every license restriction, it may not be entirely correct. 27// 28// e.g. GPL in an MIT project might only apply to the contrib/ directory. 29// 30// Please consider splitting the single license below into multiple licenses, 31// taking care not to lose any license_kind information, and overriding the 32// default license using the 'licenses: [...]' property on targets as needed. 33// 34// For unused files, consider creating a 'fileGroup' with "//visibility:private" 35// to attach the license to, and including a comment whether the files may be 36// used in the current project. 37// 38// large-scale-change included anything that looked like it might be a license 39// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc. 40// 41// Please consider removing redundant or irrelevant files from 'license_text:'. 42// See: http://go/android-license-faq 43license { 44 name: "external_conscrypt_license", 45 visibility: [":__subpackages__"], 46 license_kinds: [ 47 "SPDX-license-identifier-Apache-2.0", 48 "legacy_unencumbered", 49 ], 50 license_text: [ 51 "LICENSE", 52 "NOTICE", 53 "licenses/**/*", 54 ], 55} 56 57// 58// Definitions for building the Conscrypt Java library, native code, 59// and associated tests. 60// 61 62// Conscrypt is divided into subdirectories. 63// 64// The structure is: 65// 66// constants/ 67// src/gen # Generates NativeConstants.java. 68// common/ 69// src/main/java # Common Java source for all platforms. 70// src/jni/ 71// main # Common C++ source for all platforms. 72// unbundled # C++ source used for OpenJDK and unbundled Android. 73// src/test/java # Common test files for all platforms. 74// android/ 75// src/main/java # Java source for unbundled Android. 76// openjdk/ 77// src/main/java # Java source for OpenJDK. 78// src/test 79// java/ # Java source for common tests. 80// resources/ # Support files for tests 81// platform/ 82// src/main/java # Java source for bundled Android. 83// src/test 84// java/ # Java source for bundled tests. 85// 86 87cc_defaults { 88 name: "conscrypt_global", 89 90 cflags: [ 91 "-Wall", 92 "-Wextra", 93 "-Werror", 94 "-Wunused", 95 ], 96 97 srcs: [ 98 "common/src/jni/main/cpp/conscrypt/compatibility_close_monitor.cc", 99 "common/src/jni/main/cpp/conscrypt/jniload.cc", 100 "common/src/jni/main/cpp/conscrypt/jniutil.cc", 101 "common/src/jni/main/cpp/conscrypt/native_crypto.cc", 102 "common/src/jni/main/cpp/conscrypt/netutil.cc", 103 ], 104 105 header_libs: ["jni_headers"], 106 107 local_include_dirs: [ 108 "common/src/jni/main/include", 109 ], 110 111 compile_multilib: "both", 112 stl: "c++_static", 113} 114 115cc_defaults { 116 name: "conscrypt_unbundled-jni-defaults", 117 118 local_include_dirs: [ 119 "common/src/jni/unbundled/include", 120 ], 121 122 header_libs: ["jni_headers"], 123 124 shared_libs: [ 125 "liblog", 126 ], 127 128 static_libs: [ 129 "libssl", 130 "libcrypto_static", 131 ], 132 133 sdk_version: "9", 134} 135 136cc_library { 137 name: "libconscrypt_jni", 138 defaults: [ 139 "conscrypt_global", 140 "conscrypt_unbundled-jni-defaults", 141 ], 142} 143 144cc_library_host_shared { 145 name: "libconscrypt_openjdk_jni", 146 visibility: [ 147 "//build/make/tools/otatools_package", 148 "//build/make/tools/signapk", 149 "//cts/hostsidetests/library", // from CtsUseNativeLibraryBuildPackage 150 "//tools/apksig", 151 "//vendor:__subpackages__", 152 ], 153 defaults: ["conscrypt_global"], 154 155 cflags: [ 156 "-DCONSCRYPT_OPENJDK", 157 ], 158 159 local_include_dirs: [ 160 "common/src/jni/unbundled/include", 161 ], 162 163 static_libs: [ 164 "libssl", 165 "libcrypto_static", 166 ], 167 168 // TODO: b/26097626. ASAN breaks use of this library in JVM. 169 // Re-enable sanitization when the issue with making clients of this library 170 // preload ASAN runtime is resolved. Without that, clients are getting runtime 171 // errors due to unresolved ASAN symbols, such as 172 // __asan_option_detect_stack_use_after_return. 173 sanitize: { 174 never: true, 175 }, 176 177 stl: "libc++_static", 178 179 // The post-build signing tools need signapk.jar and its shared libs 180 multilib: { 181 lib64: { 182 dist: { 183 targets: ["droidcore"], 184 }, 185 }, 186 }, 187} 188 189aconfig_declarations { 190 name: "conscrypt-aconfig-flags", 191 package: "com.android.org.conscrypt.flags", 192 container: "com.android.conscrypt", 193 srcs: ["conscrypt.aconfig"], 194 exportable: true, 195 visibility: [ 196 "//frameworks/base", 197 ], 198} 199 200java_aconfig_library { 201 name: "conscrypt-aconfig-flags-lib", 202 aconfig_declarations: "conscrypt-aconfig-flags", 203 system_modules: "core-all-system-modules", 204 libs: [ 205 "aconfig-annotations-lib-sdk-none", 206 "aconfig_storage_stub_none", 207 ], 208 sdk_version: "none", 209 patch_module: "java.base", 210 apex_available: [ 211 "com.android.conscrypt", 212 ], 213 min_sdk_version: "30", 214 installable: false, 215 visibility: [ 216 "//cts/tests/tests/networksecurityconfig:__subpackages__", 217 ], 218} 219 220cc_binary_host { 221 name: "conscrypt_generate_constants", 222 srcs: ["constants/src/gen/cpp/generate_constants.cc"], 223 cflags: [ 224 "-Wall", 225 "-Werror", 226 ], 227 shared_libs: [ 228 "libcrypto", 229 "libssl", 230 ], 231} 232 233genrule { 234 name: "conscrypt-unbundled_generated_constants", 235 out: ["org/conscrypt/NativeConstants.java"], 236 cmd: "$(location conscrypt_generate_constants) > $(out)", 237 tools: ["conscrypt_generate_constants"], 238} 239 240genrule { 241 name: "conscrypt_generated_constants", 242 out: ["com/android/org/conscrypt/NativeConstants.java"], 243 cmd: "$(location conscrypt_generate_constants) com.android.org.conscrypt > $(out)", 244 tools: ["conscrypt_generate_constants"], 245} 246 247filegroup { 248 name: "conscrypt_java_files", 249 srcs: [ 250 "repackaged/common/src/main/java/**/*.java", 251 "repackaged/platform/src/main/java/**/*.java", 252 ":conscrypt_generated_constants", 253 ], 254} 255 256filegroup { 257 name: "conscrypt_public_api_files", 258 srcs: ["publicapi/src/main/java/**/*.java"], 259 path: "publicapi/src/main/java", 260} 261 262// Create the conscrypt library from the source produced by the srcgen/generate_android_src.sh 263// script. 264java_library { 265 name: "conscrypt", 266 visibility: [ 267 "//device:__subpackages__", 268 ":__subpackages__", 269 ], 270 apex_available: [ 271 "com.android.conscrypt", 272 "test_com.android.conscrypt", 273 ], 274 // Conscrypt should support R 275 min_sdk_version: "30", 276 277 installable: true, 278 // Hostdex is only for ART testing on host: ART build file has its 279 // own hostdex support for conscrypt. 280 hostdex: false, 281 282 srcs: [ 283 ":conscrypt_java_files", 284 ":conscrypt_public_api_files", 285 ], 286 287 libs: [ 288 "framework-annotations-lib", 289 "unsupportedappusage", 290 ], 291 static_libs: [ 292 "conscrypt-aconfig-flags-lib", 293 ], 294 295 // Conscrypt can be updated independently from the other core libraries so it must only depend 296 // on public SDK and intra-core APIs. 297 sdk_version: "none", 298 system_modules: "art-module-intra-core-api-stubs-system-modules", 299 patch_module: "java.base", 300 301 target: { 302 // boringssl_self_test needed in both /system/bin and /apex/com.android.conscrypt/bin 303 // prng_seeder is only needed in /system/bin 304 // The required directive is here rather than under boringssl to avoid circular 305 // dependencies. 306 android: { 307 required: [ 308 "boringssl_self_test", 309 "prng_seeder", 310 ], 311 }, 312 }, 313 314 permitted_packages: [ 315 "android.net.ssl", 316 "com.android.org.conscrypt", 317 ], 318} 319 320// Java library for use on host, e.g. by robolectric. 321java_library { 322 name: "conscrypt-for-host", 323 visibility: [ 324 "//art/build", 325 "//external/robolectric-shadows", 326 "//external/robolectric", 327 "//frameworks/layoutlib", 328 ], 329 static_libs: [ 330 "conscrypt", 331 ], 332 sdk_version: "none", 333 system_modules: "none", 334} 335 336// Referenced implicitly from conscrypt.module.platform.api. 337filegroup { 338 name: "conscrypt.module.platform.api.api.combined.public.latest", 339 srcs: [ 340 "api/platform/last-api.txt", 341 ], 342} 343 344// Referenced implicitly from conscrypt.module.platform.api. 345filegroup { 346 name: "conscrypt.module.platform.api-removed.api.combined.public.latest", 347 srcs: [ 348 "api/platform/last-removed.txt", 349 ], 350} 351 352// Referenced implicitly from conscrypt.module.platform.api. 353filegroup { 354 name: "conscrypt.module.platform.api-incompatibilities.api.public.latest", 355 srcs: [ 356 "api/platform/last-incompatibilities.txt", 357 ], 358} 359 360// A library containing the core platform API stubs of the Conscrypt module. 361// 362// Core platform APIs are only intended for use of other parts of the platform, not the 363// core library modules. 364// 365// The API specification .txt files managed by this only contain the additional 366// classes/members that are in the platform API but which are not in the public 367// API. 368// 369// Note that this entire API surface is considered stable in the sense described in 370// libcore/mmodules/core_platform_api/Android.bp. 371java_sdk_library { 372 name: "conscrypt.module.platform.api", 373 visibility: [ 374 "//build/soong/java/core-libraries", 375 "//external/wycheproof", 376 // Visibility for prebuilt conscrypt-module-sdk from the prebuilt of 377 // this module. 378 // TODO(b/155921753): Restrict this when prebuilts are in their proper 379 // locations. 380 "//prebuilts:__subpackages__", 381 382 // DO NOT REMOVE: Legacy visibility, needed for snapshots that are 383 // generated for the S build. 384 "//libcore/mmodules/core_platform_api", 385 ], 386 srcs: [ 387 ":conscrypt_java_files", 388 ":conscrypt_public_api_files", 389 ":framework-metalava-annotations", 390 ], 391 aconfig_declarations: [ 392 "conscrypt-aconfig-flags", 393 ], 394 api_dir: "api/platform", 395 api_only: true, 396 annotations_enabled: true, 397 api_lint: { 398 enabled: true, 399 }, 400 droiddoc_options: [ 401 "--hide-annotation libcore.api.Hide", 402 // Include the "public" API in the "platform" API. 403 "--show-unannotated", 404 "--show-single-annotation libcore.api.CorePlatformApi\\(status=libcore.api.CorePlatformApi.Status.STABLE\\)", 405 ], 406 407 public: { 408 // Select api-surface defined in build/soong/java/metalava/main-config.xml 409 api_surface: "core-platform-plus-public", 410 }, 411 412 hostdex: true, 413 414 sdk_version: "none", 415 system_modules: "art-module-lib-api-stubs-system-modules", 416 417 dist_group: "android", 418 dist_stem: "conscrypt-coreplatform", 419 // TODO: remove this when Conscrypt's @CorePlatformApi has been migrated to @SystemApi 420 unsafe_ignore_missing_latest_api: true, 421 libs: [ 422 "conscrypt-aconfig-flags-lib", 423 ], 424} 425 426// A library containing the public API stubs of the Conscrypt module. 427java_sdk_library { 428 name: "conscrypt.module.public.api", 429 visibility: [ 430 "//build/soong/java/core-libraries", 431 "//frameworks/base", 432 "//frameworks/base/api", 433 "//packages/modules/common/sdk", 434 // TODO(b/165823103): Remove visiblity for IPsec once CorePlatformApi is available 435 "//packages/modules/IPsec", 436 // Visibility for prebuilt art-module-host-exports from the prebuilt of 437 // this module. 438 // TODO(b/155921753): Restrict this when prebuilts are in their proper 439 // locations. 440 "//prebuilts:__subpackages__", 441 442 // DO NOT REMOVE: Legacy visibility, needed for snapshots that are 443 // generated for the S build. 444 "//libcore", 445 ], 446 srcs: [ 447 ":conscrypt_public_api_files", 448 ":framework-metalava-annotations", 449 ], 450 libs: [ 451 "conscrypt-aconfig-flags-lib", 452 ], 453 aconfig_declarations: [ 454 "conscrypt-aconfig-flags", 455 ], 456 457 // The base name for the artifacts that are automatically published to the 458 // dist and which end up in one of the sub-directories of prebuilts/sdk. 459 // As long as this matches the name of the artifacts in prebuilts/sdk then 460 // the API will be checked for compatibility against the latest released 461 // version of the API. 462 dist_stem: "conscrypt", 463 464 public: { 465 enabled: true, 466 }, 467 system: { 468 enabled: true, 469 }, 470 module_lib: { 471 enabled: true, 472 }, 473 474 api_dir: "api/public", 475 api_only: true, 476 477 // Emit nullability annotations from the source to the stub files. 478 annotations_enabled: true, 479 480 java_version: "1.9", 481 482 sdk_version: "none", 483 system_modules: "art-module-public-api-stubs-system-modules", 484 dist_group: "android", 485} 486 487// Referenced implicitly from conscrypt.module.intra.core.api. 488filegroup { 489 name: "conscrypt.module.intra.core.api.api.combined.public.latest", 490 srcs: [ 491 "api/intra/last-api.txt", 492 ], 493} 494 495// Referenced implicitly from conscrypt.module.intra.core.api. 496filegroup { 497 name: "conscrypt.module.intra.core.api-removed.api.combined.public.latest", 498 srcs: [ 499 "api/intra/last-removed.txt", 500 ], 501} 502 503// Referenced implicitly from conscrypt.module.intra.core.api. 504filegroup { 505 name: "conscrypt.module.intra.core.api-incompatibilities.api.public.latest", 506 srcs: [ 507 "api/intra/last-incompatibilities.txt", 508 ], 509} 510 511// A library containing the intra-core API stubs of the Conscrypt module. 512// 513// Intra-core APIs are only intended for the use of other core library modules. 514// 515// The API specification .txt files managed by this only contain the additional 516// classes/members that are in the intra-core API but which are not the public API. 517java_sdk_library { 518 name: "conscrypt.module.intra.core.api", 519 visibility: [ 520 "//external/okhttp", 521 "//libcore:__subpackages__", 522 // Visibility for prebuilt conscrypt-module-sdk from the prebuilt of 523 // this module. 524 // TODO(b/155921753): Restrict this when prebuilts are in their proper 525 // locations. 526 "//prebuilts:__subpackages__", 527 ], 528 srcs: [ 529 ":conscrypt_java_files", 530 ":conscrypt_public_api_files", 531 ], 532 api_dir: "api/intra", 533 api_only: true, 534 annotations_enabled: true, 535 droiddoc_options: [ 536 "--hide-annotation libcore.api.Hide", 537 "--show-single-annotation libcore.api.IntraCoreApi", 538 ], 539 540 public: { 541 // Select api-surface defined in build/soong/java/metalava/main-config.xml 542 api_surface: "intra-core", 543 }, 544 545 sdk_version: "none", 546 system_modules: "art-module-intra-core-api-stubs-system-modules", 547 548 // This module's output stubs contain apis defined in "conscrypt.module.public.api.stubs", 549 // but adding "conscrypt.module.public.api" as a dependency of this module leads to circular 550 // dependency and requires further bootstrapping. Thus, disable stubs generation from the 551 // api signature files and generate stubs from the source Java files instead. 552 build_from_text_stub: false, 553 554 // Don't copy any output files to the dist. 555 no_dist: true, 556} 557 558// Platform conscrypt crypto JNI library 559cc_defaults { 560 name: "libjavacrypto-defaults", 561 562 cflags: [ 563 "-Wall", 564 "-Wextra", 565 "-Werror", 566 "-Wunused", 567 "-fvisibility=hidden", 568 ], 569 570 srcs: ["common/src/jni/main/cpp/**/*.cc"], 571 header_libs: ["jni_headers"], 572 local_include_dirs: ["common/src/jni/main/include"], 573} 574 575// Platform conscrypt crypto JNI library 576cc_library_shared { 577 name: "libjavacrypto", 578 host_supported: true, 579 defaults: ["libjavacrypto-defaults"], 580 visibility: [ 581 ":__subpackages__", 582 "//art/tools/ahat", 583 ], 584 cflags: ["-DJNI_JARJAR_PREFIX=com/android/"], 585 header_libs: ["libnativehelper_header_only"], 586 shared_libs: ["liblog"], 587 588 target: { 589 darwin: { 590 enabled: false, 591 }, 592 android: { 593 runtime_libs: ["libandroidio"], 594 shared_libs: [ 595 "libcrypto", 596 "libssl", 597 ], 598 }, 599 not_windows: { 600 runtime_libs: ["libandroidio"], 601 // Link libcrypto and libssl statically on host, to ensure they stay current in 602 // the prebuilt that's included in conscrypt-module-test-exports. 603 static_libs: [ 604 "libcrypto", 605 "libssl", 606 ], 607 }, 608 }, 609 apex_available: [ 610 "com.android.conscrypt", 611 "test_com.android.conscrypt", 612 ], 613 min_sdk_version: "30", 614} 615 616// Unbundled Conscrypt jar for use by signapk and apksigner tool 617// 618// Builds against standard host libraries. 619// 620// This does not use java_library_host as that does not support the 621// min_sdk_version property which needs to be set to make sure that this 622// library is added to the sdk snapshot correctly. 623java_library { 624 name: "conscrypt-unbundled", 625 visibility: [ 626 "//build/make/tools/signapk", 627 "//tools/apksig", 628 "//external/robolectric:__subpackages__", 629 ], 630 device_supported: false, 631 host_supported: true, 632 srcs: [ 633 "common/src/main/java/**/*.java", 634 "openjdk/src/main/java/**/*.java", 635 ":conscrypt-unbundled_generated_constants", 636 ], 637 javacflags: ["-XDignore.symbol.file"], 638 java_version: "1.8", 639 target: { 640 windows: { 641 enabled: true, 642 }, 643 }, 644 // Make sure that this will be added to the sdk snapshot for S. 645 min_sdk_version: "S", 646} 647 648// Interim library for accessing pseudo-JCA Conscrypt APIs such as HPKE until 649// public APIs are available. No stability guarentees, so limited visibility 650// in order to track users. 651java_library { 652 name: "conscrypt-lite", 653 visibility: [ 654 "//external/conscrypt:__subpackages__", 655 ], 656 device_supported: true, 657 host_supported: true, 658 srcs: [ 659 "common/src/main/java/**/ArrayUtils.java", 660 "common/src/main/java/**/DuckTypedHpkeSpi.java", 661 "common/src/main/java/**/Hkdf.java", 662 "common/src/main/java/**/HpkeContext.java", 663 "common/src/main/java/**/HpkeContextRecipient.java", 664 "common/src/main/java/**/HpkeContextSender.java", 665 "common/src/main/java/**/HpkeSpi.java", 666 "common/src/main/java/**/HpkeSuite.java", 667 "common/src/main/java/**/Internal.java", 668 "common/src/main/java/**/Preconditions.java", 669 "common/src/main/java/**/XdhKeySpec.java", 670 ], 671 jarjar_rules: "conscrypt-lite-jarjar-rules.txt", 672} 673 674// Static unbundled Conscrypt crypto JNI library 675cc_library_static { 676 name: "libconscrypt_static", 677 defaults: ["libjavacrypto-defaults"], 678 679 cflags: [ 680 "-DJNI_JARJAR_PREFIX=com/google/android/gms/", 681 "-DCONSCRYPT_UNBUNDLED", 682 "-DSTATIC_LIB", 683 ], 684 685 local_include_dirs: ["common/src/jni/unbundled/include"], 686 687 static_libs: [ 688 "libssl", 689 "libcrypto_static", 690 ], 691 sdk_version: "9", 692 stl: "c++_shared", 693} 694 695java_library { 696 name: "conscrypt-test-support", 697 visibility: [ 698 "//frameworks/base/apct-tests/perftests/core", 699 ], 700 device_supported: true, 701 host_supported: true, 702 srcs: [ 703 "testing/src/main/java/**/*.java", 704 ":conscrypt-unbundled_generated_constants", 705 ], 706 libs: [ 707 "junit", 708 "bouncycastle-unbundled", 709 "bouncycastle-bcpkix-unbundled", 710 "bouncycastle-ocsp-unbundled", 711 ], 712} 713 714filegroup { 715 name: "conscrypt-all-test-files", 716 srcs: [ 717 "repackaged/platform/src/test/java/**/*.java", 718 "repackaged/common/src/test/java//**/*.java", 719 "publicapi/src/test/java/**/*.java", 720 ], 721} 722 723filegroup { 724 name: "conscrypt-private-api-test-files", 725 srcs: [ 726 "repackaged/platform/src/test/java/com/android/org/conscrypt/ct/*.java", 727 "repackaged/platform/src/test/java/com/android/org/conscrypt/CertBlocklistTest.java", 728 "repackaged/common/src/test/java/com/android/org/conscrypt/ct/*.java", 729 ], 730} 731 732filegroup { 733 name: "conscrypt-test-support-files", 734 srcs: [ 735 "repackaged/testing/src/main/java/**/*.java", 736 ], 737} 738 739filegroup { 740 name: "conscrypt-xts-test-files", 741 srcs: [ 742 ":conscrypt-all-test-files", 743 ":conscrypt-test-support-files", 744 ], 745 exclude_srcs: [ 746 ":conscrypt-private-api-test-files", 747 ], 748} 749 750filegroup { 751 name: "conscrypt-private-test-files", 752 srcs: [ 753 ":conscrypt-private-api-test-files", 754 ":conscrypt-test-support-files", 755 ], 756} 757 758// Make the conscrypt-tests library. 759java_test { 760 name: "conscrypt-tests", 761 visibility: [ 762 "//cts/tests/libcore/luni", 763 "//external/conscrypt/apex/tests", 764 "//libcore", 765 ], 766 hostdex: true, 767 srcs: [ 768 ":conscrypt-xts-test-files", 769 ], 770 771 java_resource_dirs: [ 772 // Resource directories do not need repackaging. 773 "openjdk/src/test/resources", 774 "common/src/test/resources", 775 ], 776 777 sdk_version: "none", 778 system_modules: "art-module-intra-core-api-stubs-system-modules", 779 libs: [ 780 "conscrypt", 781 "core-test-rules", 782 "junit", 783 "mockito-target-minus-junit4", 784 "framework-statsd.stubs.module_lib", 785 ], 786 787 static_libs: [ 788 "bouncycastle-unbundled", 789 "bouncycastle-bcpkix-unbundled", 790 "bouncycastle-ocsp-unbundled", 791 ], 792 javacflags: [ 793 "-Xmaxwarns 9999999", 794 //"-Xlint:all", 795 //"-Xlint:-serial,-deprecation,-unchecked", 796 ], 797 798 target: { 799 host: { 800 required: ["libjavacrypto"], 801 }, 802 darwin: { 803 // required module "libjavacrypto" is disabled on darwin 804 enabled: false, 805 }, 806 }, 807 java_version: "1.8", 808} 809 810// Conscrypt private tests. These tests relies on private APIs. Prefer adding 811// your test to conscrypt-tests if possible, as these will be executed as part 812// of CTS (see CtsLibcoreTestCases). 813android_test { 814 name: "ConscryptPrivateTestCases", 815 srcs: [ 816 ":conscrypt-private-test-files", 817 ], 818 819 java_resource_dirs: [ 820 // Resource directories do not need repackaging. 821 "openjdk/src/test/resources", 822 "common/src/test/resources", 823 ], 824 825 platform_apis: true, 826 manifest: "AndroidManifest-private.xml", 827 test_config: "AndroidTest-private.xml", 828 libs: [ 829 "conscrypt", 830 "core-test-rules", 831 "junit", 832 "mockito-target-minus-junit4", 833 "framework-statsd.stubs.module_lib", 834 ], 835 836 static_libs: [ 837 "androidx.test.runner", 838 "androidx.test.rules", 839 "bouncycastle-unbundled", 840 "bouncycastle-bcpkix-unbundled", 841 "bouncycastle-ocsp-unbundled", 842 ], 843 java_version: "1.8", 844 test_suites: ["general-tests"], 845} 846 847// Make the conscrypt-benchmarks library. 848java_test { 849 name: "conscrypt-benchmarks", 850 srcs: [ 851 "repackaged/testing/src/main/java/**/*.java", 852 "repackaged/benchmark-base/src/main/java/**/*.java", 853 "repackaged/benchmark-android/src/main/java/**/*.java", 854 ], 855 sdk_version: "none", 856 system_modules: "art-module-intra-core-api-stubs-system-modules", 857 libs: [ 858 "conscrypt", 859 "junit", 860 "bouncycastle-unbundled", 861 "bouncycastle-bcpkix-unbundled", 862 "bouncycastle-ocsp-unbundled", 863 "caliper-api-target", 864 ], 865 866 javacflags: [ 867 "-Xmaxwarns 9999999", 868 //"-Xlint:all", 869 //"-Xlint:-serial,-deprecation,-unchecked", 870 ], 871 872 target: { 873 host: { 874 required: ["libjavacrypto"], 875 }, 876 darwin: { 877 // required module "libjavacrypto" is disabled on darwin 878 enabled: false, 879 }, 880 }, 881 java_version: "1.8", 882} 883 884// Device SDK exposed by the Conscrypt module. 885sdk { 886 name: "conscrypt-module-sdk", 887 apexes: [ 888 // Adds exportable dependencies of the APEX to the sdk, 889 // e.g. *classpath_fragments. 890 "com.android.conscrypt", 891 ], 892 java_sdk_libs: [ 893 "conscrypt.module.intra.core.api", 894 ], 895 native_shared_libs: [ 896 "libconscrypt_jni", 897 ], 898} 899 900// Host tools exported by the Conscrypt module. 901module_exports { 902 name: "conscrypt-module-host-exports", 903 host_supported: true, 904 device_supported: false, 905 java_libs: [ 906 "conscrypt-unbundled", 907 ], 908 native_shared_libs: [ 909 "libconscrypt_openjdk_jni", 910 ], 911} 912 913// Test libraries exposed by the Conscrypt module. 914module_exports { 915 name: "conscrypt-module-test-exports", 916 host_supported: true, 917 target: { 918 android: { 919 java_libs: [ 920 // For use by robolectric and ART tests. 921 "conscrypt-for-host", 922 ], 923 java_tests: [ 924 // For use by CTS 925 "conscrypt-tests", 926 ], 927 native_shared_libs: [ 928 "libjavacrypto", 929 ], 930 }, 931 darwin: { 932 enabled: false, 933 }, 934 // For use by ART tests on host. 935 not_windows: { 936 native_shared_libs: [ 937 "libjavacrypto", 938 ], 939 }, 940 }, 941} 942