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