xref: /aosp_15_r20/external/conscrypt/apex/Android.bp (revision cd0cc2e34ba52cdf454361820a14d744e4bd531d)
1// Copyright (C) 2018 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Defaults shared between real and test versions of the APEX.
16package {
17    // See: http://go/android-license-faq
18    // A large-scale-change added 'default_applicable_licenses' to import
19    // all of the 'license_kinds' from "external_conscrypt_license"
20    // to get the below license kinds:
21    //   SPDX-license-identifier-Apache-2.0
22    default_applicable_licenses: ["external_conscrypt_license"],
23}
24
25apex_defaults {
26    name: "com.android.conscrypt-defaults",
27    androidManifest: ":com.android.conscrypt-androidManifest",
28    compile_multilib: "both",
29    bootclasspath_fragments: ["com.android.conscrypt-bootclasspath-fragment"],
30    jni_libs: ["libjavacrypto"],
31    prebuilts: ["current_sdkinfo"],
32    multilib: {
33        both: {
34            binaries: ["boringssl_self_test"],
35        },
36    },
37    key: "apex.conscrypt.key",
38    certificate: ":com.android.conscrypt.certificate",
39    // Indicates that pre-installed version of this apex can be compressed.
40    // Whether it actually will be compressed is controlled on per-device basis.
41    compressible: true,
42
43    // IMPORTANT: q-launched-dcla-enabled-apex-module enables the build system to make
44    // sure the package compatible to Android 10 in two ways:
45    // - build the APEX package compatible to Android 10
46    //   so that the package can be installed.
47    // - build artifacts (lib/javalib/bin) against Android 10 SDK
48    //   so that the artifacts can run.
49    defaults: ["q-launched-dcla-enabled-apex-module"],
50}
51
52filegroup {
53    name: "com.android.conscrypt-androidManifest",
54    srcs: ["AndroidManifest.xml"],
55}
56
57apex_key {
58    name: "apex.conscrypt.key",
59    public_key: "com.android.conscrypt.avbpubkey",
60    private_key: "com.android.conscrypt.pem",
61}
62
63android_app_certificate {
64    name: "com.android.conscrypt.certificate",
65    certificate: "com.android.conscrypt",
66}
67
68prebuilt_etc {
69    name: "com.android.conscrypt.ld.config.txt",
70    src: "ld.config.txt",
71    filename: "ld.config.txt",
72    installable: false,
73}
74
75// Production APEX
76apex {
77    name: "com.android.conscrypt",
78    visibility: [
79        "//external/conscrypt",
80        "//vendor:__subpackages__",
81        "//packages/modules/common/build",
82    ],
83    defaults: ["com.android.conscrypt-defaults"],
84    manifest: "apex_manifest.json",
85    binaries: ["boringssl_self_test"],
86    prebuilts: [
87        "com.android.conscrypt.ld.config.txt",
88        "cacerts_apex",
89    ],
90    min_sdk_version: "30",
91}
92
93// Encapsulate the contributions made by the com.android.conscrypt to the bootclasspath.
94bootclasspath_fragment {
95    name: "com.android.conscrypt-bootclasspath-fragment",
96    contents: ["conscrypt"],
97    apex_available: ["com.android.conscrypt"],
98    // The bootclasspath_fragments that provide APIs on which this depends.
99    fragments: [
100        {
101            apex: "com.android.art",
102            module: "art-bootclasspath-fragment",
103        },
104    ],
105    // The APIs provided by this fragment.
106    api: {
107        stub_libs: [
108            "conscrypt.module.public.api",
109        ],
110    },
111    // The core platform APIs provided by this fragment.
112    core_platform_api: {
113        stub_libs: [
114            "conscrypt.module.platform.api",
115        ],
116    },
117    // Additional hidden API flags that override the default flags derived
118    // from the api stub libraries.
119    hidden_api: {
120        max_target_o_low_priority: ["hiddenapi/hiddenapi-max-target-o-low-priority.txt"],
121
122        // This module does not contain any split packages.
123        split_packages: [],
124
125        // The following packages and all their subpackages currently only
126        // contain classes from this bootclasspath_fragment. Listing a package
127        // here won't prevent other bootclasspath modules from adding classes in
128        // any of those packages but it will prevent them from adding those
129        // classes into an API surface, e.g. public, system, etc.. Doing so will
130        // result in a build failure due to inconsistent flags.
131        package_prefixes: [
132            "android.net.ssl",
133            "com.android.org.conscrypt",
134        ],
135    },
136}
137