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