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