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