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