GuangHui Liu | 3599439 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 1 | // Copyright (C) 2017 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 | |
Bob Badour | 4a6774b | 2021-02-12 19:46:09 -0800 | [diff] [blame] | 15 | package { |
Aditya Choudhary | 1d87c97 | 2024-02-02 13:55:51 +0000 | [diff] [blame] | 16 | default_team: "trendy_team_native_tools_libraries", |
Bob Badour | 4a6774b | 2021-02-12 19:46:09 -0800 | [diff] [blame] | 17 | default_applicable_licenses: ["packages_modules_adb_license"], |
| 18 | } |
| 19 | |
| 20 | // Added automatically by a large-scale-change |
| 21 | // See: http://go/android-license-faq |
| 22 | license { |
| 23 | name: "packages_modules_adb_license", |
| 24 | visibility: [":__subpackages__"], |
| 25 | license_kinds: [ |
| 26 | "SPDX-license-identifier-Apache-2.0", |
| 27 | ], |
| 28 | license_text: [ |
| 29 | "NOTICE", |
| 30 | ], |
| 31 | } |
| 32 | |
Joshua Duong | b5c3bec | 2020-07-17 14:14:00 -0700 | [diff] [blame] | 33 | tidy_errors = [ |
| 34 | "-*", |
| 35 | "bugprone-inaccurate-erase", |
Joshua Duong | f4ba8d7 | 2021-01-13 12:18:15 -0800 | [diff] [blame] | 36 | "bugprone-use-after-move", |
Joshua Duong | b5c3bec | 2020-07-17 14:14:00 -0700 | [diff] [blame] | 37 | ] |
| 38 | |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 39 | cc_defaults { |
| 40 | name: "adb_defaults", |
| 41 | |
| 42 | cflags: [ |
| 43 | "-Wall", |
| 44 | "-Wextra", |
| 45 | "-Werror", |
Jiyong Park | f2721bc | 2020-09-18 16:35:06 +0900 | [diff] [blame] | 46 | "-Wno-non-virtual-dtor", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 47 | "-Wno-unused-parameter", |
| 48 | "-Wno-missing-field-initializers", |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 49 | "-Wthread-safety", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 50 | "-Wvla", |
Aditya Choudhary | 1d87c97 | 2024-02-02 13:55:51 +0000 | [diff] [blame] | 51 | "-DADB_HOST=1", // overridden by adbd_defaults |
Josh Gao | 90228a6 | 2019-04-25 14:04:57 -0700 | [diff] [blame] | 52 | "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION=1", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 53 | ], |
Josh Gao | 3edf807 | 2018-11-16 15:40:16 -0800 | [diff] [blame] | 54 | cpp_std: "experimental", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 55 | |
Josh Gao | 66766f8 | 2018-02-27 15:49:23 -0800 | [diff] [blame] | 56 | use_version_lib: true, |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 57 | compile_multilib: "first", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 58 | |
| 59 | target: { |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 60 | darwin: { |
| 61 | host_ldlibs: [ |
| 62 | "-lpthread", |
| 63 | "-framework CoreFoundation", |
| 64 | "-framework IOKit", |
Elliott Hughes | 038a7ac | 2022-08-12 15:26:44 +0000 | [diff] [blame] | 65 | "-framework Security", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 66 | "-lobjc", |
| 67 | ], |
Joshua Duong | 28fd4e5 | 2021-03-19 12:12:35 -0700 | [diff] [blame] | 68 | cflags: [ |
| 69 | // Required, to use the new IPv6 Sockets options introduced by RFC 3542. |
| 70 | "-D__APPLE_USE_RFC_3542", |
| 71 | ], |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 72 | }, |
| 73 | |
| 74 | windows: { |
| 75 | cflags: [ |
| 76 | // Define windows.h and tchar.h Unicode preprocessor symbols so that |
| 77 | // CreateFile(), _tfopen(), etc. map to versions that take wchar_t*, breaking the |
| 78 | // build if you accidentally pass char*. Fix by calling like: |
| 79 | // std::wstring path_wide; |
| 80 | // if (!android::base::UTF8ToWide(path_utf8, &path_wide)) { /* error handling */ } |
| 81 | // CreateFileW(path_wide.c_str()); |
| 82 | "-DUNICODE=1", |
| 83 | "-D_UNICODE=1", |
| 84 | |
Elliott Hughes | c229a72 | 2018-12-03 09:02:18 -0800 | [diff] [blame] | 85 | // Unlike on Linux, -std=gnu++ doesn't set _GNU_SOURCE on Windows. |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 86 | "-D_GNU_SOURCE", |
Josh Gao | 96049b9 | 2018-03-23 13:03:28 -0700 | [diff] [blame] | 87 | |
| 88 | // MinGW hides some things behind _POSIX_SOURCE. |
| 89 | "-D_POSIX_SOURCE", |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 90 | |
Josh Gao | c3b6403 | 2019-04-17 16:57:43 -0700 | [diff] [blame] | 91 | // libusb uses __stdcall on a variadic function, which gets ignored. |
| 92 | "-Wno-ignored-attributes", |
| 93 | |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 94 | // Not supported yet. |
| 95 | "-Wno-thread-safety", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 96 | ], |
Josh Gao | ea7b95a | 2018-03-23 15:37:20 -0700 | [diff] [blame] | 97 | |
| 98 | host_ldlibs: [ |
| 99 | "-lws2_32", |
| 100 | "-lgdi32", |
| 101 | "-luserenv", |
Joshua Duong | f4ba8d7 | 2021-01-13 12:18:15 -0800 | [diff] [blame] | 102 | "-liphlpapi", |
Josh Gao | ea7b95a | 2018-03-23 15:37:20 -0700 | [diff] [blame] | 103 | ], |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 104 | }, |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 105 | }, |
Joshua Duong | b5c3bec | 2020-07-17 14:14:00 -0700 | [diff] [blame] | 106 | |
| 107 | tidy: true, |
| 108 | tidy_checks: tidy_errors, |
| 109 | tidy_checks_as_errors: tidy_errors, |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 110 | } |
Pirama Arumuga Nainar | 7aa2023 | 2018-06-01 11:31:38 -0700 | [diff] [blame] | 111 | |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 112 | cc_defaults { |
| 113 | name: "adbd_defaults", |
| 114 | defaults: ["adb_defaults"], |
| 115 | |
Aditya Choudhary | 1d87c97 | 2024-02-02 13:55:51 +0000 | [diff] [blame] | 116 | cflags: [ |
| 117 | "-UADB_HOST", |
| 118 | "-DADB_HOST=0", |
| 119 | ], |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 120 | } |
| 121 | |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 122 | cc_defaults { |
| 123 | name: "host_adbd_supported", |
| 124 | |
| 125 | host_supported: true, |
| 126 | target: { |
| 127 | linux: { |
| 128 | enabled: true, |
| 129 | host_ldlibs: [ |
| 130 | "-lresolv", // b64_pton |
| 131 | "-lutil", // forkpty |
| 132 | ], |
| 133 | }, |
| 134 | darwin: { |
| 135 | enabled: false, |
| 136 | }, |
| 137 | windows: { |
| 138 | enabled: false, |
| 139 | }, |
| 140 | }, |
| 141 | } |
| 142 | |
Liz Kammer | 6836b05 | 2021-01-22 13:39:03 -0500 | [diff] [blame] | 143 | soong_config_module_type_import { |
| 144 | from: "system/apex/Android.bp", |
| 145 | module_types: ["library_linking_strategy_cc_defaults"], |
| 146 | } |
| 147 | |
| 148 | library_linking_strategy_cc_defaults { |
Josh Gao | dc20c2f | 2020-03-27 19:41:59 -0700 | [diff] [blame] | 149 | name: "libadbd_binary_dependencies", |
| 150 | static_libs: [ |
| 151 | "libadb_crypto", |
| 152 | "libadb_pairing_connection", |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 153 | "libadb_protos", |
Joshua Duong | 93b407c | 2020-07-30 16:34:29 -0700 | [diff] [blame] | 154 | "libadb_sysdeps", |
Josh Gao | dc20c2f | 2020-03-27 19:41:59 -0700 | [diff] [blame] | 155 | "libadb_tls_connection", |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 156 | "libadbconnection_server", |
Josh Gao | dc20c2f | 2020-03-27 19:41:59 -0700 | [diff] [blame] | 157 | "libadbd", |
| 158 | "libadbd_core", |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 159 | "libapp_processes_protos_lite", |
Josh Gao | dc20c2f | 2020-03-27 19:41:59 -0700 | [diff] [blame] | 160 | "libasyncio", |
| 161 | "libbrotli", |
Josh Gao | 7e3f811 | 2021-04-09 17:32:58 -0700 | [diff] [blame] | 162 | "libcrypto_utils", |
Josh Gao | dc20c2f | 2020-03-27 19:41:59 -0700 | [diff] [blame] | 163 | "libcutils_sockets", |
| 164 | "libdiagnose_usb", |
| 165 | "libmdnssd", |
Josh Gao | dc20c2f | 2020-03-27 19:41:59 -0700 | [diff] [blame] | 166 | "libprotobuf-cpp-lite", |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 167 | "libzstd", |
Josh Gao | dc20c2f | 2020-03-27 19:41:59 -0700 | [diff] [blame] | 168 | ], |
| 169 | |
| 170 | shared_libs: [ |
| 171 | "libadbd_auth", |
| 172 | "libadbd_fs", |
Josh Gao | dc20c2f | 2020-03-27 19:41:59 -0700 | [diff] [blame] | 173 | "liblog", |
| 174 | "libselinux", |
| 175 | ], |
| 176 | |
Aditya Choudhary | 1d87c97 | 2024-02-02 13:55:51 +0000 | [diff] [blame] | 177 | soong_config_variables: { |
Liz Kammer | 6836b05 | 2021-01-22 13:39:03 -0500 | [diff] [blame] | 178 | library_linking_strategy: { |
| 179 | prefer_static: { |
| 180 | static_libs: [ |
| 181 | "libbase", |
| 182 | ], |
| 183 | }, |
| 184 | conditions_default: { |
| 185 | shared_libs: [ |
| 186 | "libbase", |
| 187 | ], |
| 188 | }, |
| 189 | }, |
| 190 | }, |
| 191 | |
Josh Gao | dc20c2f | 2020-03-27 19:41:59 -0700 | [diff] [blame] | 192 | target: { |
Josh Gao | 7e3f811 | 2021-04-09 17:32:58 -0700 | [diff] [blame] | 193 | android: { |
| 194 | shared_libs: ["libcrypto"], |
| 195 | }, |
Colin Cross | 0229086 | 2022-03-24 15:47:28 -0700 | [diff] [blame] | 196 | host_linux: { |
Josh Gao | 7e3f811 | 2021-04-09 17:32:58 -0700 | [diff] [blame] | 197 | static_libs: ["libcrypto_static"], |
| 198 | }, |
Josh Gao | dc20c2f | 2020-03-27 19:41:59 -0700 | [diff] [blame] | 199 | recovery: { |
| 200 | exclude_static_libs: [ |
| 201 | "libadb_pairing_auth", |
| 202 | "libadb_pairing_connection", |
| 203 | ], |
| 204 | }, |
| 205 | }, |
| 206 | } |
| 207 | |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 208 | // libadb |
| 209 | // ========================================================= |
| 210 | // These files are compiled for both the host and the device. |
| 211 | libadb_srcs = [ |
| 212 | "adb.cpp", |
| 213 | "adb_io.cpp", |
| 214 | "adb_listeners.cpp", |
Joshua Duong | f4ba8d7 | 2021-01-13 12:18:15 -0800 | [diff] [blame] | 215 | "adb_mdns.cpp", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 216 | "adb_trace.cpp", |
Josh Gao | 7d5762c | 2018-05-24 22:54:50 -0700 | [diff] [blame] | 217 | "adb_unique_fd.cpp", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 218 | "adb_utils.cpp", |
Josh Gao | b51193a | 2019-06-28 13:50:37 -0700 | [diff] [blame] | 219 | "fdevent/fdevent.cpp", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 220 | "services.cpp", |
| 221 | "sockets.cpp", |
| 222 | "socket_spec.cpp", |
Joshua Duong | 93b407c | 2020-07-30 16:34:29 -0700 | [diff] [blame] | 223 | "sysdeps/env.cpp", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 224 | "sysdeps/errno.cpp", |
| 225 | "transport.cpp", |
Josh Gao | 1e41fda | 2018-04-05 16:16:04 -0700 | [diff] [blame] | 226 | "transport_fd.cpp", |
Yurii Zubrytskyi | e5e6b0d | 2019-07-12 14:11:54 -0700 | [diff] [blame] | 227 | "types.cpp", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 228 | ] |
| 229 | |
Josh Gao | d7c49ec | 2020-04-20 19:22:05 -0700 | [diff] [blame] | 230 | libadb_darwin_srcs = [ |
| 231 | "fdevent/fdevent_poll.cpp", |
| 232 | ] |
| 233 | |
| 234 | libadb_windows_srcs = [ |
| 235 | "fdevent/fdevent_poll.cpp", |
| 236 | "sysdeps_win32.cpp", |
| 237 | "sysdeps/win32/errno.cpp", |
| 238 | "sysdeps/win32/stat.cpp", |
| 239 | ] |
| 240 | |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 241 | libadb_posix_srcs = [ |
| 242 | "sysdeps_unix.cpp", |
| 243 | "sysdeps/posix/network.cpp", |
| 244 | ] |
| 245 | |
Josh Gao | dd71642 | 2019-07-11 13:47:44 -0700 | [diff] [blame] | 246 | libadb_linux_srcs = [ |
| 247 | "fdevent/fdevent_epoll.cpp", |
| 248 | ] |
| 249 | |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 250 | libadb_test_srcs = [ |
| 251 | "adb_io_test.cpp", |
| 252 | "adb_listeners_test.cpp", |
| 253 | "adb_utils_test.cpp", |
Josh Gao | b51193a | 2019-06-28 13:50:37 -0700 | [diff] [blame] | 254 | "fdevent/fdevent_test.cpp", |
Shaju Mathew | 3f7b440 | 2023-01-19 21:56:37 -0800 | [diff] [blame] | 255 | "shell_service_protocol.cpp", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 256 | "socket_spec_test.cpp", |
| 257 | "socket_test.cpp", |
| 258 | "sysdeps_test.cpp", |
| 259 | "sysdeps/stat_test.cpp", |
| 260 | "transport_test.cpp", |
Josh Gao | 9f155db | 2018-04-03 14:37:11 -0700 | [diff] [blame] | 261 | "types_test.cpp", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 262 | ] |
| 263 | |
| 264 | cc_library_host_static { |
| 265 | name: "libadb_host", |
| 266 | defaults: ["adb_defaults"], |
| 267 | |
| 268 | srcs: libadb_srcs + [ |
Joshua Duong | f4ba8d7 | 2021-01-13 12:18:15 -0800 | [diff] [blame] | 269 | "client/openscreen/mdns_service_info.cpp", |
| 270 | "client/openscreen/mdns_service_watcher.cpp", |
| 271 | "client/openscreen/platform/logging.cpp", |
| 272 | "client/openscreen/platform/task_runner.cpp", |
| 273 | "client/openscreen/platform/udp_socket.cpp", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 274 | "client/auth.cpp", |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 275 | "client/adb_wifi.cpp", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 276 | "client/usb_libusb.cpp", |
Josh Gao | a5baef9 | 2020-04-22 17:30:06 -0700 | [diff] [blame] | 277 | "client/transport_local.cpp", |
Joshua Duong | f4ba8d7 | 2021-01-13 12:18:15 -0800 | [diff] [blame] | 278 | "client/mdnsresponder_client.cpp", |
Joshua Duong | f2a0d87 | 2020-04-30 15:45:38 -0700 | [diff] [blame] | 279 | "client/mdns_utils.cpp", |
Joshua Duong | f4ba8d7 | 2021-01-13 12:18:15 -0800 | [diff] [blame] | 280 | "client/transport_mdns.cpp", |
Josh Gao | 6b55e75 | 2020-03-27 18:09:56 -0700 | [diff] [blame] | 281 | "client/transport_usb.cpp", |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 282 | "client/pairing/pairing_client.cpp", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 283 | ], |
| 284 | |
Dan Willemsen | 1886189 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 285 | generated_headers: ["platform_tools_version"], |
| 286 | |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 287 | target: { |
| 288 | linux: { |
Josh Gao | dd71642 | 2019-07-11 13:47:44 -0700 | [diff] [blame] | 289 | srcs: ["client/usb_linux.cpp"] + libadb_linux_srcs, |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 290 | }, |
| 291 | darwin: { |
Josh Gao | d7c49ec | 2020-04-20 19:22:05 -0700 | [diff] [blame] | 292 | srcs: ["client/usb_osx.cpp"] + libadb_darwin_srcs, |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 293 | }, |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 294 | not_windows: { |
| 295 | srcs: libadb_posix_srcs, |
| 296 | }, |
| 297 | windows: { |
| 298 | enabled: true, |
| 299 | srcs: [ |
| 300 | "client/usb_windows.cpp", |
Josh Gao | d7c49ec | 2020-04-20 19:22:05 -0700 | [diff] [blame] | 301 | ] + libadb_windows_srcs, |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 302 | shared_libs: ["AdbWinApi"], |
| 303 | }, |
| 304 | }, |
| 305 | |
| 306 | static_libs: [ |
Joshua Duong | 090c807 | 2019-12-19 16:36:30 -0800 | [diff] [blame] | 307 | "libadb_crypto", |
Fabien Sanglard | 0578941 | 2024-05-30 23:00:18 -0700 | [diff] [blame] | 308 | "libadb_host_protos", |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 309 | "libadb_pairing_connection", |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 310 | "libadb_protos", |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 311 | "libadb_tls_connection", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 312 | "libbase", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 313 | "libcrypto", |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 314 | "libcrypto_utils", |
Idries Hamadi | 78330f0 | 2018-09-13 18:00:25 +0100 | [diff] [blame] | 315 | "libcutils", |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 316 | "libdiagnose_usb", |
| 317 | "liblog", |
| 318 | "libmdnssd", |
Joshua Duong | f4ba8d7 | 2021-01-13 12:18:15 -0800 | [diff] [blame] | 319 | "libopenscreen-discovery", |
| 320 | "libopenscreen-platform-impl", |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 321 | "libprotobuf-cpp-lite", |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 322 | "libusb", |
| 323 | "libutils", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 324 | ], |
| 325 | } |
| 326 | |
Joshua Duong | 93b407c | 2020-07-30 16:34:29 -0700 | [diff] [blame] | 327 | cc_library { |
| 328 | name: "libadb_sysdeps", |
| 329 | defaults: ["adb_defaults"], |
| 330 | recovery_available: true, |
| 331 | host_supported: true, |
| 332 | compile_multilib: "both", |
| 333 | min_sdk_version: "apex_inherit", |
Jiyong Park | c55fa5c | 2020-08-25 17:05:41 +0900 | [diff] [blame] | 334 | // This library doesn't use build::GetBuildNumber() |
| 335 | use_version_lib: false, |
Joshua Duong | 93b407c | 2020-07-30 16:34:29 -0700 | [diff] [blame] | 336 | |
| 337 | srcs: [ |
| 338 | "sysdeps/env.cpp", |
| 339 | ], |
| 340 | |
| 341 | shared_libs: [ |
| 342 | "libbase", |
| 343 | "liblog", |
| 344 | ], |
| 345 | |
| 346 | target: { |
| 347 | windows: { |
| 348 | enabled: true, |
| 349 | ldflags: ["-municode"], |
| 350 | }, |
| 351 | }, |
| 352 | |
| 353 | export_include_dirs: ["."], |
| 354 | |
| 355 | visibility: [ |
Joshua Duong | 93b407c | 2020-07-30 16:34:29 -0700 | [diff] [blame] | 356 | "//bootable/recovery/minadbd:__subpackages__", |
Baligh Uddin | 95e0367 | 2020-10-18 15:09:52 +0000 | [diff] [blame] | 357 | "//packages/modules/adb:__subpackages__", |
Joshua Duong | 93b407c | 2020-07-30 16:34:29 -0700 | [diff] [blame] | 358 | ], |
| 359 | |
| 360 | apex_available: [ |
| 361 | "com.android.adbd", |
| 362 | "test_com.android.adbd", |
| 363 | ], |
| 364 | } |
| 365 | |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 366 | cc_test_host { |
| 367 | name: "adb_test", |
| 368 | defaults: ["adb_defaults"], |
Joshua Duong | f2a0d87 | 2020-04-30 15:45:38 -0700 | [diff] [blame] | 369 | srcs: libadb_test_srcs + [ |
| 370 | "client/mdns_utils_test.cpp", |
Shaju Mathew | 3f7b440 | 2023-01-19 21:56:37 -0800 | [diff] [blame] | 371 | "test_utils/test_utils.cpp", |
Joshua Duong | f2a0d87 | 2020-04-30 15:45:38 -0700 | [diff] [blame] | 372 | ], |
| 373 | |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 374 | static_libs: [ |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 375 | "libadb_crypto_static", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 376 | "libadb_host", |
Fabien Sanglard | 0578941 | 2024-05-30 23:00:18 -0700 | [diff] [blame] | 377 | "libadb_host_protos", |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 378 | "libadb_pairing_auth_static", |
| 379 | "libadb_pairing_connection_static", |
| 380 | "libadb_protos_static", |
Joshua Duong | 93b407c | 2020-07-30 16:34:29 -0700 | [diff] [blame] | 381 | "libadb_sysdeps", |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 382 | "libadb_tls_connection_static", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 383 | "libbase", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 384 | "libcrypto", |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 385 | "libcrypto_utils", |
| 386 | "libcutils", |
| 387 | "libdiagnose_usb", |
Tom Cherry | 49b96ec | 2020-01-08 13:41:56 -0800 | [diff] [blame] | 388 | "liblog", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 389 | "libmdnssd", |
Joshua Duong | f4ba8d7 | 2021-01-13 12:18:15 -0800 | [diff] [blame] | 390 | "libopenscreen-discovery", |
| 391 | "libopenscreen-platform-impl", |
Fabien Sanglard | 3d155b6 | 2023-11-30 14:52:40 -0800 | [diff] [blame] | 392 | "libprotobuf-cpp-full", |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 393 | "libssl", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 394 | "libusb", |
| 395 | ], |
Josh Gao | ea7b95a | 2018-03-23 15:37:20 -0700 | [diff] [blame] | 396 | |
| 397 | target: { |
| 398 | windows: { |
| 399 | enabled: true, |
Josh Gao | 3e8bdab | 2019-07-16 15:08:42 -0700 | [diff] [blame] | 400 | ldflags: ["-municode"], |
Josh Gao | ea7b95a | 2018-03-23 15:37:20 -0700 | [diff] [blame] | 401 | shared_libs: ["AdbWinApi"], |
| 402 | }, |
| 403 | }, |
zeek | 9afe4f8 | 2022-09-20 00:49:44 +0800 | [diff] [blame] | 404 | |
| 405 | test_options: { |
| 406 | // TODO(b/247985207) remove "no-remote" tag when b/247985207 is fixed. |
| 407 | tags: ["no-remote"], |
Aditya Choudhary | 1d87c97 | 2024-02-02 13:55:51 +0000 | [diff] [blame] | 408 | }, |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 409 | } |
| 410 | |
Fabien Sanglard | 45c08c5 | 2024-07-12 12:50:57 -0700 | [diff] [blame] | 411 | cc_defaults { |
| 412 | name: "adb_binary_host_defaults", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 413 | |
Josh Gao | 06af61e | 2020-02-03 23:08:05 -0800 | [diff] [blame] | 414 | stl: "libc++_static", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 415 | defaults: ["adb_defaults"], |
| 416 | |
| 417 | srcs: [ |
| 418 | "client/adb_client.cpp", |
| 419 | "client/bugreport.cpp", |
| 420 | "client/commandline.cpp", |
| 421 | "client/file_sync_client.cpp", |
| 422 | "client/main.cpp", |
| 423 | "client/console.cpp", |
Idries Hamadi | 1ecee44 | 2018-01-29 16:30:36 +0000 | [diff] [blame] | 424 | "client/adb_install.cpp", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 425 | "client/line_printer.cpp", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 426 | "client/fastdeploy.cpp", |
| 427 | "client/fastdeploycallbacks.cpp", |
Alex Buynytskyy | 175ce29 | 2020-02-13 06:52:04 -0800 | [diff] [blame] | 428 | "client/incremental.cpp", |
| 429 | "client/incremental_server.cpp", |
Songchun Fan | 965301e | 2020-03-13 13:11:43 -0700 | [diff] [blame] | 430 | "client/incremental_utils.cpp", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 431 | "shell_service_protocol.cpp", |
| 432 | ], |
| 433 | |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 434 | generated_headers: [ |
| 435 | "bin2c_fastdeployagent", |
Aditya Choudhary | 1d87c97 | 2024-02-02 13:55:51 +0000 | [diff] [blame] | 436 | "bin2c_fastdeployagentscript", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 437 | ], |
| 438 | |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 439 | static_libs: [ |
Joshua Duong | 090c807 | 2019-12-19 16:36:30 -0800 | [diff] [blame] | 440 | "libadb_crypto", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 441 | "libadb_host", |
Fabien Sanglard | 0578941 | 2024-05-30 23:00:18 -0700 | [diff] [blame] | 442 | "libadb_host_protos", |
Josh Gao | d8bad8e | 2020-03-26 13:46:08 -0700 | [diff] [blame] | 443 | "libadb_pairing_auth", |
| 444 | "libadb_pairing_connection", |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 445 | "libadb_protos", |
Joshua Duong | 93b407c | 2020-07-30 16:34:29 -0700 | [diff] [blame] | 446 | "libadb_sysdeps", |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 447 | "libadb_tls_connection", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 448 | "libandroidfw", |
Shukang Zhou | 420ad55 | 2020-02-13 17:01:39 -0800 | [diff] [blame] | 449 | "libapp_processes_protos_full", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 450 | "libbase", |
Josh Gao | 2f0f9eb | 2020-03-04 19:34:08 -0800 | [diff] [blame] | 451 | "libbrotli", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 452 | "libcrypto", |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 453 | "libcrypto_utils", |
| 454 | "libcutils", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 455 | "libdiagnose_usb", |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 456 | "libfastdeploy_host", |
| 457 | "liblog", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 458 | "liblog", |
Alex Buynytskyy | 175ce29 | 2020-02-13 06:52:04 -0800 | [diff] [blame] | 459 | "liblz4", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 460 | "libmdnssd", |
Joshua Duong | f4ba8d7 | 2021-01-13 12:18:15 -0800 | [diff] [blame] | 461 | "libopenscreen-discovery", |
| 462 | "libopenscreen-platform-impl", |
Shukang Zhou | 420ad55 | 2020-02-13 17:01:39 -0800 | [diff] [blame] | 463 | "libprotobuf-cpp-full", |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 464 | "libssl", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 465 | "libusb", |
Idries Hamadi | 78330f0 | 2018-09-13 18:00:25 +0100 | [diff] [blame] | 466 | "libutils", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 467 | "libz", |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 468 | "libziparchive", |
Josh Gao | bdebc9b | 2020-05-27 17:52:52 -0700 | [diff] [blame] | 469 | "libzstd", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 470 | ], |
| 471 | |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 472 | // Don't add anything here, we don't want additional shared dependencies |
| 473 | // on the host adb tool, and shared libraries that link against libc++ |
| 474 | // will violate ODR |
| 475 | shared_libs: [], |
| 476 | |
Dan Willemsen | 7024da4 | 2018-11-19 19:11:35 -0800 | [diff] [blame] | 477 | // Archive adb, adb.exe. |
| 478 | dist: { |
| 479 | targets: [ |
| 480 | "dist_files", |
| 481 | "sdk", |
Shaju Mathew | 9510d64 | 2022-10-06 22:18:29 +0000 | [diff] [blame] | 482 | "sdk-repo-platform-tools", |
| 483 | "sdk_repo", |
Dan Willemsen | 7024da4 | 2018-11-19 19:11:35 -0800 | [diff] [blame] | 484 | "win_sdk", |
| 485 | ], |
| 486 | }, |
| 487 | |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 488 | target: { |
| 489 | darwin: { |
| 490 | cflags: [ |
| 491 | "-Wno-sizeof-pointer-memaccess", |
| 492 | ], |
| 493 | }, |
| 494 | windows: { |
| 495 | enabled: true, |
| 496 | ldflags: ["-municode"], |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 497 | shared_libs: ["AdbWinApi"], |
| 498 | required: [ |
| 499 | "AdbWinUsbApi", |
| 500 | ], |
| 501 | }, |
| 502 | }, |
| 503 | } |
| 504 | |
Fabien Sanglard | 45c08c5 | 2024-07-12 12:50:57 -0700 | [diff] [blame] | 505 | cc_binary_host { |
| 506 | name: "adb", |
| 507 | defaults: ["adb_binary_host_defaults"], |
| 508 | } |
| 509 | |
| 510 | cc_binary_host { |
| 511 | name: "adb_asan", |
| 512 | defaults: ["adb_binary_host_defaults"], |
| 513 | target: { |
Nadia Agueeva | 72e1ac4 | 2024-08-07 18:12:28 +0000 | [diff] [blame] | 514 | darwin: { |
| 515 | sanitize: { |
| 516 | address: true, |
Fabien Sanglard | 45c08c5 | 2024-07-12 12:50:57 -0700 | [diff] [blame] | 517 | }, |
Nadia Agueeva | 72e1ac4 | 2024-08-07 18:12:28 +0000 | [diff] [blame] | 518 | strip: { |
| 519 | none: true, |
Fabien Sanglard | 45c08c5 | 2024-07-12 12:50:57 -0700 | [diff] [blame] | 520 | }, |
Nadia Agueeva | 72e1ac4 | 2024-08-07 18:12:28 +0000 | [diff] [blame] | 521 | }, |
| 522 | linux: { |
| 523 | sanitize: { |
| 524 | address: true, |
| 525 | }, |
| 526 | strip: { |
| 527 | none: true, |
| 528 | }, |
| 529 | }, |
| 530 | // Not supported on Windows yet... |
| 531 | windows: { |
| 532 | enabled: false, |
| 533 | }, |
Fabien Sanglard | 45c08c5 | 2024-07-12 12:50:57 -0700 | [diff] [blame] | 534 | }, |
| 535 | } |
| 536 | |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 537 | // libadbd_core contains the common sources to build libadbd and libadbd_services. |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 538 | cc_library_static { |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 539 | name: "libadbd_core", |
Aditya Choudhary | 1d87c97 | 2024-02-02 13:55:51 +0000 | [diff] [blame] | 540 | defaults: [ |
| 541 | "adbd_defaults", |
| 542 | "host_adbd_supported", |
| 543 | ], |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 544 | recovery_available: true, |
| 545 | |
| 546 | // libminadbd wants both, as it's used to build native tests. |
| 547 | compile_multilib: "both", |
| 548 | |
Josh Gao | dd71642 | 2019-07-11 13:47:44 -0700 | [diff] [blame] | 549 | srcs: libadb_srcs + libadb_linux_srcs + libadb_posix_srcs + [ |
Josh Gao | a5baef9 | 2020-04-22 17:30:06 -0700 | [diff] [blame] | 550 | "daemon/adb_wifi.cpp", |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 551 | "daemon/auth.cpp", |
| 552 | "daemon/jdwp_service.cpp", |
Josh Gao | bd77521 | 2020-02-26 16:39:20 -0800 | [diff] [blame] | 553 | "daemon/logging.cpp", |
Josh Gao | a5baef9 | 2020-04-22 17:30:06 -0700 | [diff] [blame] | 554 | "daemon/transport_local.cpp", |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 555 | ], |
| 556 | |
Dan Willemsen | 1886189 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 557 | generated_headers: ["platform_tools_version"], |
| 558 | |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 559 | static_libs: [ |
| 560 | "libdiagnose_usb", |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 561 | ], |
| 562 | |
| 563 | shared_libs: [ |
Joshua Duong | 090c807 | 2019-12-19 16:36:30 -0800 | [diff] [blame] | 564 | "libadb_crypto", |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 565 | "libadb_pairing_connection", |
| 566 | "libadb_protos", |
| 567 | "libadb_tls_connection", |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 568 | "libadbconnection_server", |
Josh Gao | 7cac88a | 2019-10-22 12:30:39 -0700 | [diff] [blame] | 569 | "libadbd_auth", |
Josh Gao | fa3605a | 2020-03-16 11:30:09 -0700 | [diff] [blame] | 570 | "libapp_processes_protos_lite", |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 571 | "libasyncio", |
| 572 | "libbase", |
| 573 | "libcrypto", |
| 574 | "libcrypto_utils", |
Josh Gao | dc20c2f | 2020-03-27 19:41:59 -0700 | [diff] [blame] | 575 | "libcutils_sockets", |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 576 | "liblog", |
| 577 | ], |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 578 | |
Shukang Zhou | 420ad55 | 2020-02-13 17:01:39 -0800 | [diff] [blame] | 579 | proto: { |
| 580 | type: "lite", |
| 581 | static: true, |
| 582 | export_proto_headers: true, |
| 583 | }, |
| 584 | |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 585 | target: { |
| 586 | android: { |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 587 | srcs: [ |
Josh Gao | 822f674 | 2021-02-03 22:12:41 -0800 | [diff] [blame] | 588 | "daemon/property_monitor.cpp", |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 589 | "daemon/usb.cpp", |
| 590 | "daemon/usb_ffs.cpp", |
Josh Gao | 2dc6196 | 2021-02-03 22:11:45 -0800 | [diff] [blame] | 591 | "daemon/watchdog.cpp", |
Aditya Choudhary | 1d87c97 | 2024-02-02 13:55:51 +0000 | [diff] [blame] | 592 | ], |
Joshua Duong | 929364a | 2020-02-26 15:43:44 -0800 | [diff] [blame] | 593 | }, |
| 594 | recovery: { |
| 595 | exclude_shared_libs: [ |
| 596 | "libadb_pairing_auth", |
| 597 | "libadb_pairing_connection", |
Josh Gao | fa3605a | 2020-03-16 11:30:09 -0700 | [diff] [blame] | 598 | "libapp_processes_protos_lite", |
Joshua Duong | 929364a | 2020-02-26 15:43:44 -0800 | [diff] [blame] | 599 | ], |
Aditya Choudhary | 1d87c97 | 2024-02-02 13:55:51 +0000 | [diff] [blame] | 600 | }, |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 601 | }, |
Josh Gao | 5fcd7ae | 2020-03-16 12:48:18 -0700 | [diff] [blame] | 602 | |
Jooyung Han | 9864dad | 2021-11-22 10:15:19 +0900 | [diff] [blame] | 603 | min_sdk_version: "30", |
Josh Gao | 5fcd7ae | 2020-03-16 12:48:18 -0700 | [diff] [blame] | 604 | apex_available: [ |
| 605 | "//apex_available:platform", |
| 606 | "com.android.adbd", |
| 607 | ], |
| 608 | visibility: [ |
| 609 | "//bootable/recovery/minadbd", |
Baligh Uddin | 95e0367 | 2020-10-18 15:09:52 +0000 | [diff] [blame] | 610 | "//packages/modules/adb:__subpackages__", |
Josh Gao | 5fcd7ae | 2020-03-16 12:48:18 -0700 | [diff] [blame] | 611 | ], |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 612 | } |
| 613 | |
Josh Gao | 2029a37 | 2020-03-09 15:20:55 -0700 | [diff] [blame] | 614 | cc_library { |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 615 | name: "libadbd_services", |
Aditya Choudhary | 1d87c97 | 2024-02-02 13:55:51 +0000 | [diff] [blame] | 616 | defaults: [ |
| 617 | "adbd_defaults", |
| 618 | "host_adbd_supported", |
| 619 | ], |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 620 | recovery_available: true, |
| 621 | compile_multilib: "both", |
| 622 | |
Liz Kammer | 58c7173 | 2023-10-13 17:15:06 -0400 | [diff] [blame] | 623 | // avoid getting duplicate symbol of android::build::getbuildnumber(). |
| 624 | use_version_lib: false, |
| 625 | |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 626 | srcs: [ |
| 627 | "daemon/file_sync_service.cpp", |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 628 | "daemon/services.cpp", |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 629 | "daemon/shell_service.cpp", |
| 630 | "shell_service_protocol.cpp", |
| 631 | ], |
| 632 | |
| 633 | cflags: [ |
| 634 | "-D_GNU_SOURCE", |
| 635 | "-Wno-deprecated-declarations", |
| 636 | ], |
| 637 | |
| 638 | static_libs: [ |
Josh Gao | bf5a936 | 2020-01-22 17:58:03 -0800 | [diff] [blame] | 639 | "libadbconnection_server", |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 640 | "libadbd_core", |
Josh Gao | 2f0f9eb | 2020-03-04 19:34:08 -0800 | [diff] [blame] | 641 | "libbrotli", |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 642 | "libdiagnose_usb", |
Josh Gao | fb386cc | 2020-03-26 22:02:03 -0700 | [diff] [blame] | 643 | "liblz4", |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 644 | "libprotobuf-cpp-lite", |
Josh Gao | bdebc9b | 2020-05-27 17:52:52 -0700 | [diff] [blame] | 645 | "libzstd", |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 646 | ], |
| 647 | |
| 648 | shared_libs: [ |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 649 | "libadb_crypto", |
| 650 | "libadb_pairing_connection", |
| 651 | "libadb_protos", |
| 652 | "libadb_tls_connection", |
Josh Gao | fa3605a | 2020-03-16 11:30:09 -0700 | [diff] [blame] | 653 | "libapp_processes_protos_lite", |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 654 | "libasyncio", |
| 655 | "libbase", |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 656 | "libcrypto_utils", |
Josh Gao | 2029a37 | 2020-03-09 15:20:55 -0700 | [diff] [blame] | 657 | "libcutils_sockets", |
Josh Gao | dc20c2f | 2020-03-27 19:41:59 -0700 | [diff] [blame] | 658 | |
| 659 | // APEX dependencies. |
| 660 | "libadbd_auth", |
| 661 | "libadbd_fs", |
| 662 | "libcrypto", |
| 663 | "liblog", |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 664 | ], |
Alex Buynytskyy | ef34f01 | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 665 | |
| 666 | target: { |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 667 | android: { |
| 668 | srcs: [ |
| 669 | "daemon/abb_service.cpp", |
| 670 | "daemon/framebuffer_service.cpp", |
| 671 | "daemon/mdns.cpp", |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 672 | "daemon/restart_service.cpp", |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 673 | ], |
| 674 | shared_libs: [ |
LuK1337 | 1c07e73 | 2020-09-16 19:35:05 +0200 | [diff] [blame] | 675 | "libbinder_ndk", |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 676 | "libmdnssd", |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 677 | "libselinux", |
| 678 | ], |
LuK1337 | 1c07e73 | 2020-09-16 19:35:05 +0200 | [diff] [blame] | 679 | static_libs: [ |
| 680 | "adbroot_aidl_interface-ndk", |
| 681 | ], |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 682 | }, |
Alex Buynytskyy | ef34f01 | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 683 | recovery: { |
| 684 | exclude_srcs: [ |
| 685 | "daemon/abb_service.cpp", |
| 686 | ], |
Joshua Duong | 929364a | 2020-02-26 15:43:44 -0800 | [diff] [blame] | 687 | exclude_shared_libs: [ |
LuK1337 | 1c07e73 | 2020-09-16 19:35:05 +0200 | [diff] [blame] | 688 | "libbinder_ndk", |
Joshua Duong | 929364a | 2020-02-26 15:43:44 -0800 | [diff] [blame] | 689 | "libadb_pairing_auth", |
| 690 | "libadb_pairing_connection", |
| 691 | ], |
LuK1337 | 1c07e73 | 2020-09-16 19:35:05 +0200 | [diff] [blame] | 692 | exclude_static_libs: [ |
| 693 | "adbroot_aidl_interface-ndk", |
| 694 | ], |
Alex Buynytskyy | ef34f01 | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 695 | }, |
| 696 | }, |
Josh Gao | 5fcd7ae | 2020-03-16 12:48:18 -0700 | [diff] [blame] | 697 | |
Jooyung Han | 9864dad | 2021-11-22 10:15:19 +0900 | [diff] [blame] | 698 | min_sdk_version: "30", |
Josh Gao | 5fcd7ae | 2020-03-16 12:48:18 -0700 | [diff] [blame] | 699 | apex_available: [ |
| 700 | "//apex_available:platform", |
| 701 | "com.android.adbd", |
| 702 | ], |
| 703 | visibility: [ |
Baligh Uddin | 95e0367 | 2020-10-18 15:09:52 +0000 | [diff] [blame] | 704 | "//packages/modules/adb", |
Josh Gao | 5fcd7ae | 2020-03-16 12:48:18 -0700 | [diff] [blame] | 705 | ], |
| 706 | |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 707 | } |
| 708 | |
| 709 | cc_library { |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 710 | name: "libadbd", |
Aditya Choudhary | 1d87c97 | 2024-02-02 13:55:51 +0000 | [diff] [blame] | 711 | defaults: [ |
| 712 | "adbd_defaults", |
| 713 | "host_adbd_supported", |
| 714 | ], |
Jiyong Park | eb59039 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 715 | recovery_available: true, |
Jooyung Han | 9864dad | 2021-11-22 10:15:19 +0900 | [diff] [blame] | 716 | min_sdk_version: "30", |
Jiyong Park | c6afe4a | 2020-03-23 14:40:50 +0000 | [diff] [blame] | 717 | apex_available: ["com.android.adbd"], |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 718 | |
Josh Gao | bf5a936 | 2020-01-22 17:58:03 -0800 | [diff] [blame] | 719 | // avoid getting duplicate symbol of android::build::getbuildnumber(). |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 720 | use_version_lib: false, |
| 721 | |
| 722 | // libminadbd wants both, as it's used to build native tests. |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 723 | compile_multilib: "both", |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 724 | |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 725 | static_libs: [ |
| 726 | "libadbd_core", |
| 727 | "libadbd_services", |
| 728 | "libbrotli", |
| 729 | "libcutils_sockets", |
| 730 | "libdiagnose_usb", |
| 731 | "liblz4", |
| 732 | "libmdnssd", |
| 733 | "libprotobuf-cpp-lite", |
| 734 | "libzstd", |
| 735 | ], |
| 736 | |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 737 | shared_libs: [ |
Josh Gao | fa3605a | 2020-03-16 11:30:09 -0700 | [diff] [blame] | 738 | "libadbconnection_server", |
| 739 | "libapp_processes_protos_lite", |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 740 | "libadb_crypto", |
| 741 | "libadb_pairing_connection", |
| 742 | "libadb_tls_connection", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 743 | "libasyncio", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 744 | "libbase", |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 745 | "libcrypto", |
| 746 | "libcrypto_utils", |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 747 | "liblog", |
Josh Gao | a4dfc14 | 2020-02-19 13:50:57 -0800 | [diff] [blame] | 748 | "libselinux", |
Josh Gao | dc20c2f | 2020-03-27 19:41:59 -0700 | [diff] [blame] | 749 | |
| 750 | // APEX dependencies on the system image. |
| 751 | "libadbd_auth", |
| 752 | "libadbd_fs", |
Josh Gao | a4dfc14 | 2020-02-19 13:50:57 -0800 | [diff] [blame] | 753 | ], |
| 754 | |
Joshua Duong | 929364a | 2020-02-26 15:43:44 -0800 | [diff] [blame] | 755 | target: { |
| 756 | recovery: { |
| 757 | exclude_shared_libs: [ |
| 758 | "libadb_pairing_auth", |
| 759 | "libadb_pairing_connection", |
| 760 | ], |
Aditya Choudhary | 1d87c97 | 2024-02-02 13:55:51 +0000 | [diff] [blame] | 761 | }, |
Joshua Duong | 929364a | 2020-02-26 15:43:44 -0800 | [diff] [blame] | 762 | }, |
| 763 | |
Josh Gao | 6b55e75 | 2020-03-27 18:09:56 -0700 | [diff] [blame] | 764 | visibility: [ |
| 765 | "//bootable/recovery/minadbd", |
Baligh Uddin | 95e0367 | 2020-10-18 15:09:52 +0000 | [diff] [blame] | 766 | "//packages/modules/adb", |
Jerry Zhang | d4fe8b6 | 2018-05-07 15:14:47 -0700 | [diff] [blame] | 767 | ], |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 768 | } |
| 769 | |
| 770 | cc_binary { |
| 771 | name: "adbd", |
Aditya Choudhary | 1d87c97 | 2024-02-02 13:55:51 +0000 | [diff] [blame] | 772 | defaults: [ |
| 773 | "adbd_defaults", |
| 774 | "host_adbd_supported", |
| 775 | "libadbd_binary_dependencies", |
| 776 | ], |
Jiyong Park | eb59039 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 777 | recovery_available: true, |
Jooyung Han | 9864dad | 2021-11-22 10:15:19 +0900 | [diff] [blame] | 778 | min_sdk_version: "30", |
Jiyong Park | c6afe4a | 2020-03-23 14:40:50 +0000 | [diff] [blame] | 779 | apex_available: ["com.android.adbd"], |
Josh Gao | 3e0540a | 2018-03-06 12:57:27 -0800 | [diff] [blame] | 780 | |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 781 | srcs: [ |
| 782 | "daemon/main.cpp", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 783 | ], |
| 784 | |
| 785 | cflags: [ |
| 786 | "-D_GNU_SOURCE", |
| 787 | "-Wno-deprecated-declarations", |
| 788 | ], |
| 789 | |
| 790 | strip: { |
| 791 | keep_symbols: true, |
| 792 | }, |
| 793 | |
Josh Gao | 2bfc85e | 2019-08-15 14:05:12 -0700 | [diff] [blame] | 794 | static_libs: [ |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 795 | "libadb_protos", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 796 | "libadbd", |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 797 | "libadbd_services", |
Josh Gao | 2bfc85e | 2019-08-15 14:05:12 -0700 | [diff] [blame] | 798 | "libasyncio", |
Tao Bao | 49042e3 | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 799 | "libcap", |
Josh Gao | fb386cc | 2020-03-26 22:02:03 -0700 | [diff] [blame] | 800 | "liblz4", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 801 | "libminijail", |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 802 | "libssl", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 803 | ], |
Josh Gao | 2bfc85e | 2019-08-15 14:05:12 -0700 | [diff] [blame] | 804 | |
| 805 | shared_libs: [ |
Josh Gao | 090712a | 2020-01-16 12:40:43 -0800 | [diff] [blame] | 806 | "libadbd_auth", |
Josh Gao | 2bfc85e | 2019-08-15 14:05:12 -0700 | [diff] [blame] | 807 | ], |
Josh Gao | 06af61e | 2020-02-03 23:08:05 -0800 | [diff] [blame] | 808 | |
Joshua Duong | 929364a | 2020-02-26 15:43:44 -0800 | [diff] [blame] | 809 | target: { |
LuK1337 | 1c07e73 | 2020-09-16 19:35:05 +0200 | [diff] [blame] | 810 | android: { |
| 811 | shared_libs: [ |
| 812 | "libbinder_ndk", |
| 813 | ], |
| 814 | |
| 815 | static_libs: [ |
| 816 | "adbroot_aidl_interface-ndk", |
| 817 | ], |
| 818 | }, |
| 819 | |
Joshua Duong | 929364a | 2020-02-26 15:43:44 -0800 | [diff] [blame] | 820 | recovery: { |
| 821 | exclude_shared_libs: [ |
| 822 | "libadb_pairing_auth", |
| 823 | "libadb_pairing_connection", |
LuK1337 | 1c07e73 | 2020-09-16 19:35:05 +0200 | [diff] [blame] | 824 | "libbinder_ndk", |
| 825 | ], |
| 826 | |
| 827 | exclude_static_libs: [ |
| 828 | "adbroot_aidl_interface-ndk", |
Joshua Duong | 929364a | 2020-02-26 15:43:44 -0800 | [diff] [blame] | 829 | ], |
Aditya Choudhary | 1d87c97 | 2024-02-02 13:55:51 +0000 | [diff] [blame] | 830 | }, |
Joshua Duong | 929364a | 2020-02-26 15:43:44 -0800 | [diff] [blame] | 831 | }, |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 832 | } |
| 833 | |
Josh Gao | 06e4593 | 2019-10-23 13:27:17 -0700 | [diff] [blame] | 834 | phony { |
Josh Gao | df43f5e | 2020-06-01 18:59:21 -0700 | [diff] [blame] | 835 | // Interface between adbd in a module and the system. |
| 836 | name: "adbd_system_api", |
Josh Gao | 06e4593 | 2019-10-23 13:27:17 -0700 | [diff] [blame] | 837 | required: [ |
Josh Gao | df43f5e | 2020-06-01 18:59:21 -0700 | [diff] [blame] | 838 | "libadbd_auth", |
| 839 | "libadbd_fs", |
Josh Gao | 06e4593 | 2019-10-23 13:27:17 -0700 | [diff] [blame] | 840 | "abb", |
Josh Gao | 83ce3e2 | 2019-10-22 12:30:36 -0700 | [diff] [blame] | 841 | "reboot", |
Yi-Yo Chiang | c24ad0d | 2022-08-05 12:07:34 +0800 | [diff] [blame] | 842 | ], |
| 843 | product_variables: { |
| 844 | debuggable: { |
| 845 | required: [ |
| 846 | "remount", |
Yi-Yo Chiang | c24ad0d | 2022-08-05 12:07:34 +0800 | [diff] [blame] | 847 | ], |
| 848 | }, |
| 849 | }, |
Josh Gao | 06e4593 | 2019-10-23 13:27:17 -0700 | [diff] [blame] | 850 | } |
| 851 | |
| 852 | phony { |
Josh Gao | df43f5e | 2020-06-01 18:59:21 -0700 | [diff] [blame] | 853 | name: "adbd_system_api_recovery", |
Josh Gao | 06e4593 | 2019-10-23 13:27:17 -0700 | [diff] [blame] | 854 | required: [ |
Inseob Kim | fc0410d | 2021-06-30 15:07:24 +0900 | [diff] [blame] | 855 | "libadbd_auth.recovery", |
| 856 | "libadbd_fs.recovery", |
Josh Gao | 83ce3e2 | 2019-10-22 12:30:36 -0700 | [diff] [blame] | 857 | "reboot.recovery", |
Josh Gao | 06e4593 | 2019-10-23 13:27:17 -0700 | [diff] [blame] | 858 | ], |
| 859 | } |
| 860 | |
Alex Buynytskyy | ef34f01 | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 861 | cc_binary { |
LuK1337 | 1c07e73 | 2020-09-16 19:35:05 +0200 | [diff] [blame] | 862 | name: "adb_root", |
| 863 | srcs: [ |
| 864 | "root/adbroot_service.cpp", |
| 865 | "root/main.cpp", |
| 866 | ], |
| 867 | init_rc: [ |
| 868 | "root/adb_root.rc", |
| 869 | ], |
| 870 | shared_libs: [ |
| 871 | "libbase", |
| 872 | "libbinder_ndk", |
| 873 | "liblog", |
| 874 | "libutils", |
| 875 | ], |
| 876 | static_libs: [ |
| 877 | "adbroot_aidl_interface-ndk", |
| 878 | ], |
| 879 | system_ext_specific: true, |
| 880 | } |
| 881 | |
| 882 | cc_binary { |
Alex Buynytskyy | ef34f01 | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 883 | name: "abb", |
| 884 | |
Josh Gao | 0560feb | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 885 | defaults: ["adbd_defaults"], |
Josh Gao | 06af61e | 2020-02-03 23:08:05 -0800 | [diff] [blame] | 886 | stl: "libc++", |
Alex Buynytskyy | ef34f01 | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 887 | recovery_available: false, |
| 888 | |
| 889 | srcs: [ |
| 890 | "daemon/abb.cpp", |
| 891 | ], |
| 892 | |
| 893 | cflags: [ |
| 894 | "-D_GNU_SOURCE", |
| 895 | "-Wno-deprecated-declarations", |
| 896 | ], |
| 897 | |
| 898 | strip: { |
| 899 | keep_symbols: true, |
| 900 | }, |
| 901 | |
| 902 | static_libs: [ |
| 903 | "libadbd_core", |
| 904 | "libadbd_services", |
| 905 | "libcmd", |
| 906 | ], |
| 907 | |
| 908 | shared_libs: [ |
| 909 | "libbase", |
| 910 | "libbinder", |
| 911 | "liblog", |
| 912 | "libutils", |
| 913 | "libselinux", |
| 914 | ], |
| 915 | } |
| 916 | |
Jingwen Chen | e29935e | 2022-12-10 03:50:12 +0000 | [diff] [blame] | 917 | ADBD_TEST_LIBS = [ |
| 918 | "libadbd", |
| 919 | "libadbd_auth", |
| 920 | "libbase", |
Jingwen Chen | e29935e | 2022-12-10 03:50:12 +0000 | [diff] [blame] | 921 | "libusb", |
| 922 | ] |
| 923 | |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 924 | cc_test { |
| 925 | name: "adbd_test", |
Josh Gao | 06af61e | 2020-02-03 23:08:05 -0800 | [diff] [blame] | 926 | |
Aditya Choudhary | 1d87c97 | 2024-02-02 13:55:51 +0000 | [diff] [blame] | 927 | defaults: [ |
| 928 | "adbd_defaults", |
| 929 | "libadbd_binary_dependencies", |
| 930 | ], |
Josh Gao | 06af61e | 2020-02-03 23:08:05 -0800 | [diff] [blame] | 931 | |
| 932 | recovery_available: false, |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 933 | srcs: libadb_test_srcs + [ |
Shaju Mathew | ccdd7ff | 2023-02-01 03:00:40 -0800 | [diff] [blame] | 934 | "daemon/restart_service.cpp", |
| 935 | "daemon/restart_service_test.cpp", |
Josh Gao | 5607e92 | 2018-07-25 18:15:52 -0700 | [diff] [blame] | 936 | "daemon/services.cpp", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 937 | "daemon/shell_service.cpp", |
| 938 | "daemon/shell_service_test.cpp", |
Shaju Mathew | 3f7b440 | 2023-01-19 21:56:37 -0800 | [diff] [blame] | 939 | "test_utils/test_utils.cpp", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 940 | "shell_service_protocol_test.cpp", |
Joshua Duong | 77b8ff3 | 2020-04-16 15:58:19 -0700 | [diff] [blame] | 941 | "mdns_test.cpp", |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 942 | ], |
| 943 | |
Fabien Sanglard | fcd6499 | 2022-09-02 17:43:55 -0700 | [diff] [blame] | 944 | test_config: "adbd_test.xml", |
Chen Zhu | 72ccee3 | 2020-05-08 16:45:11 -0700 | [diff] [blame] | 945 | |
Josh Gao | 822f674 | 2021-02-03 22:12:41 -0800 | [diff] [blame] | 946 | target: { |
| 947 | android: { |
| 948 | srcs: [ |
| 949 | "daemon/property_monitor_test.cpp", |
| 950 | ], |
| 951 | }, |
| 952 | }, |
| 953 | |
Josh Gao | dc20c2f | 2020-03-27 19:41:59 -0700 | [diff] [blame] | 954 | shared_libs: [ |
| 955 | "liblog", |
| 956 | ], |
| 957 | |
Ryan Prichard | dbc810f | 2024-05-23 15:12:43 -0700 | [diff] [blame] | 958 | version_script: "adbd_test.map", |
| 959 | stl: "libc++_static", |
Jingwen Chen | e29935e | 2022-12-10 03:50:12 +0000 | [diff] [blame] | 960 | static_libs: ADBD_TEST_LIBS, |
| 961 | |
| 962 | // Shared lib versions of static libs can potentially come from |
| 963 | // libadbd_binary_dependencies (e.g. libbase as a shared_lib, depending on |
| 964 | // library_linking_strategy), which will cause both shared/static versions of |
| 965 | // the same library to be in the link action. |
| 966 | // |
| 967 | // adbd_test uses the static version of these libraries above, so exclude them here. |
| 968 | exclude_shared_libs: ADBD_TEST_LIBS, |
| 969 | |
Aditya Choudhary | 1d87c97 | 2024-02-02 13:55:51 +0000 | [diff] [blame] | 970 | test_suites: [ |
| 971 | "general-tests", |
| 972 | "mts-adbd", |
| 973 | ], |
Dan Shi | 22e091b | 2019-09-24 09:04:05 -0700 | [diff] [blame] | 974 | require_root: true, |
Josh Gao | 361148b | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 975 | } |
| 976 | |
Julien Desprez | ae94f51 | 2018-08-08 12:08:50 -0700 | [diff] [blame] | 977 | python_test_host { |
Elliott Hughes | 307e767 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 978 | name: "adb_integration_test_adb", |
| 979 | main: "test_adb.py", |
| 980 | srcs: [ |
| 981 | "test_adb.py", |
| 982 | ], |
Julien Desprez | ae94f51 | 2018-08-08 12:08:50 -0700 | [diff] [blame] | 983 | test_config: "adb_integration_test_adb.xml", |
| 984 | test_suites: ["general-tests"], |
Julien Desprez | b099b53 | 2021-03-25 19:26:23 +0000 | [diff] [blame] | 985 | test_options: { |
| 986 | unit_test: false, |
| 987 | }, |
GuangHui Liu | 3599439 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 988 | } |
| 989 | |
Julien Desprez | cd11d0d | 2018-10-12 13:48:14 -0700 | [diff] [blame] | 990 | python_test_host { |
Elliott Hughes | 307e767 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 991 | name: "adb_integration_test_device", |
| 992 | main: "test_device.py", |
| 993 | srcs: [ |
Fabien Sanglard | 15335e0 | 2024-03-05 21:33:44 +0000 | [diff] [blame] | 994 | "proto/app_processes.proto", |
Nadia Agueeva | 72e1ac4 | 2024-08-07 18:12:28 +0000 | [diff] [blame] | 995 | ":adb_host_proto", |
Elliott Hughes | 307e767 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 996 | "test_device.py", |
| 997 | ], |
Fabien Sanglard | 3d155b6 | 2023-11-30 14:52:40 -0800 | [diff] [blame] | 998 | proto: { |
| 999 | canonical_path_from_root: false, |
| 1000 | }, |
Elliott Hughes | 307e767 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 1001 | libs: [ |
| 1002 | "adb_py", |
Fabien Sanglard | 3d155b6 | 2023-11-30 14:52:40 -0800 | [diff] [blame] | 1003 | "libprotobuf-python", |
Elliott Hughes | 307e767 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 1004 | ], |
Julien Desprez | cd11d0d | 2018-10-12 13:48:14 -0700 | [diff] [blame] | 1005 | test_config: "adb_integration_test_device.xml", |
| 1006 | test_suites: ["general-tests"], |
Julien Desprez | b099b53 | 2021-03-25 19:26:23 +0000 | [diff] [blame] | 1007 | test_options: { |
| 1008 | unit_test: false, |
| 1009 | }, |
Fabien Sanglard | 15335e0 | 2024-03-05 21:33:44 +0000 | [diff] [blame] | 1010 | data: [ |
| 1011 | ":adb_test_app1", |
| 1012 | ":adb_test_app2", |
| 1013 | ], |
GuangHui Liu | 3599439 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 1014 | } |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 1015 | |
| 1016 | // Note: using pipe for xxd to control the variable name generated |
| 1017 | // the default name used by xxd is the path to the input file. |
| 1018 | java_genrule { |
| 1019 | name: "bin2c_fastdeployagent", |
| 1020 | out: ["deployagent.inc"], |
| 1021 | srcs: [":deployagent"], |
| 1022 | cmd: "(echo 'unsigned char kDeployAgent[] = {' && xxd -i <$(in) && echo '};') > $(out)", |
| 1023 | } |
| 1024 | |
| 1025 | genrule { |
| 1026 | name: "bin2c_fastdeployagentscript", |
| 1027 | out: ["deployagentscript.inc"], |
| 1028 | srcs: ["fastdeploy/deployagent/deployagent.sh"], |
| 1029 | cmd: "(echo 'unsigned char kDeployAgentScript[] = {' && xxd -i <$(in) && echo '};') > $(out)", |
| 1030 | } |
| 1031 | |
| 1032 | cc_library_host_static { |
| 1033 | name: "libfastdeploy_host", |
| 1034 | defaults: ["adb_defaults"], |
| 1035 | srcs: [ |
Alex Buynytskyy | 1af550e | 2019-09-16 12:10:54 -0700 | [diff] [blame] | 1036 | "fastdeploy/deploypatchgenerator/apk_archive.cpp", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 1037 | "fastdeploy/deploypatchgenerator/deploy_patch_generator.cpp", |
| 1038 | "fastdeploy/deploypatchgenerator/patch_utils.cpp", |
| 1039 | "fastdeploy/proto/ApkEntry.proto", |
| 1040 | ], |
| 1041 | static_libs: [ |
| 1042 | "libadb_host", |
| 1043 | "libandroidfw", |
| 1044 | "libbase", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 1045 | "libcrypto", |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 1046 | "libcrypto_utils", |
| 1047 | "libcutils", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 1048 | "libdiagnose_usb", |
| 1049 | "liblog", |
| 1050 | "libmdnssd", |
| 1051 | "libusb", |
| 1052 | "libutils", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 1053 | "libz", |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 1054 | "libziparchive", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 1055 | ], |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 1056 | proto: { |
| 1057 | type: "lite", |
| 1058 | export_proto_headers: true, |
| 1059 | }, |
| 1060 | target: { |
| 1061 | windows: { |
| 1062 | enabled: true, |
| 1063 | shared_libs: ["AdbWinApi"], |
| 1064 | }, |
| 1065 | }, |
| 1066 | } |
| 1067 | |
| 1068 | cc_test_host { |
| 1069 | name: "fastdeploy_test", |
| 1070 | defaults: ["adb_defaults"], |
| 1071 | srcs: [ |
Alex Buynytskyy | 1af550e | 2019-09-16 12:10:54 -0700 | [diff] [blame] | 1072 | "fastdeploy/deploypatchgenerator/apk_archive_test.cpp", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 1073 | "fastdeploy/deploypatchgenerator/deploy_patch_generator_test.cpp", |
| 1074 | "fastdeploy/deploypatchgenerator/patch_utils_test.cpp", |
| 1075 | ], |
| 1076 | static_libs: [ |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 1077 | "libadb_crypto_static", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 1078 | "libadb_host", |
Fabien Sanglard | 0578941 | 2024-05-30 23:00:18 -0700 | [diff] [blame] | 1079 | "libadb_host_protos", |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 1080 | "libadb_pairing_auth_static", |
| 1081 | "libadb_pairing_connection_static", |
| 1082 | "libadb_protos_static", |
Joshua Duong | 93b407c | 2020-07-30 16:34:29 -0700 | [diff] [blame] | 1083 | "libadb_sysdeps", |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 1084 | "libadb_tls_connection_static", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 1085 | "libandroidfw", |
| 1086 | "libbase", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 1087 | "libcrypto", |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 1088 | "libcrypto_utils", |
| 1089 | "libcutils", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 1090 | "libdiagnose_usb", |
| 1091 | "libfastdeploy_host", |
| 1092 | "liblog", |
| 1093 | "libmdnssd", |
Joshua Duong | f4ba8d7 | 2021-01-13 12:18:15 -0800 | [diff] [blame] | 1094 | "libopenscreen-discovery", |
| 1095 | "libopenscreen-platform-impl", |
Fabien Sanglard | 3d155b6 | 2023-11-30 14:52:40 -0800 | [diff] [blame] | 1096 | "libprotobuf-cpp-full", |
Joshua Duong | 290ccb5 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 1097 | "libssl", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 1098 | "libusb", |
| 1099 | "libutils", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 1100 | "libz", |
Oriol Prieto Gasco | 532e570 | 2021-08-20 14:36:42 +0000 | [diff] [blame] | 1101 | "libziparchive", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 1102 | ], |
| 1103 | target: { |
| 1104 | windows: { |
| 1105 | enabled: true, |
| 1106 | shared_libs: ["AdbWinApi"], |
| 1107 | }, |
| 1108 | }, |
| 1109 | data: [ |
Alex Buynytskyy | 1af550e | 2019-09-16 12:10:54 -0700 | [diff] [blame] | 1110 | "fastdeploy/testdata/rotating_cube-metadata-release.data", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 1111 | "fastdeploy/testdata/rotating_cube-release.apk", |
Alex Buynytskyy | 1af550e | 2019-09-16 12:10:54 -0700 | [diff] [blame] | 1112 | "fastdeploy/testdata/sample.apk", |
| 1113 | "fastdeploy/testdata/sample.cd", |
Joshua Gilpatrick | 0d38411 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 1114 | ], |
| 1115 | } |
LuK1337 | 1c07e73 | 2020-09-16 19:35:05 +0200 | [diff] [blame] | 1116 | |
| 1117 | aidl_interface { |
| 1118 | name: "adbroot_aidl_interface", |
| 1119 | unstable: true, |
| 1120 | local_include_dir: "aidl", |
| 1121 | srcs: [ |
| 1122 | "aidl/android/adbroot/IADBRootService.aidl", |
| 1123 | ], |
| 1124 | backend: { |
| 1125 | cpp: { |
| 1126 | enabled: false, |
| 1127 | }, |
| 1128 | java: { |
| 1129 | enabled: false, |
| 1130 | }, |
| 1131 | ndk: { |
| 1132 | apex_available: [ |
| 1133 | "//apex_available:platform", |
| 1134 | "com.android.adbd", |
| 1135 | ], |
| 1136 | min_sdk_version: "30", |
| 1137 | }, |
| 1138 | }, |
| 1139 | } |
| 1140 | |
| 1141 | filegroup { |
| 1142 | name: "adbrootservice_aidl", |
| 1143 | srcs: [ |
| 1144 | "aidl/android/adbroot/IADBRootService.aidl", |
| 1145 | ], |
| 1146 | } |