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