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