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