xref: /aosp_15_r20/bootable/recovery/minadbd/Android.bp (revision e7c364b630b241adcb6c7726a21055250b91fdac)
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
15package {
16    default_team: "trendy_team_native_tools_libraries",
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 "bootable_recovery_license"
20    // to get the below license kinds:
21    //   SPDX-license-identifier-Apache-2.0
22    default_applicable_licenses: ["bootable_recovery_license"],
23}
24
25cc_defaults {
26    name: "minadbd_defaults",
27
28    cflags: [
29        "-DADB_HOST=0",
30        "-Wall",
31        "-Werror",
32    ],
33
34    cpp_std: "experimental",
35
36    include_dirs: [
37        "packages/modules/adb",
38    ],
39
40    header_libs: [
41        "libminadbd_headers",
42    ],
43}
44
45// `libminadbd_services` is analogous to the `libadbd_services` for regular `adbd`, but providing
46// the sideload service only.
47cc_library_static {
48    name: "libminadbd_services",
49    recovery_available: true,
50
51    defaults: [
52        "minadbd_defaults",
53        "librecovery_utils_defaults",
54    ],
55
56    srcs: [
57        "fuse_adb_provider.cpp",
58        "minadbd_services.cpp",
59    ],
60
61    static_libs: [
62        "librecovery_utils",
63        "libotautil",
64    ],
65
66    shared_libs: [
67        "libadbd",
68        "libbase",
69        "libcrypto",
70        "libfusesideload",
71    ],
72}
73
74cc_library_headers {
75    name: "libminadbd_headers",
76    recovery_available: true,
77    export_include_dirs: [
78        "include",
79    ],
80    // adb_install.cpp
81    visibility: [
82        "//bootable/recovery/install",
83    ],
84}
85
86cc_binary {
87    name: "minadbd",
88    recovery: true,
89
90    defaults: [
91        "minadbd_defaults",
92        "libadbd_binary_dependencies",
93        "librecovery_utils_defaults",
94    ],
95
96    srcs: [
97        "minadbd.cpp",
98    ],
99
100    shared_libs: [
101        "android.hardware.health-V4-ndk", // from librecovery_utils
102        "libbase",
103        "libcrypto",
104    ],
105
106    static_libs: [
107        "libminadbd_services",
108        "libfusesideload",
109        "librecovery_utils",
110    ],
111
112    required: [
113        "adbd_system_api_recovery",
114    ],
115}
116
117cc_test {
118    name: "minadbd_test",
119    isolated: true,
120
121    defaults: [
122        "minadbd_defaults",
123        "librecovery_utils_defaults",
124        "libadbd_binary_dependencies",
125    ],
126
127    srcs: [
128        "fuse_adb_provider_test.cpp",
129        "minadbd_services_test.cpp",
130    ],
131
132    static_libs: [
133        "android.hardware.health-V4-ndk", // from librecovery_utils
134        "libminadbd_services",
135        "libfusesideload",
136        "librecovery_utils",
137        "libotautil",
138    ],
139
140    shared_libs: [
141        "libbase",
142        "libcrypto",
143        "libcutils",
144        "liblog",
145    ],
146
147    test_suites: [
148        "device-tests",
149    ],
150    require_root: true,
151}
152