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