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