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