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