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    host_supported: true,
34    hostdex: true,
35    target: {
36        android: {
37            product_variables: {
38                pdk: {
39                    enabled: false,
40                },
41            },
42        },
43    },
44}
45
46// non-jarjar version to build okhttp-tests
47java_library_static {
48    name: "bouncycastle-unbundled",
49    defaults: ["bouncycastle-defaults"],
50
51    srcs: ["bcprov/src/main/java/**/*.java"],
52    exclude_srcs: [
53        "bcprov/src/main/java/org/bouncycastle/asn1/ocsp/**/*.java",
54    ],
55
56    sdk_version: "9",
57    java_version: "1.7",
58}
59
60java_library {
61    name: "bouncycastle",
62    defaults: ["bouncycastle-defaults"],
63
64    static_libs: ["bouncycastle-unbundled"],
65    no_framework_libs: true,
66    java_version: "1.7",
67
68    target: {
69        android: {
70            jarjar_rules: "jarjar-rules.txt",
71        },
72    },
73}
74
75// A guaranteed unstripped version of bouncycastle.
76// The build system may or may not strip the bouncycastle jar, but this one will
77// not be stripped. See b/24535627.
78java_library {
79    name: "bouncycastle-testdex",
80    defaults: ["bouncycastle-defaults"],
81
82    static_libs: ["bouncycastle-unbundled"],
83    no_framework_libs: true,
84    jarjar_rules: "jarjar-rules.txt",
85    java_version: "1.7",
86}
87
88// PKIX classes used for testing
89java_library_static {
90    name: "bouncycastle-bcpkix",
91    defaults: ["bouncycastle-defaults"],
92
93    static_libs: ["bouncycastle-bcpkix-unbundled"],
94    no_framework_libs: true,
95    java_version: "1.7",
96
97    target: {
98        android: {
99            jarjar_rules: "jarjar-rules.txt",
100        },
101    },
102}
103
104java_library_static {
105    name: "bouncycastle-bcpkix-unbundled",
106    defaults: [
107        "bouncycastle-defaults",
108    ],
109    libs: [ "bouncycastle-unbundled" ],
110    sdk_version: "9",
111    srcs: ["bcpkix/src/main/java/**/*.java"],
112    exclude_srcs: ["bcpkix/src/main/java/org/bouncycastle/cert/ocsp/**/*.java"],
113}
114
115
116// OCSP classes used for testing
117java_library_static {
118    name: "bouncycastle-ocsp",
119    defaults: ["bouncycastle-defaults"],
120
121    static_libs: ["bouncycastle-ocsp-unbundled"],
122    jarjar_rules: "jarjar-rules.txt",
123    java_version: "1.7",
124    no_framework_libs: true,
125}
126
127java_library_static {
128    name: "bouncycastle-ocsp-unbundled",
129    defaults: [
130        "bouncycastle-defaults",
131    ],
132    libs: [ "bouncycastle-unbundled",
133            "bouncycastle-bcpkix-unbundled" ],
134    sdk_version: "9",
135    srcs: [
136        "bcpkix/src/main/java/org/bouncycastle/cert/ocsp/**/*.java",
137        "bcprov/src/main/java/org/bouncycastle/asn1/ocsp/**/*.java",
138    ],
139}
140
141// For compatibilityy with old bouncycastle-host and bouncycastle-bcpkix-host names
142java_library_host {
143    name: "bouncycastle-host",
144    static_libs: ["bouncycastle"],
145}
146
147java_library_host {
148    name: "bouncycastle-bcpkix-host",
149    static_libs: ["bouncycastle-bcpkix"],
150}
151