xref: /aosp_15_r20/system/apex/tests/testdata/sharedlibs/build/com.android.apex.test.sharedlibs/Android.bp (revision 33f3758387333dbd2962d7edbd98681940d895da)
1// Copyright (C) 2020 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.
14package {
15    default_applicable_licenses: ["Android-Apache-2.0"],
16}
17
18apex_key {
19    name: "com.android.apex.test.sharedlibs.key",
20    public_key: "com.android.apex.test.sharedlibs.avbpubkey",
21    private_key: "com.android.apex.test.sharedlibs.pem",
22}
23
24android_app_certificate {
25    name: "com.android.apex.test.sharedlibs.certificate",
26    certificate: "com.android.apex.test.sharedlibs",
27}
28
29apex {
30    name: "com.android.apex.test.sharedlibs_stub",
31    manifest: "manifest.json",
32    file_contexts: ":apex.test-file_contexts",
33    key: "com.android.apex.test.sharedlibs.key",
34    installable: false,
35    // We want to force libc++.so to be available in this stub APEX, so put an empty binary.
36    binaries: ["noop"],
37    updatable: false,
38    compile_multilib: "both",
39    multilib: {
40        both: {
41            binaries: [
42                "noop",
43            ],
44        },
45    },
46    // This test apex is used by shared_libs_repack, which works with only ext4.
47    payload_fs_type: "ext4",
48}
49
50java_genrule {
51    name: "com.android.apex.test.sharedlibs_generated",
52    out: ["com.android.apex.test.sharedlibs_generated.apex"],
53    defaults: ["apexer_test_host_tools_list"],
54    dist: {
55        targets: ["sharedlibs_test"],
56    },
57    srcs: [
58        ":com.android.apex.test.sharedlibs_stub",
59        "com.android.apex.test.sharedlibs.avbpubkey",
60        "com.android.apex.test.sharedlibs.pem",
61        "com.android.apex.test.sharedlibs.pk8",
62        "com.android.apex.test.sharedlibs.x509.pem",
63    ],
64    tools: [
65        "shared_libs_repack",
66    ],
67    cmd: "$(location shared_libs_repack) " +
68        " --mode sharedlibs" +
69        " --key $(location com.android.apex.test.sharedlibs.pem)" +
70        " --input $(location :com.android.apex.test.sharedlibs_stub)" +
71        " --output $(genDir)/com.android.apex.test.sharedlibs_generated.apex" +
72        " --pk8key $(location com.android.apex.test.sharedlibs.pk8)" +
73        " --pubkey $(location com.android.apex.test.sharedlibs.avbpubkey)" +
74        " --x509key $(location com.android.apex.test.sharedlibs.x509.pem)" +
75        " --tmpdir $(genDir)",
76}
77