blob: ff3a903eef1a1b7cbf922e37e5e6b323a310b6c5 [file] [log] [blame]
Kenny Root923342a2016-09-22 17:04:35 -07001//
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
Paul Duffina3891b02019-06-04 12:50:59 +010017package {
18 default_visibility: [
19 ":__subpackages__",
20 ],
Bob Badour808f8222021-02-12 15:19:10 -080021 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 ],
Paul Duffina3891b02019-06-04 12:50:59 +010055}
56
Colin Cross8024b112017-10-09 13:34:58 -070057//
58// Definitions for building the Conscrypt Java library, native code,
59// and associated tests.
60//
61
Neil Fullerde17f742018-09-25 11:48:05 +010062// Conscrypt is divided into subdirectories.
Colin Cross8024b112017-10-09 13:34:58 -070063//
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.
Adam Vartaniana0509172018-06-15 19:19:20 +010073// src/test/java # Common test files for all platforms.
Colin Cross8024b112017-10-09 13:34:58 -070074// 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
Kenny Root923342a2016-09-22 17:04:35 -070087cc_defaults {
88 name: "conscrypt_global",
89
90 cflags: [
91 "-Wall",
92 "-Wextra",
93 "-Werror",
94 "-Wunused",
95 ],
96
97 srcs: [
Tobias Thierer33b649f2019-01-22 20:59:36 +000098 "common/src/jni/main/cpp/conscrypt/compatibility_close_monitor.cc",
Nathan Mittlercd7a1582017-08-10 15:17:37 -070099 "common/src/jni/main/cpp/conscrypt/jniload.cc",
100 "common/src/jni/main/cpp/conscrypt/jniutil.cc",
Nathan Mittlerf8c8d4b2017-08-02 06:57:22 -0700101 "common/src/jni/main/cpp/conscrypt/native_crypto.cc",
Nathan Mittlercd7a1582017-08-10 15:17:37 -0700102 "common/src/jni/main/cpp/conscrypt/netutil.cc",
103 "common/src/jni/main/cpp/conscrypt/trace.cc",
nmittler7782d132016-11-22 11:34:01 -0800104 ],
105
Orion Hodson9af9e362020-04-03 06:47:07 +0100106 header_libs: ["jni_headers"],
107
nmittler7782d132016-11-22 11:34:01 -0800108 local_include_dirs: [
109 "common/src/jni/main/include",
Kenny Root923342a2016-09-22 17:04:35 -0700110 ],
111
Kenny Root923342a2016-09-22 17:04:35 -0700112 compile_multilib: "both",
113 stl: "c++_static",
114}
115
116cc_defaults {
Colin Cross8024b112017-10-09 13:34:58 -0700117 name: "conscrypt_unbundled-jni-defaults",
Kenny Root923342a2016-09-22 17:04:35 -0700118
Kenny Root923342a2016-09-22 17:04:35 -0700119 local_include_dirs: [
nmittler7782d132016-11-22 11:34:01 -0800120 "common/src/jni/unbundled/include",
Kenny Root923342a2016-09-22 17:04:35 -0700121 ],
122
Orion Hodson9af9e362020-04-03 06:47:07 +0100123 header_libs: ["jni_headers"],
124
Kenny Root7bf42db2016-10-05 10:01:40 -0700125 shared_libs: [
126 "liblog",
127 ],
128
Kenny Root923342a2016-09-22 17:04:35 -0700129 static_libs: [
130 "libssl",
Colin Cross1b4bbbf2019-09-18 11:05:41 -0700131 "libcrypto_static",
Kenny Root923342a2016-09-22 17:04:35 -0700132 ],
133
134 sdk_version: "9",
135}
136
137cc_library {
138 name: "libconscrypt_jni",
Colin Cross8024b112017-10-09 13:34:58 -0700139 defaults: [
140 "conscrypt_global",
141 "conscrypt_unbundled-jni-defaults",
142 ],
Kenny Root923342a2016-09-22 17:04:35 -0700143}
144
145cc_library_host_shared {
146 name: "libconscrypt_openjdk_jni",
Colin Cross8a7ef9d2020-12-02 11:39:02 -0800147 visibility: [
148 "//build/make/tools/signapk",
149 "//tools/apksig",
Kwang-un Jin6d1d2262021-05-14 08:10:00 +0000150 "//vendor:__subpackages__",
Colin Cross8a7ef9d2020-12-02 11:39:02 -0800151 ],
Kenny Root923342a2016-09-22 17:04:35 -0700152 defaults: ["conscrypt_global"],
153
154 cflags: [
155 "-DCONSCRYPT_OPENJDK",
156 ],
157
Kenny Root923342a2016-09-22 17:04:35 -0700158 local_include_dirs: [
nmittler7782d132016-11-22 11:34:01 -0800159 "common/src/jni/unbundled/include",
Kenny Root923342a2016-09-22 17:04:35 -0700160 ],
161
Kenny Root923342a2016-09-22 17:04:35 -0700162 static_libs: [
Adam Vartanian9b0c0172017-08-16 16:44:17 +0100163 "libssl",
Colin Cross1b4bbbf2019-09-18 11:05:41 -0700164 "libcrypto_static",
Kenny Root923342a2016-09-22 17:04:35 -0700165 ],
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
Kenny Root7bf42db2016-10-05 10:01:40 -0700176 stl: "libc++_static",
Dan Willemsenc9d6d8f2019-01-04 16:13:27 -0800177
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 },
Kenny Root923342a2016-09-22 17:04:35 -0700186}
Colin Cross8024b112017-10-09 13:34:58 -0700187
188cc_binary_host {
189 name: "conscrypt_generate_constants",
190 srcs: ["constants/src/gen/cpp/generate_constants.cc"],
Chih-Hung Hsieh7a286142017-10-25 16:07:06 -0700191 cflags: [
192 "-Wall",
193 "-Werror",
194 ],
Colin Cross8024b112017-10-09 13:34:58 -0700195 shared_libs: [
196 "libcrypto",
197 "libssl",
198 ],
199}
200
201genrule {
Paul Duffin38fb8012019-09-20 15:55:58 +0100202 name: "conscrypt-unbundled_generated_constants",
Colin Cross8024b112017-10-09 13:34:58 -0700203 out: ["org/conscrypt/NativeConstants.java"],
204 cmd: "$(location conscrypt_generate_constants) > $(out)",
205 tools: ["conscrypt_generate_constants"],
206}
207
Paul Duffin31d1d152018-09-19 15:03:21 +0100208genrule {
209 name: "conscrypt_generated_constants",
210 out: ["com/android/org/conscrypt/NativeConstants.java"],
211 cmd: "$(location conscrypt_generate_constants) com.android.org.conscrypt > $(out)",
212 tools: ["conscrypt_generate_constants"],
213}
214
Neil Fuller3bf29f22018-09-24 17:35:33 +0100215filegroup {
216 name: "conscrypt_java_files",
217 srcs: [
218 "repackaged/common/src/main/java/**/*.java",
219 "repackaged/platform/src/main/java/**/*.java",
220 ":conscrypt_generated_constants",
221 ],
222}
223
Adam Vartanianacc0e552018-10-18 10:09:22 +0100224filegroup {
225 name: "conscrypt_public_api_files",
Paul Duffinc2e15cd2019-03-28 14:26:40 +0000226 srcs: ["publicapi/src/main/java/**/*.java"],
Jiyong Park956d12f2019-09-13 20:47:19 +0900227 path: "publicapi/src/main/java",
Adam Vartanianacc0e552018-10-18 10:09:22 +0100228}
229
Paul Duffin31d1d152018-09-19 15:03:21 +0100230// Create the conscrypt library from the source produced by the srcgen/generate_android_src.sh
231// script.
Colin Cross8024b112017-10-09 13:34:58 -0700232java_library {
233 name: "conscrypt",
Paul Duffinc2e15cd2019-03-28 14:26:40 +0000234 visibility: [
Paul Duffina3891b02019-06-04 12:50:59 +0100235 "//device:__subpackages__",
Paul Duffinc2e15cd2019-03-28 14:26:40 +0000236 "//system/apex/tests",
237 ":__subpackages__",
238 ],
Jiyong Park59e066f2019-12-02 13:58:22 +0900239 apex_available: [
240 "com.android.conscrypt",
241 "test_com.android.conscrypt",
242 ],
Jooyung Han82724752020-04-27 17:41:26 +0900243 // Conscrypt should support Q
244 min_sdk_version: "29",
245
Colin Cross291db152018-06-27 11:00:08 -0700246 installable: true,
Nicolas Geoffray5e442fd2020-03-31 14:03:19 +0100247 // Hostdex is only for ART testing on host: ART build file has its
248 // own hostdex support for conscrypt.
249 hostdex: false,
Neil Fullera179d2b2018-09-11 18:43:08 +0100250
Adam Vartanianacc0e552018-10-18 10:09:22 +0100251 srcs: [
252 ":conscrypt_java_files",
253 ":conscrypt_public_api_files",
254 ],
Neil Fullera179d2b2018-09-11 18:43:08 +0100255
Martin Stjernholm5b621262020-11-05 14:28:21 +0000256 libs: ["unsupportedappusage"],
Artur Satayev1c258292019-12-10 12:08:51 +0000257
Neil Fuller2f117722018-09-26 16:14:23 +0100258 // Conscrypt can be updated independently from the other core libraries so it must only depend
259 // on public SDK and intra-core APIs.
Paul Duffin1f66bef2019-06-12 11:04:35 +0100260 sdk_version: "none",
Paul Duffin8e719de2019-10-02 12:19:33 +0100261 system_modules: "art-module-intra-core-api-stubs-system-modules",
Paul Duffin9cc43592019-09-20 14:37:14 +0100262 patch_module: "java.base",
Neil Fullera179d2b2018-09-11 18:43:08 +0100263
Pete Bentleye58b81d2019-04-15 17:48:45 +0100264 target: {
Tobias Thierer52344592019-09-02 17:32:02 +0100265 // boringssl_self_test needed in both /system/bin and /apex/com.android.conscrypt/bin
266 android: {
267 required: ["boringssl_self_test"],
268 },
Pete Bentleye58b81d2019-04-15 17:48:45 +0100269 },
270
Vladimir Markof68e5092019-04-02 10:28:43 +0100271 permitted_packages: [
272 "android.net.ssl",
273 "com.android.org.conscrypt",
274 ],
Kun Niu7fd0a4b2019-07-02 10:16:55 -0700275
276 plugins: ["java_api_finder"],
Colin Cross8024b112017-10-09 13:34:58 -0700277}
278
Paul Duffin6e8a57c2021-04-19 18:00:55 +0100279// Java library for use on host, e.g. by robolectric.
280java_library {
281 name: "conscrypt-for-host",
282 visibility: [
283 "//art/build",
284 "//external/robolectric-shadows",
285 ],
286 static_libs: [
287 "conscrypt",
288 ],
289 sdk_version: "none",
290 system_modules: "none",
291}
292
Paul Duffin7d1915d2019-12-24 09:22:30 +0000293// Referenced implicitly from conscrypt.module.platform.api.
294filegroup {
295 name: "conscrypt.module.platform.api.api.public.latest",
Paul Duffinbe619e82019-10-03 13:50:13 +0100296 srcs: [
Paul Duffin7d1915d2019-12-24 09:22:30 +0000297 "api/platform/last-api.txt",
Paul Duffinbe619e82019-10-03 13:50:13 +0100298 ],
Paul Duffin7d1915d2019-12-24 09:22:30 +0000299}
Paul Duffinbe619e82019-10-03 13:50:13 +0100300
Paul Duffin7d1915d2019-12-24 09:22:30 +0000301// Referenced implicitly from conscrypt.module.platform.api.
302filegroup {
303 name: "conscrypt.module.platform.api-removed.api.public.latest",
304 srcs: [
305 "api/platform/last-removed.txt",
306 ],
Paul Duffinbe619e82019-10-03 13:50:13 +0100307}
308
Jaewoong Jung696de952021-03-09 16:08:39 -0800309// Referenced implicitly from conscrypt.module.platform.api.
310filegroup {
311 name: "conscrypt.module.platform.api-incompatibilities.api.public.latest",
312 srcs: [
313 "api/platform/last-incompatibilities.txt",
314 ],
315}
316
Paul Duffinbe619e82019-10-03 13:50:13 +0100317// A library containing the core platform API stubs of the Conscrypt module.
318//
319// Core platform APIs are only intended for use of other parts of the platform, not the
320// core library modules.
Paul Duffin7d1915d2019-12-24 09:22:30 +0000321//
322// The API specification .txt files managed by this only contain the additional
323// classes/members that are in the platform API but which are not in the public
324// API.
Pete Gillin4efd91f2020-06-12 12:28:59 +0100325//
326// Note that this entire API surface is considered stable in the sense described in
327// libcore/mmodules/core_platform_api/Android.bp.
Paul Duffin7d1915d2019-12-24 09:22:30 +0000328java_sdk_library {
329 name: "conscrypt.module.platform.api",
Paul Duffinbe619e82019-10-03 13:50:13 +0100330 visibility: [
Paul Duffina938a162019-10-04 15:34:31 +0100331 "//external/wycheproof",
Paul Duffinbe619e82019-10-03 13:50:13 +0100332 "//libcore:__subpackages__",
Martin Stjernholm25d61922020-05-07 02:01:09 +0100333 // Visibility for prebuilt conscrypt-module-sdk from the prebuilt of
334 // this module.
335 // TODO(b/155921753): Restrict this when prebuilts are in their proper
336 // locations.
337 "//prebuilts:__subpackages__",
Paul Duffinbe619e82019-10-03 13:50:13 +0100338 ],
339 srcs: [
Paul Duffin7d1915d2019-12-24 09:22:30 +0000340 ":conscrypt_java_files",
341 ],
342 api_dir: "api/platform",
343 api_only: true,
Paul Duffin0b65d012020-11-20 11:45:23 +0000344 api_lint: {
345 enabled: true,
346 },
Paul Duffin7d1915d2019-12-24 09:22:30 +0000347 droiddoc_options: [
348 "--hide-annotation libcore.api.Hide",
Pete Gillin4efd91f2020-06-12 12:28:59 +0100349 "--show-single-annotation libcore.api.CorePlatformApi\\(status=libcore.api.CorePlatformApi.Status.STABLE\\)",
Paul Duffin7d1915d2019-12-24 09:22:30 +0000350 "--skip-annotation-instance-methods=false",
Paul Duffinbe619e82019-10-03 13:50:13 +0100351 ],
352 hostdex: true,
353
354 sdk_version: "none",
Victor Chang30eded52021-06-30 22:02:26 +0100355 system_modules: "art-module-lib-api-stubs-system-modules",
Paul Duffinf9158552020-11-19 19:26:08 +0000356
Anton Hanssondea8f0b2021-06-04 19:13:01 +0100357 dist_group: "android",
358 dist_stem: "conscrypt-coreplatform",
359 // TODO: remove this when Conscrypt's @CorePlatformApi has been migrated to @SystemApi
360 unsafe_ignore_missing_latest_api: true,
Paul Duffinbe619e82019-10-03 13:50:13 +0100361}
362
Paul Duffin68a53162020-04-08 23:59:02 +0100363// A library containing the public API stubs of the Conscrypt module.
364java_sdk_library {
365 name: "conscrypt.module.public.api",
Paul Duffin6fa05ed2019-10-03 16:01:06 +0100366 visibility: [
Anton Hansson5c6183f2021-04-14 19:04:28 +0100367 "//packages/modules/common/sdk",
Paul Duffin5b5f8bf2020-03-26 15:35:44 +0000368 "//frameworks/base",
Anton Hanssonad10dff2020-09-21 17:24:46 +0100369 "//frameworks/base/api",
Paul Duffin68a53162020-04-08 23:59:02 +0100370 "//libcore",
Rayan Osseiran29b30d42020-08-26 18:08:06 +0000371 // TODO(b/165823103): Remove visiblity for IPsec once CorePlatformApi is available
372 "//packages/modules/IPsec",
Martin Stjernholm25d61922020-05-07 02:01:09 +0100373 // Visibility for prebuilt art-module-host-exports from the prebuilt of
374 // this module.
375 // TODO(b/155921753): Restrict this when prebuilts are in their proper
376 // locations.
377 "//prebuilts:__subpackages__",
Paul Duffin6fa05ed2019-10-03 16:01:06 +0100378 ],
Paul Duffin0f6ed702019-09-27 14:55:06 +0100379 srcs: [
380 ":conscrypt_public_api_files",
381 ],
Paul Duffin8c78a8d2020-11-20 22:34:12 +0000382
383 // The base name for the artifacts that are automatically published to the
384 // dist and which end up in one of the sub-directories of prebuilts/sdk.
385 // As long as this matches the name of the artifacts in prebuilts/sdk then
386 // the API will be checked for compatibility against the latest released
387 // version of the API.
388 dist_stem: "conscrypt",
389
Paul Duffin68a53162020-04-08 23:59:02 +0100390 api_dir: "api/public",
391 api_only: true,
392 droiddoc_options: [
393 // Emit nullability annotations from the source to the stub files.
394 "--include-annotations",
Paul Duffin0f6ed702019-09-27 14:55:06 +0100395 ],
Paul Duffin68a53162020-04-08 23:59:02 +0100396
397 java_version: "1.9",
398
Paul Duffin0f6ed702019-09-27 14:55:06 +0100399 sdk_version: "none",
400 system_modules: "art-module-public-api-stubs-system-modules",
Colin Cross220cbe62021-05-10 10:47:44 -0700401 dist_group: "android",
Paul Duffin0f6ed702019-09-27 14:55:06 +0100402}
403
Paul Duffin067f1c02019-12-24 20:59:54 +0000404// Referenced implicitly from conscrypt.module.intra.core.api.
405filegroup {
406 name: "conscrypt.module.intra.core.api.api.public.latest",
Paul Duffin70fd0372019-10-02 11:07:56 +0100407 srcs: [
Paul Duffin067f1c02019-12-24 20:59:54 +0000408 "api/intra/last-api.txt",
Paul Duffin70fd0372019-10-02 11:07:56 +0100409 ],
Paul Duffin067f1c02019-12-24 20:59:54 +0000410}
Paul Duffin70fd0372019-10-02 11:07:56 +0100411
Paul Duffin067f1c02019-12-24 20:59:54 +0000412// Referenced implicitly from conscrypt.module.intra.core.api.
413filegroup {
414 name: "conscrypt.module.intra.core.api-removed.api.public.latest",
415 srcs: [
416 "api/intra/last-removed.txt",
417 ],
Paul Duffin70fd0372019-10-02 11:07:56 +0100418}
419
Jaewoong Jung696de952021-03-09 16:08:39 -0800420// Referenced implicitly from conscrypt.module.intra.core.api.
421filegroup {
422 name: "conscrypt.module.intra.core.api-incompatibilities.api.public.latest",
423 srcs: [
424 "api/intra/last-incompatibilities.txt",
425 ],
426}
427
Paul Duffin70fd0372019-10-02 11:07:56 +0100428// A library containing the intra-core API stubs of the Conscrypt module.
429//
430// Intra-core APIs are only intended for the use of other core library modules.
Paul Duffin067f1c02019-12-24 20:59:54 +0000431//
432// The API specification .txt files managed by this only contain the additional
433// classes/members that are in the intra-core API but which are not the public API.
434java_sdk_library {
435 name: "conscrypt.module.intra.core.api",
Paul Duffin70fd0372019-10-02 11:07:56 +0100436 visibility: [
Paul Duffin30fbc052019-10-02 14:01:49 +0100437 "//external/okhttp",
Paul Duffin70fd0372019-10-02 11:07:56 +0100438 "//libcore:__subpackages__",
Martin Stjernholm25d61922020-05-07 02:01:09 +0100439 // Visibility for prebuilt conscrypt-module-sdk from the prebuilt of
440 // this module.
441 // TODO(b/155921753): Restrict this when prebuilts are in their proper
442 // locations.
443 "//prebuilts:__subpackages__",
Paul Duffin70fd0372019-10-02 11:07:56 +0100444 ],
445 srcs: [
Paul Duffin067f1c02019-12-24 20:59:54 +0000446 ":conscrypt_java_files",
447 ":conscrypt_public_api_files",
448 ],
449 api_dir: "api/intra",
450 api_only: true,
451 droiddoc_options: [
452 "--hide-annotation libcore.api.Hide",
453 "--show-single-annotation libcore.api.IntraCoreApi",
454 "--skip-annotation-instance-methods=false",
Paul Duffin70fd0372019-10-02 11:07:56 +0100455 ],
456
457 sdk_version: "none",
458 system_modules: "art-module-intra-core-api-stubs-system-modules",
Paul Duffinf9158552020-11-19 19:26:08 +0000459
460 // Don't copy any output files to the dist.
461 no_dist: true,
Paul Duffin70fd0372019-10-02 11:07:56 +0100462}
463
Colin Cross8024b112017-10-09 13:34:58 -0700464// Platform conscrypt crypto JNI library
465cc_defaults {
466 name: "libjavacrypto-defaults",
467
468 cflags: [
469 "-Wall",
470 "-Wextra",
471 "-Werror",
472 "-Wunused",
473 "-fvisibility=hidden",
474 ],
475
476 srcs: ["common/src/jni/main/cpp/**/*.cc"],
Orion Hodson7631f2c2020-04-11 18:30:14 +0100477 header_libs: ["jni_headers"],
Colin Cross8024b112017-10-09 13:34:58 -0700478 local_include_dirs: ["common/src/jni/main/include"],
479}
480
481// Platform conscrypt crypto JNI library
482cc_library_shared {
483 name: "libjavacrypto",
484 host_supported: true,
485 defaults: ["libjavacrypto-defaults"],
486
487 cflags: ["-DJNI_JARJAR_PREFIX=com/android/"],
Orion Hodsonb5e43bd2019-01-27 10:57:34 +0000488 header_libs: ["libnativehelper_header_only"],
Colin Cross8024b112017-10-09 13:34:58 -0700489 shared_libs: [
490 "libcrypto",
Colin Cross8024b112017-10-09 13:34:58 -0700491 "liblog",
Colin Cross8024b112017-10-09 13:34:58 -0700492 "libssl",
493 ],
494
495 target: {
496 darwin: {
497 enabled: false,
498 },
Colin Cross17b0d182020-02-19 17:04:44 -0800499 android: {
500 runtime_libs: ["libandroidio"],
501 },
502 not_windows: {
503 runtime_libs: ["libandroidio"],
504 },
Colin Cross8024b112017-10-09 13:34:58 -0700505 },
Jiyong Park59e066f2019-12-02 13:58:22 +0900506 apex_available: [
507 "com.android.conscrypt",
508 "test_com.android.conscrypt",
509 ],
Jooyung Han43945302020-04-16 18:48:26 +0900510 min_sdk_version: "29",
Colin Cross8024b112017-10-09 13:34:58 -0700511}
512
Michael Groover68c477b2020-07-16 20:32:13 -0700513// Unbundled Conscrypt jar for use by signapk and apksigner tool
Paul Duffin38fb8012019-09-20 15:55:58 +0100514//
515// Builds against standard host libraries.
516java_library_host {
517 name: "conscrypt-unbundled",
518 visibility: [
519 "//build/make/tools/signapk",
Nicolas Geoffrayffd73562020-07-29 13:54:40 +0100520 "//tools/apksig",
Paul Duffin38fb8012019-09-20 15:55:58 +0100521 ],
Colin Cross8024b112017-10-09 13:34:58 -0700522 srcs: [
523 "common/src/main/java/**/*.java",
Paul Duffin38fb8012019-09-20 15:55:58 +0100524 "openjdk/src/main/java/**/*.java",
525 ":conscrypt-unbundled_generated_constants",
Colin Cross8024b112017-10-09 13:34:58 -0700526 ],
Paul Duffin38fb8012019-09-20 15:55:58 +0100527 javacflags: ["-XDignore.symbol.file"],
Pete Bentleyd53d0802021-12-10 14:06:14 +0000528 java_version: "1.7",
Colin Cross8024b112017-10-09 13:34:58 -0700529}
530
531// Static unbundled Conscrypt crypto JNI library
532cc_library_static {
533 name: "libconscrypt_static",
534 defaults: ["libjavacrypto-defaults"],
535
536 cflags: [
537 "-DJNI_JARJAR_PREFIX=com/google/android/gms/",
538 "-DCONSCRYPT_UNBUNDLED",
539 "-DSTATIC_LIB",
540 ],
541
542 local_include_dirs: ["common/src/jni/unbundled/include"],
543
544 static_libs: [
545 "libssl",
Colin Cross1b4bbbf2019-09-18 11:05:41 -0700546 "libcrypto_static",
Colin Cross8024b112017-10-09 13:34:58 -0700547 ],
548 sdk_version: "9",
549 stl: "c++_shared",
550}
Colin Crossf569ee32018-09-11 22:38:08 -0700551
Colin Crossf569ee32018-09-11 22:38:08 -0700552// Make the conscrypt-tests library.
553java_test {
554 name: "conscrypt-tests",
Paul Duffina3891b02019-06-04 12:50:59 +0100555 visibility: [
556 "//cts/tests/libcore/luni",
Daulet Zhanguzinaa10cf72020-01-23 13:51:51 +0000557 "//external/conscrypt/apex/tests",
Paul Duffina3891b02019-06-04 12:50:59 +0100558 ],
Colin Crossf569ee32018-09-11 22:38:08 -0700559 hostdex: true,
560 srcs: [
Paul Duffin31d1d152018-09-19 15:03:21 +0100561 "repackaged/platform/src/test/java/**/*.java",
562 "repackaged/common/src/test/java/**/*.java",
Paul Duffin31d1d152018-09-19 15:03:21 +0100563 "repackaged/testing/src/main/java/**/*.java",
Adam Vartanianacc0e552018-10-18 10:09:22 +0100564 "publicapi/src/test/java/**/*.java",
Colin Crossf569ee32018-09-11 22:38:08 -0700565 ],
566 java_resource_dirs: [
Paul Duffin31d1d152018-09-19 15:03:21 +0100567 // Resource directories do not need repackaging.
Colin Crossf569ee32018-09-11 22:38:08 -0700568 "openjdk/src/test/resources",
Pete Bentley3914ba72019-09-27 11:57:50 +0100569 "common/src/test/resources",
Colin Crossf569ee32018-09-11 22:38:08 -0700570 ],
Neil Fuller27e690d2018-10-10 12:58:01 +0100571
Paul Duffin1f66bef2019-06-12 11:04:35 +0100572 sdk_version: "none",
Paul Duffin8e719de2019-10-02 12:19:33 +0100573 system_modules: "art-module-intra-core-api-stubs-system-modules",
Colin Crossf569ee32018-09-11 22:38:08 -0700574 libs: [
Neil Fuller719e00f2018-10-19 09:32:43 +0100575 "conscrypt",
Paul Duffin880d5422019-09-24 16:22:04 +0100576 "core-test-rules",
Colin Crossf569ee32018-09-11 22:38:08 -0700577 "junit",
578 "mockito-target-minus-junit4",
Pete Bentley506e6f62020-12-07 13:45:14 +0000579 "framework-statsd.stubs.module_lib",
Colin Crossf569ee32018-09-11 22:38:08 -0700580 ],
Neil Fuller27e690d2018-10-10 12:58:01 +0100581
Colin Crossf569ee32018-09-11 22:38:08 -0700582 static_libs: [
Colin Crossf569ee32018-09-11 22:38:08 -0700583 "bouncycastle-unbundled",
584 "bouncycastle-bcpkix-unbundled",
585 "bouncycastle-ocsp-unbundled",
586 ],
587 javacflags: [
588 "-Xmaxwarns 9999999",
589 //"-Xlint:all",
590 //"-Xlint:-serial,-deprecation,-unchecked",
591 ],
592
Yo Chiang8e450f02020-08-07 04:22:18 +0000593 target: {
594 host: {
595 required: ["libjavacrypto"],
596 },
597 darwin: {
598 // required module "libjavacrypto" is disabled on darwin
599 enabled: false,
600 },
601 },
Pete Bentleyd53d0802021-12-10 14:06:14 +0000602 java_version: "1.7",
Colin Crossf569ee32018-09-11 22:38:08 -0700603}
604
605// Make the conscrypt-benchmarks library.
606java_test {
607 name: "conscrypt-benchmarks",
608 srcs: [
Paul Duffin31d1d152018-09-19 15:03:21 +0100609 "repackaged/testing/src/main/java/**/*.java",
610 "repackaged/benchmark-base/src/main/java/**/*.java",
611 "repackaged/benchmark-android/src/main/java/**/*.java",
Colin Crossf569ee32018-09-11 22:38:08 -0700612 ],
Paul Duffin1f66bef2019-06-12 11:04:35 +0100613 sdk_version: "none",
Paul Duffin8e719de2019-10-02 12:19:33 +0100614 system_modules: "art-module-intra-core-api-stubs-system-modules",
Colin Crossf569ee32018-09-11 22:38:08 -0700615 libs: [
Neil Fuller719e00f2018-10-19 09:32:43 +0100616 "conscrypt",
Colin Crossf569ee32018-09-11 22:38:08 -0700617 "junit",
618 "bouncycastle-unbundled",
619 "bouncycastle-bcpkix-unbundled",
620 "bouncycastle-ocsp-unbundled",
621 "caliper-api-target",
622 ],
Neil Fuller5d272352018-10-12 22:10:57 +0100623
Colin Crossf569ee32018-09-11 22:38:08 -0700624 javacflags: [
625 "-Xmaxwarns 9999999",
626 //"-Xlint:all",
627 //"-Xlint:-serial,-deprecation,-unchecked",
628 ],
629
Yo Chiang8e450f02020-08-07 04:22:18 +0000630 target: {
631 host: {
632 required: ["libjavacrypto"],
633 },
634 darwin: {
635 // required module "libjavacrypto" is disabled on darwin
636 enabled: false,
637 },
638 },
Pete Bentleyd53d0802021-12-10 14:06:14 +0000639 java_version: "1.7",
Colin Crossf569ee32018-09-11 22:38:08 -0700640}
Paul Duffin403d5052019-11-25 19:56:01 +0000641
642// Device SDK exposed by the Conscrypt module.
643sdk {
644 name: "conscrypt-module-sdk",
Paul Duffin1fda0f92021-05-21 13:15:42 +0100645 bootclasspath_fragments: [
646 "com.android.conscrypt-bootclasspath-fragment",
Paul Duffinec02a052021-04-19 18:00:55 +0100647 ],
Paul Duffin83431472020-04-09 21:44:10 +0100648 java_sdk_libs: [
649 "conscrypt.module.public.api",
650 "conscrypt.module.intra.core.api",
651 "conscrypt.module.platform.api",
Paul Duffin403d5052019-11-25 19:56:01 +0000652 ],
653 native_shared_libs: [
654 "libconscrypt_jni",
655 ],
Paul Duffin403d5052019-11-25 19:56:01 +0000656}
Paul Duffinb3fbef32019-12-09 13:42:13 +0000657
Paul Duffin414f5232019-12-16 20:30:20 +0000658// Host tools exported by the Conscrypt module.
659module_exports {
660 name: "conscrypt-module-host-exports",
Paul Duffinb3fbef32019-12-09 13:42:13 +0000661 host_supported: true,
662 device_supported: false,
663 java_libs: [
664 "conscrypt-unbundled",
665 ],
Nicolas Geoffray42c20732020-04-23 15:10:56 +0100666 native_shared_libs: [
667 "libconscrypt_openjdk_jni",
668 ],
Paul Duffinb3fbef32019-12-09 13:42:13 +0000669}
Paul Duffin538cb632019-12-09 13:41:08 +0000670
671// Test libraries exposed by the Conscrypt module.
672module_exports {
673 name: "conscrypt-module-test-exports",
Nicolas Geoffraye3e93e72020-04-03 09:05:56 +0000674 host_supported: true,
675 target: {
676 android: {
677 java_libs: [
678 // For use by robolectric and ART tests.
Paul Duffin6e8a57c2021-04-19 18:00:55 +0100679 "conscrypt-for-host",
Nicolas Geoffraye3e93e72020-04-03 09:05:56 +0000680 ],
681 java_tests: [
682 // For use by CTS
683 "conscrypt-tests",
684 ],
Nicolas Geoffray7d5b4822020-04-08 18:09:51 +0100685 // TODO: Remove this when we resolve b/151303681.
686 native_shared_libs: [
687 "libjavacrypto",
688 ],
Nicolas Geoffraye3e93e72020-04-03 09:05:56 +0000689 },
690 darwin: {
691 enabled: false,
692 },
693 // For use by ART tests on host.
694 not_windows: {
695 native_shared_libs: [
696 "libjavacrypto",
697 ],
698 },
699 },
Paul Duffin538cb632019-12-09 13:41:08 +0000700}