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