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