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