Kenny Root | 923342a | 2016-09-22 17:04:35 -0700 | [diff] [blame] | 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 | |
Paul Duffin | a3891b0 | 2019-06-04 12:50:59 +0100 | [diff] [blame] | 17 | package { |
| 18 | default_visibility: [ |
| 19 | ":__subpackages__", |
| 20 | ], |
| 21 | } |
| 22 | |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 23 | // |
| 24 | // Definitions for building the Conscrypt Java library, native code, |
| 25 | // and associated tests. |
| 26 | // |
| 27 | |
Neil Fuller | de17f74 | 2018-09-25 11:48:05 +0100 | [diff] [blame] | 28 | // Conscrypt is divided into subdirectories. |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 29 | // |
| 30 | // The structure is: |
| 31 | // |
| 32 | // constants/ |
| 33 | // src/gen # Generates NativeConstants.java. |
| 34 | // common/ |
| 35 | // src/main/java # Common Java source for all platforms. |
| 36 | // src/jni/ |
| 37 | // main # Common C++ source for all platforms. |
| 38 | // unbundled # C++ source used for OpenJDK and unbundled Android. |
Adam Vartanian | a050917 | 2018-06-15 19:19:20 +0100 | [diff] [blame] | 39 | // src/test/java # Common test files for all platforms. |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 40 | // android/ |
| 41 | // src/main/java # Java source for unbundled Android. |
| 42 | // openjdk/ |
| 43 | // src/main/java # Java source for OpenJDK. |
| 44 | // src/test |
| 45 | // java/ # Java source for common tests. |
| 46 | // resources/ # Support files for tests |
| 47 | // platform/ |
| 48 | // src/main/java # Java source for bundled Android. |
| 49 | // src/test |
| 50 | // java/ # Java source for bundled tests. |
| 51 | // |
| 52 | |
Kenny Root | 923342a | 2016-09-22 17:04:35 -0700 | [diff] [blame] | 53 | cc_defaults { |
| 54 | name: "conscrypt_global", |
| 55 | |
| 56 | cflags: [ |
| 57 | "-Wall", |
| 58 | "-Wextra", |
| 59 | "-Werror", |
| 60 | "-Wunused", |
| 61 | ], |
| 62 | |
| 63 | srcs: [ |
Tobias Thierer | 33b649f | 2019-01-22 20:59:36 +0000 | [diff] [blame] | 64 | "common/src/jni/main/cpp/conscrypt/compatibility_close_monitor.cc", |
Nathan Mittler | cd7a158 | 2017-08-10 15:17:37 -0700 | [diff] [blame] | 65 | "common/src/jni/main/cpp/conscrypt/jniload.cc", |
| 66 | "common/src/jni/main/cpp/conscrypt/jniutil.cc", |
Nathan Mittler | f8c8d4b | 2017-08-02 06:57:22 -0700 | [diff] [blame] | 67 | "common/src/jni/main/cpp/conscrypt/native_crypto.cc", |
Nathan Mittler | cd7a158 | 2017-08-10 15:17:37 -0700 | [diff] [blame] | 68 | "common/src/jni/main/cpp/conscrypt/netutil.cc", |
| 69 | "common/src/jni/main/cpp/conscrypt/trace.cc", |
nmittler | 7782d13 | 2016-11-22 11:34:01 -0800 | [diff] [blame] | 70 | ], |
| 71 | |
| 72 | local_include_dirs: [ |
| 73 | "common/src/jni/main/include", |
Kenny Root | 923342a | 2016-09-22 17:04:35 -0700 | [diff] [blame] | 74 | ], |
| 75 | |
Kenny Root | 923342a | 2016-09-22 17:04:35 -0700 | [diff] [blame] | 76 | compile_multilib: "both", |
| 77 | stl: "c++_static", |
| 78 | } |
| 79 | |
| 80 | cc_defaults { |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 81 | name: "conscrypt_unbundled-jni-defaults", |
Kenny Root | 923342a | 2016-09-22 17:04:35 -0700 | [diff] [blame] | 82 | |
Kenny Root | 923342a | 2016-09-22 17:04:35 -0700 | [diff] [blame] | 83 | local_include_dirs: [ |
nmittler | 7782d13 | 2016-11-22 11:34:01 -0800 | [diff] [blame] | 84 | "common/src/jni/unbundled/include", |
Kenny Root | 923342a | 2016-09-22 17:04:35 -0700 | [diff] [blame] | 85 | ], |
| 86 | |
Kenny Root | 7bf42db | 2016-10-05 10:01:40 -0700 | [diff] [blame] | 87 | shared_libs: [ |
| 88 | "liblog", |
| 89 | ], |
| 90 | |
Kenny Root | 923342a | 2016-09-22 17:04:35 -0700 | [diff] [blame] | 91 | static_libs: [ |
| 92 | "libssl", |
Colin Cross | 1b4bbbf | 2019-09-18 11:05:41 -0700 | [diff] [blame] | 93 | "libcrypto_static", |
Kenny Root | 923342a | 2016-09-22 17:04:35 -0700 | [diff] [blame] | 94 | ], |
| 95 | |
| 96 | sdk_version: "9", |
| 97 | } |
| 98 | |
| 99 | cc_library { |
| 100 | name: "libconscrypt_jni", |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 101 | defaults: [ |
| 102 | "conscrypt_global", |
| 103 | "conscrypt_unbundled-jni-defaults", |
| 104 | ], |
Kenny Root | 923342a | 2016-09-22 17:04:35 -0700 | [diff] [blame] | 105 | } |
| 106 | |
| 107 | cc_library_host_shared { |
| 108 | name: "libconscrypt_openjdk_jni", |
| 109 | defaults: ["conscrypt_global"], |
| 110 | |
| 111 | cflags: [ |
| 112 | "-DCONSCRYPT_OPENJDK", |
| 113 | ], |
| 114 | |
Kenny Root | 923342a | 2016-09-22 17:04:35 -0700 | [diff] [blame] | 115 | local_include_dirs: [ |
nmittler | 7782d13 | 2016-11-22 11:34:01 -0800 | [diff] [blame] | 116 | "common/src/jni/unbundled/include", |
Kenny Root | 923342a | 2016-09-22 17:04:35 -0700 | [diff] [blame] | 117 | ], |
| 118 | |
Kenny Root | 923342a | 2016-09-22 17:04:35 -0700 | [diff] [blame] | 119 | static_libs: [ |
Adam Vartanian | 9b0c017 | 2017-08-16 16:44:17 +0100 | [diff] [blame] | 120 | "libssl", |
Colin Cross | 1b4bbbf | 2019-09-18 11:05:41 -0700 | [diff] [blame] | 121 | "libcrypto_static", |
Kenny Root | 923342a | 2016-09-22 17:04:35 -0700 | [diff] [blame] | 122 | ], |
| 123 | |
| 124 | // TODO: b/26097626. ASAN breaks use of this library in JVM. |
| 125 | // Re-enable sanitization when the issue with making clients of this library |
| 126 | // preload ASAN runtime is resolved. Without that, clients are getting runtime |
| 127 | // errors due to unresolved ASAN symbols, such as |
| 128 | // __asan_option_detect_stack_use_after_return. |
| 129 | sanitize: { |
| 130 | never: true, |
| 131 | }, |
| 132 | |
Kenny Root | 7bf42db | 2016-10-05 10:01:40 -0700 | [diff] [blame] | 133 | stl: "libc++_static", |
Dan Willemsen | c9d6d8f | 2019-01-04 16:13:27 -0800 | [diff] [blame] | 134 | |
| 135 | // The post-build signing tools need signapk.jar and its shared libs |
| 136 | multilib: { |
| 137 | lib64: { |
| 138 | dist: { |
| 139 | targets: ["droidcore"], |
| 140 | }, |
| 141 | }, |
| 142 | }, |
Kenny Root | 923342a | 2016-09-22 17:04:35 -0700 | [diff] [blame] | 143 | } |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 144 | |
| 145 | cc_binary_host { |
| 146 | name: "conscrypt_generate_constants", |
| 147 | srcs: ["constants/src/gen/cpp/generate_constants.cc"], |
Chih-Hung Hsieh | 7a28614 | 2017-10-25 16:07:06 -0700 | [diff] [blame] | 148 | cflags: [ |
| 149 | "-Wall", |
| 150 | "-Werror", |
| 151 | ], |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 152 | shared_libs: [ |
| 153 | "libcrypto", |
| 154 | "libssl", |
| 155 | ], |
| 156 | } |
| 157 | |
| 158 | genrule { |
Paul Duffin | 38fb801 | 2019-09-20 15:55:58 +0100 | [diff] [blame] | 159 | name: "conscrypt-unbundled_generated_constants", |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 160 | out: ["org/conscrypt/NativeConstants.java"], |
| 161 | cmd: "$(location conscrypt_generate_constants) > $(out)", |
| 162 | tools: ["conscrypt_generate_constants"], |
| 163 | } |
| 164 | |
Paul Duffin | 31d1d15 | 2018-09-19 15:03:21 +0100 | [diff] [blame] | 165 | genrule { |
| 166 | name: "conscrypt_generated_constants", |
| 167 | out: ["com/android/org/conscrypt/NativeConstants.java"], |
| 168 | cmd: "$(location conscrypt_generate_constants) com.android.org.conscrypt > $(out)", |
| 169 | tools: ["conscrypt_generate_constants"], |
| 170 | } |
| 171 | |
Neil Fuller | 3bf29f2 | 2018-09-24 17:35:33 +0100 | [diff] [blame] | 172 | filegroup { |
| 173 | name: "conscrypt_java_files", |
| 174 | srcs: [ |
| 175 | "repackaged/common/src/main/java/**/*.java", |
| 176 | "repackaged/platform/src/main/java/**/*.java", |
| 177 | ":conscrypt_generated_constants", |
| 178 | ], |
| 179 | } |
| 180 | |
Adam Vartanian | acc0e55 | 2018-10-18 10:09:22 +0100 | [diff] [blame] | 181 | filegroup { |
| 182 | name: "conscrypt_public_api_files", |
Paul Duffin | c2e15cd | 2019-03-28 14:26:40 +0000 | [diff] [blame] | 183 | srcs: ["publicapi/src/main/java/**/*.java"], |
Jiyong Park | 956d12f | 2019-09-13 20:47:19 +0900 | [diff] [blame] | 184 | path: "publicapi/src/main/java", |
Adam Vartanian | acc0e55 | 2018-10-18 10:09:22 +0100 | [diff] [blame] | 185 | } |
| 186 | |
Paul Duffin | 31d1d15 | 2018-09-19 15:03:21 +0100 | [diff] [blame] | 187 | // Create the conscrypt library from the source produced by the srcgen/generate_android_src.sh |
| 188 | // script. |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 189 | java_library { |
| 190 | name: "conscrypt", |
Paul Duffin | c2e15cd | 2019-03-28 14:26:40 +0000 | [diff] [blame] | 191 | visibility: [ |
Paul Duffin | a3891b0 | 2019-06-04 12:50:59 +0100 | [diff] [blame] | 192 | "//art/build", |
| 193 | "//device:__subpackages__", |
Paul Duffin | c2e15cd | 2019-03-28 14:26:40 +0000 | [diff] [blame] | 194 | "//external/robolectric-shadows", |
Paul Duffin | c2e15cd | 2019-03-28 14:26:40 +0000 | [diff] [blame] | 195 | "//system/apex/tests", |
| 196 | ":__subpackages__", |
| 197 | ], |
Jiyong Park | 59e066f | 2019-12-02 13:58:22 +0900 | [diff] [blame] | 198 | apex_available: [ |
| 199 | "com.android.conscrypt", |
| 200 | "test_com.android.conscrypt", |
| 201 | ], |
Jooyung Han | 1d64355 | 2020-04-16 18:48:26 +0900 | [diff] [blame] | 202 | // Conscrypt should support Q |
| 203 | min_sdk_version: "29", |
| 204 | |
Colin Cross | 291db15 | 2018-06-27 11:00:08 -0700 | [diff] [blame] | 205 | installable: true, |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 206 | hostdex: true, |
Neil Fuller | a179d2b | 2018-09-11 18:43:08 +0100 | [diff] [blame] | 207 | |
Adam Vartanian | acc0e55 | 2018-10-18 10:09:22 +0100 | [diff] [blame] | 208 | srcs: [ |
| 209 | ":conscrypt_java_files", |
| 210 | ":conscrypt_public_api_files", |
| 211 | ], |
Neil Fuller | a179d2b | 2018-09-11 18:43:08 +0100 | [diff] [blame] | 212 | |
Artur Satayev | 1c25829 | 2019-12-10 12:08:51 +0000 | [diff] [blame] | 213 | libs: ["unsupportedappusage"], |
| 214 | |
Neil Fuller | 2f11772 | 2018-09-26 16:14:23 +0100 | [diff] [blame] | 215 | // Conscrypt can be updated independently from the other core libraries so it must only depend |
| 216 | // on public SDK and intra-core APIs. |
Paul Duffin | 1f66bef | 2019-06-12 11:04:35 +0100 | [diff] [blame] | 217 | sdk_version: "none", |
Paul Duffin | 8e719de | 2019-10-02 12:19:33 +0100 | [diff] [blame] | 218 | system_modules: "art-module-intra-core-api-stubs-system-modules", |
Paul Duffin | 9cc4359 | 2019-09-20 14:37:14 +0100 | [diff] [blame] | 219 | patch_module: "java.base", |
Neil Fuller | a179d2b | 2018-09-11 18:43:08 +0100 | [diff] [blame] | 220 | |
Pete Bentley | e58b81d | 2019-04-15 17:48:45 +0100 | [diff] [blame] | 221 | // Workaround for b/124476339: libjavacrypto is required for both APEX and |
| 222 | // hostdex builds, but adding a top-level required property results in |
| 223 | // it being installed to /system on Android. |
| 224 | // TODO(b/124476339): move required back to a top level property |
| 225 | target: { |
Tobias Thierer | 5234459 | 2019-09-02 17:32:02 +0100 | [diff] [blame] | 226 | // boringssl_self_test needed in both /system/bin and /apex/com.android.conscrypt/bin |
| 227 | android: { |
| 228 | required: ["boringssl_self_test"], |
| 229 | }, |
Pete Bentley | e58b81d | 2019-04-15 17:48:45 +0100 | [diff] [blame] | 230 | hostdex: { |
| 231 | required: ["libjavacrypto"], |
Paul Duffin | 85d46c0 | 2019-06-25 12:06:26 +0100 | [diff] [blame] | 232 | }, |
Pete Bentley | e58b81d | 2019-04-15 17:48:45 +0100 | [diff] [blame] | 233 | }, |
| 234 | |
Vladimir Marko | f68e509 | 2019-04-02 10:28:43 +0100 | [diff] [blame] | 235 | permitted_packages: [ |
| 236 | "android.net.ssl", |
| 237 | "com.android.org.conscrypt", |
| 238 | ], |
Kun Niu | 7fd0a4b | 2019-07-02 10:16:55 -0700 | [diff] [blame] | 239 | |
| 240 | plugins: ["java_api_finder"], |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 241 | } |
| 242 | |
Paul Duffin | 7d1915d | 2019-12-24 09:22:30 +0000 | [diff] [blame] | 243 | // Referenced implicitly from conscrypt.module.platform.api. |
| 244 | filegroup { |
| 245 | name: "conscrypt.module.platform.api.api.public.latest", |
Paul Duffin | be619e8 | 2019-10-03 13:50:13 +0100 | [diff] [blame] | 246 | srcs: [ |
Paul Duffin | 7d1915d | 2019-12-24 09:22:30 +0000 | [diff] [blame] | 247 | "api/platform/last-api.txt", |
Paul Duffin | be619e8 | 2019-10-03 13:50:13 +0100 | [diff] [blame] | 248 | ], |
Paul Duffin | 7d1915d | 2019-12-24 09:22:30 +0000 | [diff] [blame] | 249 | } |
Paul Duffin | be619e8 | 2019-10-03 13:50:13 +0100 | [diff] [blame] | 250 | |
Paul Duffin | 7d1915d | 2019-12-24 09:22:30 +0000 | [diff] [blame] | 251 | // Referenced implicitly from conscrypt.module.platform.api. |
| 252 | filegroup { |
| 253 | name: "conscrypt.module.platform.api-removed.api.public.latest", |
| 254 | srcs: [ |
| 255 | "api/platform/last-removed.txt", |
| 256 | ], |
Paul Duffin | be619e8 | 2019-10-03 13:50:13 +0100 | [diff] [blame] | 257 | } |
| 258 | |
| 259 | // A library containing the core platform API stubs of the Conscrypt module. |
| 260 | // |
| 261 | // Core platform APIs are only intended for use of other parts of the platform, not the |
| 262 | // core library modules. |
Paul Duffin | 7d1915d | 2019-12-24 09:22:30 +0000 | [diff] [blame] | 263 | // |
| 264 | // The API specification .txt files managed by this only contain the additional |
| 265 | // classes/members that are in the platform API but which are not in the public |
| 266 | // API. |
| 267 | java_sdk_library { |
| 268 | name: "conscrypt.module.platform.api", |
Paul Duffin | be619e8 | 2019-10-03 13:50:13 +0100 | [diff] [blame] | 269 | visibility: [ |
Paul Duffin | a938a16 | 2019-10-04 15:34:31 +0100 | [diff] [blame] | 270 | "//external/wycheproof", |
Paul Duffin | be619e8 | 2019-10-03 13:50:13 +0100 | [diff] [blame] | 271 | "//libcore:__subpackages__", |
| 272 | ], |
| 273 | srcs: [ |
Paul Duffin | 7d1915d | 2019-12-24 09:22:30 +0000 | [diff] [blame] | 274 | ":conscrypt_java_files", |
| 275 | ], |
| 276 | api_dir: "api/platform", |
| 277 | api_only: true, |
| 278 | droiddoc_options: [ |
| 279 | "--hide-annotation libcore.api.Hide", |
| 280 | "--show-single-annotation libcore.api.CorePlatformApi", |
| 281 | "--skip-annotation-instance-methods=false", |
Paul Duffin | be619e8 | 2019-10-03 13:50:13 +0100 | [diff] [blame] | 282 | ], |
| 283 | hostdex: true, |
| 284 | |
| 285 | sdk_version: "none", |
| 286 | system_modules: "art-module-platform-api-stubs-system-modules", |
| 287 | } |
| 288 | |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 289 | // A guaranteed unstripped version of conscrypt. |
| 290 | // The build system may or may not strip the conscrypt jar, but this one will |
| 291 | // not be stripped. See b/24535627. |
| 292 | java_library { |
| 293 | name: "conscrypt-testdex", |
Colin Cross | 291db15 | 2018-06-27 11:00:08 -0700 | [diff] [blame] | 294 | installable: true, |
Neil Fuller | a179d2b | 2018-09-11 18:43:08 +0100 | [diff] [blame] | 295 | |
Paul Duffin | 31d1d15 | 2018-09-19 15:03:21 +0100 | [diff] [blame] | 296 | static_libs: ["conscrypt"], |
Vladimir Marko | 9f0e6cc | 2018-12-04 10:20:45 +0000 | [diff] [blame] | 297 | dex_preopt: { |
| 298 | enabled: false, |
| 299 | }, |
Neil Fuller | a179d2b | 2018-09-11 18:43:08 +0100 | [diff] [blame] | 300 | |
Paul Duffin | 4f625e2 | 2019-06-12 13:45:01 +0100 | [diff] [blame] | 301 | sdk_version: "core_platform", |
Neil Fuller | a179d2b | 2018-09-11 18:43:08 +0100 | [diff] [blame] | 302 | |
Neil Fuller | a179d2b | 2018-09-11 18:43:08 +0100 | [diff] [blame] | 303 | required: ["libjavacrypto"], |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 304 | } |
| 305 | |
Paul Duffin | b5abd28 | 2020-04-08 23:59:02 +0100 | [diff] [blame] | 306 | // Referenced implicitly from conscrypt.module.public.api. |
| 307 | filegroup { |
| 308 | name: "conscrypt.module.public.api.api.public.latest", |
| 309 | srcs: [ |
| 310 | "api/public/last-api.txt", |
| 311 | ], |
| 312 | } |
| 313 | |
| 314 | // Referenced implicitly from conscrypt.module.public.api. |
| 315 | filegroup { |
| 316 | name: "conscrypt.module.public.api-removed.api.public.latest", |
| 317 | srcs: [ |
| 318 | "api/public/last-removed.txt", |
| 319 | ], |
| 320 | } |
| 321 | |
| 322 | // A library containing the public API stubs of the Conscrypt module. |
| 323 | java_sdk_library { |
| 324 | name: "conscrypt.module.public.api", |
Paul Duffin | 6fa05ed | 2019-10-03 16:01:06 +0100 | [diff] [blame] | 325 | visibility: [ |
Paul Duffin | 064457d | 2020-03-26 15:35:44 +0000 | [diff] [blame] | 326 | "//frameworks/base", |
Paul Duffin | b5abd28 | 2020-04-08 23:59:02 +0100 | [diff] [blame] | 327 | "//libcore", |
Paul Duffin | 6fa05ed | 2019-10-03 16:01:06 +0100 | [diff] [blame] | 328 | ], |
Paul Duffin | 0f6ed70 | 2019-09-27 14:55:06 +0100 | [diff] [blame] | 329 | srcs: [ |
| 330 | ":conscrypt_public_api_files", |
| 331 | ], |
Paul Duffin | b5abd28 | 2020-04-08 23:59:02 +0100 | [diff] [blame] | 332 | api_dir: "api/public", |
| 333 | api_only: true, |
| 334 | droiddoc_options: [ |
| 335 | // Emit nullability annotations from the source to the stub files. |
| 336 | "--include-annotations", |
Paul Duffin | 0f6ed70 | 2019-09-27 14:55:06 +0100 | [diff] [blame] | 337 | ], |
Paul Duffin | b5abd28 | 2020-04-08 23:59:02 +0100 | [diff] [blame] | 338 | |
| 339 | java_version: "1.9", |
| 340 | |
Paul Duffin | 0f6ed70 | 2019-09-27 14:55:06 +0100 | [diff] [blame] | 341 | sdk_version: "none", |
| 342 | system_modules: "art-module-public-api-stubs-system-modules", |
| 343 | } |
| 344 | |
Paul Duffin | 067f1c0 | 2019-12-24 20:59:54 +0000 | [diff] [blame] | 345 | // Referenced implicitly from conscrypt.module.intra.core.api. |
| 346 | filegroup { |
| 347 | name: "conscrypt.module.intra.core.api.api.public.latest", |
Paul Duffin | 70fd037 | 2019-10-02 11:07:56 +0100 | [diff] [blame] | 348 | srcs: [ |
Paul Duffin | 067f1c0 | 2019-12-24 20:59:54 +0000 | [diff] [blame] | 349 | "api/intra/last-api.txt", |
Paul Duffin | 70fd037 | 2019-10-02 11:07:56 +0100 | [diff] [blame] | 350 | ], |
Paul Duffin | 067f1c0 | 2019-12-24 20:59:54 +0000 | [diff] [blame] | 351 | } |
Paul Duffin | 70fd037 | 2019-10-02 11:07:56 +0100 | [diff] [blame] | 352 | |
Paul Duffin | 067f1c0 | 2019-12-24 20:59:54 +0000 | [diff] [blame] | 353 | // Referenced implicitly from conscrypt.module.intra.core.api. |
| 354 | filegroup { |
| 355 | name: "conscrypt.module.intra.core.api-removed.api.public.latest", |
| 356 | srcs: [ |
| 357 | "api/intra/last-removed.txt", |
| 358 | ], |
Paul Duffin | 70fd037 | 2019-10-02 11:07:56 +0100 | [diff] [blame] | 359 | } |
| 360 | |
| 361 | // A library containing the intra-core API stubs of the Conscrypt module. |
| 362 | // |
| 363 | // Intra-core APIs are only intended for the use of other core library modules. |
Paul Duffin | 067f1c0 | 2019-12-24 20:59:54 +0000 | [diff] [blame] | 364 | // |
| 365 | // The API specification .txt files managed by this only contain the additional |
| 366 | // classes/members that are in the intra-core API but which are not the public API. |
| 367 | java_sdk_library { |
| 368 | name: "conscrypt.module.intra.core.api", |
Paul Duffin | 70fd037 | 2019-10-02 11:07:56 +0100 | [diff] [blame] | 369 | visibility: [ |
Paul Duffin | 30fbc05 | 2019-10-02 14:01:49 +0100 | [diff] [blame] | 370 | "//external/okhttp", |
Paul Duffin | 70fd037 | 2019-10-02 11:07:56 +0100 | [diff] [blame] | 371 | "//libcore:__subpackages__", |
| 372 | ], |
| 373 | srcs: [ |
Paul Duffin | 067f1c0 | 2019-12-24 20:59:54 +0000 | [diff] [blame] | 374 | ":conscrypt_java_files", |
| 375 | ":conscrypt_public_api_files", |
| 376 | ], |
| 377 | api_dir: "api/intra", |
| 378 | api_only: true, |
| 379 | droiddoc_options: [ |
| 380 | "--hide-annotation libcore.api.Hide", |
| 381 | "--show-single-annotation libcore.api.IntraCoreApi", |
| 382 | "--skip-annotation-instance-methods=false", |
Paul Duffin | 70fd037 | 2019-10-02 11:07:56 +0100 | [diff] [blame] | 383 | ], |
| 384 | |
| 385 | sdk_version: "none", |
| 386 | system_modules: "art-module-intra-core-api-stubs-system-modules", |
| 387 | } |
| 388 | |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 389 | // Platform conscrypt crypto JNI library |
| 390 | cc_defaults { |
| 391 | name: "libjavacrypto-defaults", |
| 392 | |
| 393 | cflags: [ |
| 394 | "-Wall", |
| 395 | "-Wextra", |
| 396 | "-Werror", |
| 397 | "-Wunused", |
| 398 | "-fvisibility=hidden", |
| 399 | ], |
| 400 | |
| 401 | srcs: ["common/src/jni/main/cpp/**/*.cc"], |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 402 | local_include_dirs: ["common/src/jni/main/include"], |
| 403 | } |
| 404 | |
| 405 | // Platform conscrypt crypto JNI library |
| 406 | cc_library_shared { |
| 407 | name: "libjavacrypto", |
| 408 | host_supported: true, |
| 409 | defaults: ["libjavacrypto-defaults"], |
| 410 | |
| 411 | cflags: ["-DJNI_JARJAR_PREFIX=com/android/"], |
Orion Hodson | b5e43bd | 2019-01-27 10:57:34 +0000 | [diff] [blame] | 412 | header_libs: ["libnativehelper_header_only"], |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 413 | shared_libs: [ |
| 414 | "libcrypto", |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 415 | "liblog", |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 416 | "libssl", |
| 417 | ], |
| 418 | |
| 419 | target: { |
| 420 | darwin: { |
| 421 | enabled: false, |
| 422 | }, |
Colin Cross | 17b0d18 | 2020-02-19 17:04:44 -0800 | [diff] [blame] | 423 | android: { |
| 424 | runtime_libs: ["libandroidio"], |
| 425 | }, |
| 426 | not_windows: { |
| 427 | runtime_libs: ["libandroidio"], |
| 428 | }, |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 429 | }, |
Jiyong Park | 59e066f | 2019-12-02 13:58:22 +0900 | [diff] [blame] | 430 | apex_available: [ |
| 431 | "com.android.conscrypt", |
| 432 | "test_com.android.conscrypt", |
| 433 | ], |
Jooyung Han | 1d64355 | 2020-04-16 18:48:26 +0900 | [diff] [blame] | 434 | min_sdk_version: "29", |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 435 | } |
| 436 | |
Michael Groover | 68c477b | 2020-07-16 20:32:13 -0700 | [diff] [blame] | 437 | // Unbundled Conscrypt jar for use by signapk and apksigner tool |
Paul Duffin | 38fb801 | 2019-09-20 15:55:58 +0100 | [diff] [blame] | 438 | // |
| 439 | // Builds against standard host libraries. |
| 440 | java_library_host { |
| 441 | name: "conscrypt-unbundled", |
| 442 | visibility: [ |
| 443 | "//build/make/tools/signapk", |
Michael Groover | 68c477b | 2020-07-16 20:32:13 -0700 | [diff] [blame] | 444 | "//tools/apksig", |
Paul Duffin | 38fb801 | 2019-09-20 15:55:58 +0100 | [diff] [blame] | 445 | ], |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 446 | srcs: [ |
| 447 | "common/src/main/java/**/*.java", |
Paul Duffin | 38fb801 | 2019-09-20 15:55:58 +0100 | [diff] [blame] | 448 | "openjdk/src/main/java/**/*.java", |
| 449 | ":conscrypt-unbundled_generated_constants", |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 450 | ], |
Paul Duffin | 38fb801 | 2019-09-20 15:55:58 +0100 | [diff] [blame] | 451 | javacflags: ["-XDignore.symbol.file"], |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 452 | java_version: "1.7", |
| 453 | } |
| 454 | |
| 455 | // Static unbundled Conscrypt crypto JNI library |
| 456 | cc_library_static { |
| 457 | name: "libconscrypt_static", |
| 458 | defaults: ["libjavacrypto-defaults"], |
| 459 | |
| 460 | cflags: [ |
| 461 | "-DJNI_JARJAR_PREFIX=com/google/android/gms/", |
| 462 | "-DCONSCRYPT_UNBUNDLED", |
| 463 | "-DSTATIC_LIB", |
| 464 | ], |
| 465 | |
| 466 | local_include_dirs: ["common/src/jni/unbundled/include"], |
| 467 | |
| 468 | static_libs: [ |
| 469 | "libssl", |
Colin Cross | 1b4bbbf | 2019-09-18 11:05:41 -0700 | [diff] [blame] | 470 | "libcrypto_static", |
Colin Cross | 8024b11 | 2017-10-09 13:34:58 -0700 | [diff] [blame] | 471 | ], |
| 472 | sdk_version: "9", |
| 473 | stl: "c++_shared", |
| 474 | } |
Colin Cross | f569ee3 | 2018-09-11 22:38:08 -0700 | [diff] [blame] | 475 | |
Colin Cross | f569ee3 | 2018-09-11 22:38:08 -0700 | [diff] [blame] | 476 | // Make the conscrypt-tests library. |
| 477 | java_test { |
| 478 | name: "conscrypt-tests", |
Paul Duffin | a3891b0 | 2019-06-04 12:50:59 +0100 | [diff] [blame] | 479 | visibility: [ |
| 480 | "//cts/tests/libcore/luni", |
Automerger Merge Worker | 400af96 | 2020-02-24 12:55:30 +0000 | [diff] [blame] | 481 | "//external/conscrypt/apex/tests", |
Paul Duffin | a3891b0 | 2019-06-04 12:50:59 +0100 | [diff] [blame] | 482 | ], |
Colin Cross | f569ee3 | 2018-09-11 22:38:08 -0700 | [diff] [blame] | 483 | hostdex: true, |
| 484 | srcs: [ |
Paul Duffin | 31d1d15 | 2018-09-19 15:03:21 +0100 | [diff] [blame] | 485 | "repackaged/platform/src/test/java/**/*.java", |
| 486 | "repackaged/common/src/test/java/**/*.java", |
Paul Duffin | 31d1d15 | 2018-09-19 15:03:21 +0100 | [diff] [blame] | 487 | "repackaged/testing/src/main/java/**/*.java", |
Adam Vartanian | acc0e55 | 2018-10-18 10:09:22 +0100 | [diff] [blame] | 488 | "publicapi/src/test/java/**/*.java", |
Colin Cross | f569ee3 | 2018-09-11 22:38:08 -0700 | [diff] [blame] | 489 | ], |
| 490 | java_resource_dirs: [ |
Paul Duffin | 31d1d15 | 2018-09-19 15:03:21 +0100 | [diff] [blame] | 491 | // Resource directories do not need repackaging. |
Colin Cross | f569ee3 | 2018-09-11 22:38:08 -0700 | [diff] [blame] | 492 | "openjdk/src/test/resources", |
Pete Bentley | 3914ba7 | 2019-09-27 11:57:50 +0100 | [diff] [blame] | 493 | "common/src/test/resources", |
Colin Cross | f569ee3 | 2018-09-11 22:38:08 -0700 | [diff] [blame] | 494 | ], |
Neil Fuller | 27e690d | 2018-10-10 12:58:01 +0100 | [diff] [blame] | 495 | |
Paul Duffin | 1f66bef | 2019-06-12 11:04:35 +0100 | [diff] [blame] | 496 | sdk_version: "none", |
Paul Duffin | 8e719de | 2019-10-02 12:19:33 +0100 | [diff] [blame] | 497 | system_modules: "art-module-intra-core-api-stubs-system-modules", |
Colin Cross | f569ee3 | 2018-09-11 22:38:08 -0700 | [diff] [blame] | 498 | libs: [ |
Neil Fuller | 719e00f | 2018-10-19 09:32:43 +0100 | [diff] [blame] | 499 | "conscrypt", |
Paul Duffin | 880d542 | 2019-09-24 16:22:04 +0100 | [diff] [blame] | 500 | "core-test-rules", |
Colin Cross | f569ee3 | 2018-09-11 22:38:08 -0700 | [diff] [blame] | 501 | "junit", |
| 502 | "mockito-target-minus-junit4", |
| 503 | ], |
Neil Fuller | 27e690d | 2018-10-10 12:58:01 +0100 | [diff] [blame] | 504 | |
Colin Cross | f569ee3 | 2018-09-11 22:38:08 -0700 | [diff] [blame] | 505 | static_libs: [ |
Colin Cross | f569ee3 | 2018-09-11 22:38:08 -0700 | [diff] [blame] | 506 | "bouncycastle-unbundled", |
| 507 | "bouncycastle-bcpkix-unbundled", |
| 508 | "bouncycastle-ocsp-unbundled", |
| 509 | ], |
| 510 | javacflags: [ |
| 511 | "-Xmaxwarns 9999999", |
| 512 | //"-Xlint:all", |
| 513 | //"-Xlint:-serial,-deprecation,-unchecked", |
| 514 | ], |
| 515 | |
| 516 | required: ["libjavacrypto"], |
Colin Cross | f569ee3 | 2018-09-11 22:38:08 -0700 | [diff] [blame] | 517 | java_version: "1.7", |
| 518 | } |
| 519 | |
| 520 | // Make the conscrypt-benchmarks library. |
| 521 | java_test { |
| 522 | name: "conscrypt-benchmarks", |
| 523 | srcs: [ |
Paul Duffin | 31d1d15 | 2018-09-19 15:03:21 +0100 | [diff] [blame] | 524 | "repackaged/testing/src/main/java/**/*.java", |
| 525 | "repackaged/benchmark-base/src/main/java/**/*.java", |
| 526 | "repackaged/benchmark-android/src/main/java/**/*.java", |
Colin Cross | f569ee3 | 2018-09-11 22:38:08 -0700 | [diff] [blame] | 527 | ], |
Paul Duffin | 1f66bef | 2019-06-12 11:04:35 +0100 | [diff] [blame] | 528 | sdk_version: "none", |
Paul Duffin | 8e719de | 2019-10-02 12:19:33 +0100 | [diff] [blame] | 529 | system_modules: "art-module-intra-core-api-stubs-system-modules", |
Colin Cross | f569ee3 | 2018-09-11 22:38:08 -0700 | [diff] [blame] | 530 | libs: [ |
Neil Fuller | 719e00f | 2018-10-19 09:32:43 +0100 | [diff] [blame] | 531 | "conscrypt", |
Colin Cross | f569ee3 | 2018-09-11 22:38:08 -0700 | [diff] [blame] | 532 | "junit", |
| 533 | "bouncycastle-unbundled", |
| 534 | "bouncycastle-bcpkix-unbundled", |
| 535 | "bouncycastle-ocsp-unbundled", |
| 536 | "caliper-api-target", |
| 537 | ], |
Neil Fuller | 5d27235 | 2018-10-12 22:10:57 +0100 | [diff] [blame] | 538 | |
Colin Cross | f569ee3 | 2018-09-11 22:38:08 -0700 | [diff] [blame] | 539 | javacflags: [ |
| 540 | "-Xmaxwarns 9999999", |
| 541 | //"-Xlint:all", |
| 542 | //"-Xlint:-serial,-deprecation,-unchecked", |
| 543 | ], |
| 544 | |
| 545 | required: ["libjavacrypto"], |
Colin Cross | f569ee3 | 2018-09-11 22:38:08 -0700 | [diff] [blame] | 546 | java_version: "1.7", |
| 547 | } |
Paul Duffin | 403d505 | 2019-11-25 19:56:01 +0000 | [diff] [blame] | 548 | |
| 549 | // Device SDK exposed by the Conscrypt module. |
| 550 | sdk { |
| 551 | name: "conscrypt-module-sdk", |
Paul Duffin | 990ebd1 | 2020-04-09 21:44:10 +0100 | [diff] [blame] | 552 | java_sdk_libs: [ |
| 553 | "conscrypt.module.public.api", |
| 554 | "conscrypt.module.intra.core.api", |
| 555 | "conscrypt.module.platform.api", |
Paul Duffin | 403d505 | 2019-11-25 19:56:01 +0000 | [diff] [blame] | 556 | ], |
| 557 | native_shared_libs: [ |
| 558 | "libconscrypt_jni", |
| 559 | ], |
Paul Duffin | 403d505 | 2019-11-25 19:56:01 +0000 | [diff] [blame] | 560 | } |
Paul Duffin | b3fbef3 | 2019-12-09 13:42:13 +0000 | [diff] [blame] | 561 | |
Paul Duffin | 414f523 | 2019-12-16 20:30:20 +0000 | [diff] [blame] | 562 | // Host tools exported by the Conscrypt module. |
| 563 | module_exports { |
| 564 | name: "conscrypt-module-host-exports", |
Paul Duffin | b3fbef3 | 2019-12-09 13:42:13 +0000 | [diff] [blame] | 565 | host_supported: true, |
| 566 | device_supported: false, |
| 567 | java_libs: [ |
| 568 | "conscrypt-unbundled", |
| 569 | ], |
| 570 | } |
Paul Duffin | 538cb63 | 2019-12-09 13:41:08 +0000 | [diff] [blame] | 571 | |
| 572 | // Test libraries exposed by the Conscrypt module. |
| 573 | module_exports { |
| 574 | name: "conscrypt-module-test-exports", |
| 575 | java_libs: [ |
| 576 | // For use by robolectric. |
| 577 | "conscrypt", |
| 578 | // For use by art tests |
| 579 | "conscrypt-testdex", |
| 580 | ], |
| 581 | java_tests: [ |
| 582 | // For use by CTS |
| 583 | "conscrypt-tests", |
| 584 | ], |
| 585 | } |