1// 2// Copyright (C) 2010 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 17java_defaults { 18 name: "bouncycastle-errorprone-defaults", 19 errorprone: { 20 javacflags: [ 21 "-Xep:MissingOverride:OFF", // Ignore missing @Override. 22 ], 23 }, 24} 25 26// These cannot build in the PDK, because the PDK requires all libraries 27// compile against SDK versions. 28java_defaults { 29 name: "bouncycastle-defaults", 30 defaults: [ 31 "bouncycastle-errorprone-defaults", 32 ], 33 hostdex: true, 34 target: { 35 android: { 36 product_variables: { 37 pdk: { 38 enabled: false, 39 }, 40 }, 41 }, 42 }, 43} 44 45// A bouncycastle library in the original org.bouncycastle package for use 46// outside of the platform. e.g. for host or in unbundled apps. 47java_library_static { 48 name: "bouncycastle-unbundled", 49 defaults: ["bouncycastle-defaults"], 50 host_supported: true, 51 52 srcs: ["bcprov/src/main/java/**/*.java"], 53 exclude_srcs: [ 54 "bcprov/src/main/java/org/bouncycastle/asn1/ocsp/**/*.java", 55 ], 56 57 sdk_version: "core_current", 58 java_version: "1.7", 59} 60 61// The src files for bouncycastle, used to generate core platform / intra-core 62// API stubs. 63filegroup { 64 name: "bouncycastle_java_files", 65 srcs: ["repackaged/bcprov/src/main/java/**/*.java"], 66} 67 68// A bouncycastle library repackaged in com.android.org.bouncycastle for use 69// in the Android platform where it is important not to conflict with the 70// original org.bouncycastle package. 71java_library { 72 name: "bouncycastle", 73 defaults: ["bouncycastle-defaults"], 74 installable: true, 75 76 srcs: [":bouncycastle_java_files"], 77 78 no_standard_libs: true, 79 libs: [ 80 "core-all", 81 ], 82 system_modules: "core-all-system-modules", 83} 84 85// A guaranteed unstripped version of bouncycastle. 86// The build system may or may not strip the bouncycastle jar, but this one will 87// not be stripped. See b/24535627. 88java_library { 89 name: "bouncycastle-testdex", 90 defaults: ["bouncycastle-defaults"], 91 installable: true, 92 93 srcs: [":bouncycastle_java_files"], 94 95 no_standard_libs: true, 96 libs: [ 97 "core-all", 98 ], 99 dex_preopt: { 100 enabled: false, 101 }, 102 system_modules: "core-all-system-modules", 103 java_version: "1.7", 104} 105 106// Bouncycastle PKIX classes in the original org.bouncycastle package for use 107// outside of the platform. e.g. for host or in unbundled apps / CTS tests. 108java_library_static { 109 name: "bouncycastle-bcpkix-unbundled", 110 defaults: ["bouncycastle-defaults"], 111 host_supported: true, 112 113 srcs: ["bcpkix/src/main/java/**/*.java"], 114 exclude_srcs: ["bcpkix/src/main/java/org/bouncycastle/cert/ocsp/**/*.java"], 115 libs: ["bouncycastle-unbundled"], 116 117 sdk_version: "core_current", 118} 119 120// Bouncycastle OCSP classes in the original org.bouncycastle package for use 121// outside of the platform. e.g. for host or in unbundled apps / CTS tests. 122java_library_static { 123 name: "bouncycastle-ocsp-unbundled", 124 defaults: ["bouncycastle-defaults"], 125 host_supported: true, 126 127 srcs: [ 128 "bcpkix/src/main/java/org/bouncycastle/cert/ocsp/**/*.java", 129 "bcprov/src/main/java/org/bouncycastle/asn1/ocsp/**/*.java", 130 ], 131 libs: [ "bouncycastle-unbundled", 132 "bouncycastle-bcpkix-unbundled" 133 ], 134 135 sdk_version: "core_current", 136} 137 138// For compatibility with old bouncycastle-host name. 139java_library_host { 140 name: "bouncycastle-host", 141 static_libs: ["bouncycastle-unbundled"], 142} 143 144// For compatibility with old bouncycastle-bcpkix-host name. 145java_library_host { 146 name: "bouncycastle-bcpkix-host", 147 static_libs: ["bouncycastle-bcpkix-unbundled"], 148} 149