| GuangHui Liu | 41bda34 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 1 | // Copyright (C) 2017 The Android Open Source Project | 
|  | 2 | // | 
|  | 3 | // Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | 4 | // you may not use this file except in compliance with the License. | 
|  | 5 | // You may obtain a copy of the License at | 
|  | 6 | // | 
|  | 7 | //      http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 8 | // | 
|  | 9 | // Unless required by applicable law or agreed to in writing, software | 
|  | 10 | // distributed under the License is distributed on an "AS IS" BASIS, | 
|  | 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 12 | // See the License for the specific language governing permissions and | 
|  | 13 | // limitations under the License. | 
|  | 14 |  | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 15 | cc_defaults { | 
|  | 16 | name: "adb_defaults", | 
|  | 17 |  | 
|  | 18 | cflags: [ | 
|  | 19 | "-Wall", | 
|  | 20 | "-Wextra", | 
|  | 21 | "-Werror", | 
| Pirama Arumuga Nainar | 7982178 | 2018-06-01 11:31:38 -0700 | [diff] [blame] | 22 | "-Wexit-time-destructors", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 23 | "-Wno-unused-parameter", | 
|  | 24 | "-Wno-missing-field-initializers", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 25 | "-Wthread-safety", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 26 | "-Wvla", | 
| Bowgo Tsai | 9b30c0a | 2019-03-12 04:25:33 +0800 | [diff] [blame] | 27 | "-DADB_HOST=1",         // overridden by adbd_defaults | 
|  | 28 | "-DALLOW_ADBD_ROOT=0",  // overridden by adbd_defaults | 
| Josh Gao | 27241a7 | 2019-04-25 14:04:57 -0700 | [diff] [blame] | 29 | "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION=1", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 30 | ], | 
| Josh Gao | 6eb7882 | 2018-11-16 15:40:16 -0800 | [diff] [blame] | 31 | cpp_std: "experimental", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 32 |  | 
| Josh Gao | c7567fa | 2018-02-27 15:49:23 -0800 | [diff] [blame] | 33 | use_version_lib: true, | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 34 | compile_multilib: "first", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 35 |  | 
|  | 36 | target: { | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 37 | darwin: { | 
|  | 38 | host_ldlibs: [ | 
|  | 39 | "-lpthread", | 
|  | 40 | "-framework CoreFoundation", | 
|  | 41 | "-framework IOKit", | 
|  | 42 | "-lobjc", | 
|  | 43 | ], | 
|  | 44 | }, | 
|  | 45 |  | 
|  | 46 | windows: { | 
|  | 47 | cflags: [ | 
|  | 48 | // Define windows.h and tchar.h Unicode preprocessor symbols so that | 
|  | 49 | // CreateFile(), _tfopen(), etc. map to versions that take wchar_t*, breaking the | 
|  | 50 | // build if you accidentally pass char*. Fix by calling like: | 
|  | 51 | //   std::wstring path_wide; | 
|  | 52 | //   if (!android::base::UTF8ToWide(path_utf8, &path_wide)) { /* error handling */ } | 
|  | 53 | //   CreateFileW(path_wide.c_str()); | 
|  | 54 | "-DUNICODE=1", | 
|  | 55 | "-D_UNICODE=1", | 
|  | 56 |  | 
| Elliott Hughes | 3c59cb8 | 2018-12-03 09:02:18 -0800 | [diff] [blame] | 57 | // Unlike on Linux, -std=gnu++ doesn't set _GNU_SOURCE on Windows. | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 58 | "-D_GNU_SOURCE", | 
| Josh Gao | 2e1e789 | 2018-03-23 13:03:28 -0700 | [diff] [blame] | 59 |  | 
|  | 60 | // MinGW hides some things behind _POSIX_SOURCE. | 
|  | 61 | "-D_POSIX_SOURCE", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 62 |  | 
| Josh Gao | 4710e53 | 2019-04-17 16:57:43 -0700 | [diff] [blame] | 63 | // libusb uses __stdcall on a variadic function, which gets ignored. | 
|  | 64 | "-Wno-ignored-attributes", | 
|  | 65 |  | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 66 | // Not supported yet. | 
|  | 67 | "-Wno-thread-safety", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 68 | ], | 
| Josh Gao | f8a97c1 | 2018-03-23 15:37:20 -0700 | [diff] [blame] | 69 |  | 
|  | 70 | host_ldlibs: [ | 
|  | 71 | "-lws2_32", | 
|  | 72 | "-lgdi32", | 
|  | 73 | "-luserenv", | 
|  | 74 | ], | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 75 | }, | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 76 | }, | 
|  | 77 | } | 
| Pirama Arumuga Nainar | 7982178 | 2018-06-01 11:31:38 -0700 | [diff] [blame] | 78 |  | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 79 | cc_defaults { | 
|  | 80 | name: "adbd_defaults", | 
|  | 81 | defaults: ["adb_defaults"], | 
|  | 82 |  | 
|  | 83 | cflags: ["-UADB_HOST", "-DADB_HOST=0"], | 
|  | 84 | product_variables: { | 
|  | 85 | debuggable: { | 
| Pirama Arumuga Nainar | 7982178 | 2018-06-01 11:31:38 -0700 | [diff] [blame] | 86 | cflags: [ | 
| Bowgo Tsai | 9b30c0a | 2019-03-12 04:25:33 +0800 | [diff] [blame] | 87 | "-UALLOW_ADBD_ROOT", | 
|  | 88 | "-DALLOW_ADBD_ROOT=1", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 89 | "-DALLOW_ADBD_DISABLE_VERITY", | 
|  | 90 | "-DALLOW_ADBD_NO_AUTH", | 
| Pirama Arumuga Nainar | 7982178 | 2018-06-01 11:31:38 -0700 | [diff] [blame] | 91 | ], | 
|  | 92 | }, | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 93 | }, | 
|  | 94 | } | 
|  | 95 |  | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 96 | cc_defaults { | 
|  | 97 | name: "host_adbd_supported", | 
|  | 98 |  | 
|  | 99 | host_supported: true, | 
|  | 100 | target: { | 
|  | 101 | linux: { | 
|  | 102 | enabled: true, | 
|  | 103 | host_ldlibs: [ | 
|  | 104 | "-lresolv", // b64_pton | 
|  | 105 | "-lutil", // forkpty | 
|  | 106 | ], | 
|  | 107 | }, | 
|  | 108 | darwin: { | 
|  | 109 | enabled: false, | 
|  | 110 | }, | 
|  | 111 | windows: { | 
|  | 112 | enabled: false, | 
|  | 113 | }, | 
|  | 114 | }, | 
|  | 115 | } | 
|  | 116 |  | 
| Josh Gao | 2776845 | 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 | 6e1246c | 2018-05-24 22:54:50 -0700 | [diff] [blame] | 125 | "adb_unique_fd.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 126 | "adb_utils.cpp", | 
| Josh Gao | 57e09b1 | 2019-06-28 13:50:37 -0700 | [diff] [blame] | 127 | "fdevent/fdevent.cpp", | 
| Josh Gao | 95068bb | 2019-07-08 15:23:17 -0700 | [diff] [blame] | 128 | "fdevent/fdevent_poll.cpp", | 
| Josh Gao | 2776845 | 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 | 6082e7d | 2018-04-05 16:16:04 -0700 | [diff] [blame] | 134 | "transport_fd.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 135 | "transport_local.cpp", | 
|  | 136 | "transport_usb.cpp", | 
| Yurii Zubrytskyi | 5dda7f6 | 2019-07-12 14:11:54 -0700 | [diff] [blame] | 137 | "types.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 138 | ] | 
|  | 139 |  | 
|  | 140 | libadb_posix_srcs = [ | 
|  | 141 | "sysdeps_unix.cpp", | 
|  | 142 | "sysdeps/posix/network.cpp", | 
|  | 143 | ] | 
|  | 144 |  | 
| Josh Gao | b43ad44 | 2019-07-11 13:47:44 -0700 | [diff] [blame] | 145 | libadb_linux_srcs = [ | 
|  | 146 | "fdevent/fdevent_epoll.cpp", | 
|  | 147 | ] | 
|  | 148 |  | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 149 | libadb_test_srcs = [ | 
|  | 150 | "adb_io_test.cpp", | 
|  | 151 | "adb_listeners_test.cpp", | 
|  | 152 | "adb_utils_test.cpp", | 
| Josh Gao | 57e09b1 | 2019-06-28 13:50:37 -0700 | [diff] [blame] | 153 | "fdevent/fdevent_test.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 154 | "socket_spec_test.cpp", | 
|  | 155 | "socket_test.cpp", | 
|  | 156 | "sysdeps_test.cpp", | 
|  | 157 | "sysdeps/stat_test.cpp", | 
|  | 158 | "transport_test.cpp", | 
| Josh Gao | 7c738cd | 2018-04-03 14:37:11 -0700 | [diff] [blame] | 159 | "types_test.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 160 | ] | 
|  | 161 |  | 
|  | 162 | cc_library_host_static { | 
|  | 163 | name: "libadb_host", | 
|  | 164 | defaults: ["adb_defaults"], | 
|  | 165 |  | 
|  | 166 | srcs: libadb_srcs + [ | 
|  | 167 | "client/auth.cpp", | 
| Joshua Duong | d85f5c0 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 168 | "client/adb_wifi.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 169 | "client/usb_libusb.cpp", | 
|  | 170 | "client/usb_dispatch.cpp", | 
|  | 171 | "client/transport_mdns.cpp", | 
| Joshua Duong | d85f5c0 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 172 | "client/pairing/pairing_client.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 173 | ], | 
|  | 174 |  | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 175 | generated_headers: ["platform_tools_version"], | 
|  | 176 |  | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 177 | target: { | 
|  | 178 | linux: { | 
| Josh Gao | b43ad44 | 2019-07-11 13:47:44 -0700 | [diff] [blame] | 179 | srcs: ["client/usb_linux.cpp"] + libadb_linux_srcs, | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 180 | }, | 
|  | 181 | darwin: { | 
|  | 182 | srcs: ["client/usb_osx.cpp"], | 
|  | 183 | }, | 
| Josh Gao | 2776845 | 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 | ef28ca4 | 2019-12-19 16:36:30 -0800 | [diff] [blame] | 200 | "libadb_crypto", | 
|  | 201 | "libadb_protos", | 
| Joshua Duong | d85f5c0 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 202 | "libadb_pairing_connection", | 
|  | 203 | "libadb_tls_connection", | 
| Josh Gao | 2776845 | 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 | 269a4b4 | 2018-09-13 18:00:25 +0100 | [diff] [blame] | 210 | "libutils", | 
|  | 211 | "liblog", | 
|  | 212 | "libcutils", | 
| Joshua Duong | d85f5c0 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 213 | "libprotobuf-cpp-lite", | 
| Josh Gao | 2776845 | 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 | d85f5c0 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 222 | "libadb_crypto_static", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 223 | "libadb_host", | 
| Joshua Duong | d85f5c0 | 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 | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 228 | "libbase", | 
|  | 229 | "libcutils", | 
|  | 230 | "libcrypto_utils", | 
|  | 231 | "libcrypto", | 
| Tom Cherry | 9921630 | 2020-01-08 13:41:56 -0800 | [diff] [blame] | 232 | "liblog", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 233 | "libmdnssd", | 
|  | 234 | "libdiagnose_usb", | 
| Joshua Duong | d85f5c0 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 235 | "libprotobuf-cpp-lite", | 
|  | 236 | "libssl", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 237 | "libusb", | 
|  | 238 | ], | 
| Josh Gao | f8a97c1 | 2018-03-23 15:37:20 -0700 | [diff] [blame] | 239 |  | 
|  | 240 | target: { | 
|  | 241 | windows: { | 
|  | 242 | enabled: true, | 
| Josh Gao | efd8ae2 | 2019-07-16 15:08:42 -0700 | [diff] [blame] | 243 | ldflags: ["-municode"], | 
| Josh Gao | f8a97c1 | 2018-03-23 15:37:20 -0700 | [diff] [blame] | 244 | shared_libs: ["AdbWinApi"], | 
|  | 245 | }, | 
|  | 246 | }, | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 247 | } | 
|  | 248 |  | 
| Josh Gao | 9c59649 | 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 | d85f5c0 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 268 | "libadb_crypto_static", | 
|  | 269 | "libadb_tls_connection_static", | 
|  | 270 | "libadbd_auth", | 
| Josh Gao | 9c59649 | 2018-04-04 11:27:24 -0700 | [diff] [blame] | 271 | "libbase", | 
|  | 272 | "libcutils", | 
|  | 273 | "libcrypto_utils", | 
| Colin Cross | f117f34 | 2019-09-18 11:04:35 -0700 | [diff] [blame] | 274 | "libcrypto_static", | 
| Josh Gao | 9c59649 | 2018-04-04 11:27:24 -0700 | [diff] [blame] | 275 | "libdiagnose_usb", | 
|  | 276 | "liblog", | 
| Joshua Duong | d85f5c0 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 277 | "libssl", | 
| Josh Gao | 9c59649 | 2018-04-04 11:27:24 -0700 | [diff] [blame] | 278 | "libusb", | 
|  | 279 | ], | 
|  | 280 | } | 
|  | 281 |  | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 282 | cc_binary_host { | 
|  | 283 | name: "adb", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 284 |  | 
| Josh Gao | 9952258 | 2020-02-03 23:08:05 -0800 | [diff] [blame] | 285 | stl: "libc++_static", | 
| Josh Gao | 2776845 | 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 | ed409ea | 2018-01-29 16:30:36 +0000 | [diff] [blame] | 295 | "client/adb_install.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 296 | "client/line_printer.cpp", | 
| Joshua Gilpatrick | af3ce08 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 297 | "client/fastdeploy.cpp", | 
|  | 298 | "client/fastdeploycallbacks.cpp", | 
| Alex Buynytskyy | 96ff54b | 2020-02-13 06:52:04 -0800 | [diff] [blame] | 299 | "client/incremental.cpp", | 
|  | 300 | "client/incremental_server.cpp", | 
| Songchun Fan | 8cdefd4 | 2020-03-13 13:11:43 -0700 | [diff] [blame] | 301 | "client/incremental_utils.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 302 | "shell_service_protocol.cpp", | 
|  | 303 | ], | 
|  | 304 |  | 
| Joshua Gilpatrick | af3ce08 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 305 | generated_headers: [ | 
|  | 306 | "bin2c_fastdeployagent", | 
|  | 307 | "bin2c_fastdeployagentscript" | 
|  | 308 | ], | 
|  | 309 |  | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 310 | static_libs: [ | 
| Joshua Duong | ef28ca4 | 2019-12-19 16:36:30 -0800 | [diff] [blame] | 311 | "libadb_crypto", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 312 | "libadb_host", | 
| Joshua Duong | d85f5c0 | 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 | af3ce08 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 317 | "libandroidfw", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 318 | "libbase", | 
|  | 319 | "libcutils", | 
|  | 320 | "libcrypto_utils", | 
|  | 321 | "libcrypto", | 
| Joshua Gilpatrick | af3ce08 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 322 | "libfastdeploy_host", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 323 | "libdiagnose_usb", | 
|  | 324 | "liblog", | 
| Alex Buynytskyy | 96ff54b | 2020-02-13 06:52:04 -0800 | [diff] [blame] | 325 | "liblz4", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 326 | "libmdnssd", | 
| Joshua Gilpatrick | af3ce08 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 327 | "libprotobuf-cpp-lite", | 
| Joshua Duong | d85f5c0 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 328 | "libssl", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 329 | "libusb", | 
| Idries Hamadi | 269a4b4 | 2018-09-13 18:00:25 +0100 | [diff] [blame] | 330 | "libutils", | 
|  | 331 | "liblog", | 
| Joshua Gilpatrick | af3ce08 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 332 | "libziparchive", | 
|  | 333 | "libz", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 334 | ], | 
|  | 335 |  | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 336 | // Don't add anything here, we don't want additional shared dependencies | 
|  | 337 | // on the host adb tool, and shared libraries that link against libc++ | 
|  | 338 | // will violate ODR | 
|  | 339 | shared_libs: [], | 
|  | 340 |  | 
| Dan Willemsen | 3f439a7 | 2018-11-19 19:11:35 -0800 | [diff] [blame] | 341 | // Archive adb, adb.exe. | 
|  | 342 | dist: { | 
|  | 343 | targets: [ | 
|  | 344 | "dist_files", | 
|  | 345 | "sdk", | 
|  | 346 | "win_sdk", | 
|  | 347 | ], | 
|  | 348 | }, | 
|  | 349 |  | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 350 | target: { | 
|  | 351 | darwin: { | 
|  | 352 | cflags: [ | 
|  | 353 | "-Wno-sizeof-pointer-memaccess", | 
|  | 354 | ], | 
|  | 355 | }, | 
|  | 356 | windows: { | 
|  | 357 | enabled: true, | 
|  | 358 | ldflags: ["-municode"], | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 359 | shared_libs: ["AdbWinApi"], | 
|  | 360 | required: [ | 
|  | 361 | "AdbWinUsbApi", | 
|  | 362 | ], | 
|  | 363 | }, | 
|  | 364 | }, | 
|  | 365 | } | 
|  | 366 |  | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 367 | // libadbd_core contains the common sources to build libadbd and libadbd_services. | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 368 | cc_library_static { | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 369 | name: "libadbd_core", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 370 | defaults: ["adbd_defaults", "host_adbd_supported"], | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 371 | recovery_available: true, | 
|  | 372 |  | 
|  | 373 | // libminadbd wants both, as it's used to build native tests. | 
|  | 374 | compile_multilib: "both", | 
|  | 375 |  | 
| Josh Gao | b43ad44 | 2019-07-11 13:47:44 -0700 | [diff] [blame] | 376 | srcs: libadb_srcs + libadb_linux_srcs + libadb_posix_srcs + [ | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 377 | "daemon/auth.cpp", | 
|  | 378 | "daemon/jdwp_service.cpp", | 
| Josh Gao | bbe3385 | 2020-02-26 16:39:20 -0800 | [diff] [blame] | 379 | "daemon/logging.cpp", | 
| Josh Gao | 3467ef4 | 2020-02-21 16:38:29 -0800 | [diff] [blame] | 380 | "daemon/adb_wifi.cpp", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 381 | ], | 
|  | 382 |  | 
|  | 383 | local_include_dirs: [ | 
|  | 384 | "daemon/include", | 
|  | 385 | ], | 
|  | 386 |  | 
| Dan Willemsen | ab971b5 | 2018-08-29 14:58:02 -0700 | [diff] [blame] | 387 | generated_headers: ["platform_tools_version"], | 
|  | 388 |  | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 389 | static_libs: [ | 
| Josh Gao | bb7fc92 | 2020-01-22 17:58:03 -0800 | [diff] [blame] | 390 | "libadbconnection_server", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 391 | "libdiagnose_usb", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 392 | ], | 
|  | 393 |  | 
|  | 394 | shared_libs: [ | 
| Joshua Duong | ef28ca4 | 2019-12-19 16:36:30 -0800 | [diff] [blame] | 395 | "libadb_crypto", | 
| Joshua Duong | d85f5c0 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 396 | "libadb_pairing_connection", | 
|  | 397 | "libadb_protos", | 
|  | 398 | "libadb_tls_connection", | 
| Josh Gao | 2752326 | 2019-10-22 12:30:39 -0700 | [diff] [blame] | 399 | "libadbd_auth", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 400 | "libasyncio", | 
|  | 401 | "libbase", | 
|  | 402 | "libcrypto", | 
|  | 403 | "libcrypto_utils", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 404 | "liblog", | 
|  | 405 | ], | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 406 |  | 
|  | 407 | target: { | 
|  | 408 | android: { | 
|  | 409 | whole_static_libs: [ | 
|  | 410 | "libqemu_pipe", | 
|  | 411 | ], | 
|  | 412 | srcs: [ | 
|  | 413 | "daemon/transport_qemu.cpp", | 
|  | 414 | "daemon/usb.cpp", | 
|  | 415 | "daemon/usb_ffs.cpp", | 
|  | 416 | "daemon/usb_legacy.cpp", | 
|  | 417 | ] | 
|  | 418 | }, | 
|  | 419 | linux_glibc: { | 
|  | 420 | srcs: [ | 
|  | 421 | "daemon/usb_dummy.cpp", | 
|  | 422 | ] | 
| Joshua Duong | caca3a9 | 2020-02-26 15:43:44 -0800 | [diff] [blame] | 423 | }, | 
|  | 424 | recovery: { | 
|  | 425 | exclude_shared_libs: [ | 
|  | 426 | "libadb_pairing_auth", | 
|  | 427 | "libadb_pairing_connection", | 
|  | 428 | ], | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 429 | } | 
|  | 430 | }, | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 431 | } | 
|  | 432 |  | 
| Josh Gao | d1ee508 | 2020-03-09 15:20:55 -0700 | [diff] [blame] | 433 | cc_library { | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 434 | name: "libadbd_services", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 435 | defaults: ["adbd_defaults", "host_adbd_supported"], | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 436 | recovery_available: true, | 
|  | 437 | compile_multilib: "both", | 
|  | 438 |  | 
|  | 439 | srcs: [ | 
|  | 440 | "daemon/file_sync_service.cpp", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 441 | "daemon/services.cpp", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 442 | "daemon/shell_service.cpp", | 
|  | 443 | "shell_service_protocol.cpp", | 
|  | 444 | ], | 
|  | 445 |  | 
|  | 446 | cflags: [ | 
|  | 447 | "-D_GNU_SOURCE", | 
|  | 448 | "-Wno-deprecated-declarations", | 
|  | 449 | ], | 
|  | 450 |  | 
|  | 451 | static_libs: [ | 
| Josh Gao | bb7fc92 | 2020-01-22 17:58:03 -0800 | [diff] [blame] | 452 | "libadbconnection_server", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 453 | "libadbd_core", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 454 | "libdiagnose_usb", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 455 | ], | 
|  | 456 |  | 
|  | 457 | shared_libs: [ | 
| Joshua Duong | d85f5c0 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 458 | "libadb_crypto", | 
|  | 459 | "libadb_pairing_connection", | 
|  | 460 | "libadb_protos", | 
|  | 461 | "libadb_tls_connection", | 
| Josh Gao | 2752326 | 2019-10-22 12:30:39 -0700 | [diff] [blame] | 462 | "libadbd_auth", | 
| Josh Gao | b5778c1 | 2020-02-19 13:50:57 -0800 | [diff] [blame] | 463 | "libadbd_fs", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 464 | "libasyncio", | 
|  | 465 | "libbase", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 466 | "libcrypto", | 
|  | 467 | "libcrypto_utils", | 
| Josh Gao | d1ee508 | 2020-03-09 15:20:55 -0700 | [diff] [blame] | 468 | "libcutils_sockets", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 469 | "liblog", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 470 | ], | 
| Alex Buynytskyy | 640407d | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 471 |  | 
|  | 472 | target: { | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 473 | android: { | 
|  | 474 | srcs: [ | 
|  | 475 | "daemon/abb_service.cpp", | 
|  | 476 | "daemon/framebuffer_service.cpp", | 
|  | 477 | "daemon/mdns.cpp", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 478 | "daemon/restart_service.cpp", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 479 | ], | 
|  | 480 | shared_libs: [ | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 481 | "libmdnssd", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 482 | "libselinux", | 
|  | 483 | ], | 
|  | 484 | }, | 
| Alex Buynytskyy | 640407d | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 485 | recovery: { | 
|  | 486 | exclude_srcs: [ | 
|  | 487 | "daemon/abb_service.cpp", | 
|  | 488 | ], | 
| Joshua Duong | caca3a9 | 2020-02-26 15:43:44 -0800 | [diff] [blame] | 489 | exclude_shared_libs: [ | 
|  | 490 | "libadb_pairing_auth", | 
|  | 491 | "libadb_pairing_connection", | 
|  | 492 | ], | 
| Alex Buynytskyy | 640407d | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 493 | }, | 
|  | 494 | }, | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 495 | } | 
|  | 496 |  | 
|  | 497 | cc_library { | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 498 | name: "libadbd", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 499 | defaults: ["adbd_defaults", "host_adbd_supported"], | 
| Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 500 | recovery_available: true, | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 501 |  | 
| Josh Gao | bb7fc92 | 2020-01-22 17:58:03 -0800 | [diff] [blame] | 502 | // avoid getting duplicate symbol of android::build::getbuildnumber(). | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 503 | use_version_lib: false, | 
|  | 504 |  | 
|  | 505 | // libminadbd wants both, as it's used to build native tests. | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 506 | compile_multilib: "both", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 507 |  | 
|  | 508 | // libadbd doesn't build any additional source, but to expose libadbd_core as a shared library. | 
|  | 509 | whole_static_libs: [ | 
| Josh Gao | bb7fc92 | 2020-01-22 17:58:03 -0800 | [diff] [blame] | 510 | "libadbconnection_server", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 511 | "libadbd_core", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 512 | ], | 
|  | 513 |  | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 514 | shared_libs: [ | 
| Joshua Duong | d85f5c0 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 515 | "libadb_crypto", | 
|  | 516 | "libadb_pairing_connection", | 
|  | 517 | "libadb_tls_connection", | 
| Josh Gao | 2752326 | 2019-10-22 12:30:39 -0700 | [diff] [blame] | 518 | "libadbd_auth", | 
| Josh Gao | b5778c1 | 2020-02-19 13:50:57 -0800 | [diff] [blame] | 519 | "libadbd_fs", | 
| Josh Gao | d1ee508 | 2020-03-09 15:20:55 -0700 | [diff] [blame] | 520 | "libadbd_services", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 521 | "libasyncio", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 522 | "libbase", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 523 | "libcrypto", | 
|  | 524 | "libcrypto_utils", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 525 | "liblog", | 
| Josh Gao | b5778c1 | 2020-02-19 13:50:57 -0800 | [diff] [blame] | 526 | "libselinux", | 
|  | 527 | ], | 
|  | 528 |  | 
| Joshua Duong | caca3a9 | 2020-02-26 15:43:44 -0800 | [diff] [blame] | 529 | target: { | 
|  | 530 | recovery: { | 
|  | 531 | exclude_shared_libs: [ | 
|  | 532 | "libadb_pairing_auth", | 
|  | 533 | "libadb_pairing_connection", | 
|  | 534 | ], | 
|  | 535 | } | 
|  | 536 | }, | 
|  | 537 |  | 
| Josh Gao | b5778c1 | 2020-02-19 13:50:57 -0800 | [diff] [blame] | 538 | static_libs: [ | 
| Josh Gao | b5778c1 | 2020-02-19 13:50:57 -0800 | [diff] [blame] | 539 | "libcutils_sockets", | 
|  | 540 | "libdiagnose_usb", | 
| Josh Gao | 3467ef4 | 2020-02-21 16:38:29 -0800 | [diff] [blame] | 541 | "libmdnssd", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 542 | ], | 
| Jerry Zhang | b156c60 | 2018-05-07 15:14:47 -0700 | [diff] [blame] | 543 |  | 
|  | 544 | export_include_dirs: [ | 
|  | 545 | "daemon/include", | 
|  | 546 | ], | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 547 | } | 
|  | 548 |  | 
|  | 549 | cc_binary { | 
|  | 550 | name: "adbd", | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 551 | defaults: ["adbd_defaults", "host_adbd_supported"], | 
| Josh Gao | 9952258 | 2020-02-03 23:08:05 -0800 | [diff] [blame] | 552 | stl: "libc++_static", | 
| Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 553 | recovery_available: true, | 
| Josh Gao | 8db99f8 | 2018-03-06 12:57:27 -0800 | [diff] [blame] | 554 |  | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 555 | srcs: [ | 
|  | 556 | "daemon/main.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 557 | ], | 
|  | 558 |  | 
|  | 559 | cflags: [ | 
|  | 560 | "-D_GNU_SOURCE", | 
|  | 561 | "-Wno-deprecated-declarations", | 
|  | 562 | ], | 
|  | 563 |  | 
|  | 564 | strip: { | 
|  | 565 | keep_symbols: true, | 
|  | 566 | }, | 
|  | 567 |  | 
| Josh Gao | 594f70f | 2019-08-15 14:05:12 -0700 | [diff] [blame] | 568 | static_libs: [ | 
| Joshua Duong | caca3a9 | 2020-02-26 15:43:44 -0800 | [diff] [blame] | 569 | "libadb_crypto", | 
|  | 570 | "libadb_tls_connection", | 
| Josh Gao | bb7fc92 | 2020-01-22 17:58:03 -0800 | [diff] [blame] | 571 | "libadbconnection_server", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 572 | "libadbd", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 573 | "libadbd_services", | 
| Josh Gao | 594f70f | 2019-08-15 14:05:12 -0700 | [diff] [blame] | 574 | "libasyncio", | 
| Tao Bao | eca59ae | 2018-07-30 20:45:27 -0700 | [diff] [blame] | 575 | "libbase", | 
|  | 576 | "libcap", | 
| Josh Gao | 594f70f | 2019-08-15 14:05:12 -0700 | [diff] [blame] | 577 | "libcrypto_utils", | 
| Josh Gao | b5778c1 | 2020-02-19 13:50:57 -0800 | [diff] [blame] | 578 | "libcutils_sockets", | 
| Josh Gao | 594f70f | 2019-08-15 14:05:12 -0700 | [diff] [blame] | 579 | "libdiagnose_usb", | 
| Josh Gao | 594f70f | 2019-08-15 14:05:12 -0700 | [diff] [blame] | 580 | "libmdnssd", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 581 | "libminijail", | 
| Joshua Duong | d85f5c0 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 582 | "libssl", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 583 | ], | 
| Josh Gao | 594f70f | 2019-08-15 14:05:12 -0700 | [diff] [blame] | 584 |  | 
|  | 585 | shared_libs: [ | 
| Joshua Duong | d85f5c0 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 586 | "libadb_pairing_connection", | 
|  | 587 | "libadb_protos", | 
| Josh Gao | 7f72945 | 2020-01-16 12:40:43 -0800 | [diff] [blame] | 588 | "libadbd_auth", | 
| Josh Gao | b5778c1 | 2020-02-19 13:50:57 -0800 | [diff] [blame] | 589 | "libadbd_fs", | 
| Josh Gao | 594f70f | 2019-08-15 14:05:12 -0700 | [diff] [blame] | 590 | "libcrypto", | 
| Jiyong Park | 01aa81c | 2020-03-09 14:35:57 +0900 | [diff] [blame] | 591 | "liblog", | 
| Jiyong Park | 8ce4a30 | 2020-03-11 14:00:33 +0900 | [diff] [blame] | 592 | "libselinux", | 
| Josh Gao | 594f70f | 2019-08-15 14:05:12 -0700 | [diff] [blame] | 593 | ], | 
| Josh Gao | 9952258 | 2020-02-03 23:08:05 -0800 | [diff] [blame] | 594 |  | 
| Joshua Duong | caca3a9 | 2020-02-26 15:43:44 -0800 | [diff] [blame] | 595 | target: { | 
|  | 596 | recovery: { | 
|  | 597 | exclude_shared_libs: [ | 
|  | 598 | "libadb_pairing_auth", | 
|  | 599 | "libadb_pairing_connection", | 
|  | 600 | ], | 
|  | 601 | } | 
|  | 602 | }, | 
|  | 603 |  | 
| Josh Gao | b5778c1 | 2020-02-19 13:50:57 -0800 | [diff] [blame] | 604 | required: [ | 
|  | 605 | "libadbd_auth", | 
|  | 606 | "libadbd_fs", | 
|  | 607 | ], | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 608 | } | 
|  | 609 |  | 
| Josh Gao | 7b7ee19 | 2019-10-23 13:27:17 -0700 | [diff] [blame] | 610 | phony { | 
|  | 611 | name: "adbd_system_binaries", | 
|  | 612 | required: [ | 
|  | 613 | "abb", | 
| Josh Gao | 2c356bb | 2019-10-22 12:30:36 -0700 | [diff] [blame] | 614 | "reboot", | 
| Josh Gao | f61f414 | 2019-10-22 12:30:30 -0700 | [diff] [blame] | 615 | "set-verity-state", | 
| Josh Gao | 7b7ee19 | 2019-10-23 13:27:17 -0700 | [diff] [blame] | 616 | ] | 
|  | 617 | } | 
|  | 618 |  | 
|  | 619 | phony { | 
|  | 620 | name: "adbd_system_binaries_recovery", | 
|  | 621 | required: [ | 
| Josh Gao | 2c356bb | 2019-10-22 12:30:36 -0700 | [diff] [blame] | 622 | "reboot.recovery", | 
| Josh Gao | 7b7ee19 | 2019-10-23 13:27:17 -0700 | [diff] [blame] | 623 | ], | 
|  | 624 | } | 
|  | 625 |  | 
| Alex Buynytskyy | 640407d | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 626 | cc_binary { | 
|  | 627 | name: "abb", | 
|  | 628 |  | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 629 | defaults: ["adbd_defaults"], | 
| Josh Gao | 9952258 | 2020-02-03 23:08:05 -0800 | [diff] [blame] | 630 | stl: "libc++", | 
| Alex Buynytskyy | 640407d | 2018-12-12 10:48:50 -0800 | [diff] [blame] | 631 | recovery_available: false, | 
|  | 632 |  | 
|  | 633 | srcs: [ | 
|  | 634 | "daemon/abb.cpp", | 
|  | 635 | ], | 
|  | 636 |  | 
|  | 637 | cflags: [ | 
|  | 638 | "-D_GNU_SOURCE", | 
|  | 639 | "-Wno-deprecated-declarations", | 
|  | 640 | ], | 
|  | 641 |  | 
|  | 642 | strip: { | 
|  | 643 | keep_symbols: true, | 
|  | 644 | }, | 
|  | 645 |  | 
|  | 646 | static_libs: [ | 
|  | 647 | "libadbd_core", | 
|  | 648 | "libadbd_services", | 
|  | 649 | "libcmd", | 
|  | 650 | ], | 
|  | 651 |  | 
|  | 652 | shared_libs: [ | 
|  | 653 | "libbase", | 
|  | 654 | "libbinder", | 
|  | 655 | "liblog", | 
|  | 656 | "libutils", | 
|  | 657 | "libselinux", | 
|  | 658 | ], | 
|  | 659 | } | 
|  | 660 |  | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 661 | cc_test { | 
|  | 662 | name: "adbd_test", | 
| Josh Gao | 9952258 | 2020-02-03 23:08:05 -0800 | [diff] [blame] | 663 |  | 
| Josh Gao | 776c2ec | 2019-01-22 19:36:15 -0800 | [diff] [blame] | 664 | defaults: ["adbd_defaults"], | 
| Josh Gao | 9952258 | 2020-02-03 23:08:05 -0800 | [diff] [blame] | 665 | stl: "libc++_static", | 
|  | 666 |  | 
|  | 667 | recovery_available: false, | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 668 | srcs: libadb_test_srcs + [ | 
| Josh Gao | 997cfac | 2018-07-25 18:15:52 -0700 | [diff] [blame] | 669 | "daemon/services.cpp", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 670 | "daemon/shell_service.cpp", | 
|  | 671 | "daemon/shell_service_test.cpp", | 
|  | 672 | "shell_service_protocol.cpp", | 
|  | 673 | "shell_service_protocol_test.cpp", | 
|  | 674 | ], | 
|  | 675 |  | 
|  | 676 | static_libs: [ | 
|  | 677 | "libadbd", | 
| Josh Gao | 2752326 | 2019-10-22 12:30:39 -0700 | [diff] [blame] | 678 | "libadbd_auth", | 
| Joshua Duong | d85f5c0 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 679 | "libadb_crypto_static", | 
|  | 680 | "libadb_pairing_connection_static", | 
|  | 681 | "libadb_tls_connection_static", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 682 | "libbase", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 683 | "libcrypto_utils", | 
| Colin Cross | f117f34 | 2019-09-18 11:04:35 -0700 | [diff] [blame] | 684 | "libcrypto_static", | 
| Josh Gao | b5778c1 | 2020-02-19 13:50:57 -0800 | [diff] [blame] | 685 | "libcutils_sockets", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 686 | "libdiagnose_usb", | 
|  | 687 | "liblog", | 
|  | 688 | "libusb", | 
|  | 689 | "libmdnssd", | 
| Jiyong Park | 011ee12 | 2018-05-29 16:41:30 +0900 | [diff] [blame] | 690 | "libselinux", | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 691 | ], | 
| Josh Gao | 7e01587 | 2020-01-30 14:49:01 -0800 | [diff] [blame] | 692 | test_suites: ["device-tests", "mts"], | 
| Dan Shi | d1360f4 | 2019-09-24 09:04:05 -0700 | [diff] [blame] | 693 | require_root: true, | 
| Josh Gao | 2776845 | 2018-01-02 12:01:43 -0800 | [diff] [blame] | 694 | } | 
|  | 695 |  | 
| Julien Desprez | 75fea7e | 2018-08-08 12:08:50 -0700 | [diff] [blame] | 696 | python_test_host { | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 697 | name: "adb_integration_test_adb", | 
|  | 698 | main: "test_adb.py", | 
|  | 699 | srcs: [ | 
|  | 700 | "test_adb.py", | 
|  | 701 | ], | 
| Julien Desprez | 75fea7e | 2018-08-08 12:08:50 -0700 | [diff] [blame] | 702 | test_config: "adb_integration_test_adb.xml", | 
|  | 703 | test_suites: ["general-tests"], | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 704 | version: { | 
|  | 705 | py2: { | 
| Josh Gao | 9b6522b | 2018-08-07 14:31:17 -0700 | [diff] [blame] | 706 | enabled: false, | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 707 | }, | 
|  | 708 | py3: { | 
| Josh Gao | 9b6522b | 2018-08-07 14:31:17 -0700 | [diff] [blame] | 709 | enabled: true, | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 710 | }, | 
| GuangHui Liu | 41bda34 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 711 | }, | 
| GuangHui Liu | 41bda34 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 712 | } | 
|  | 713 |  | 
| Julien Desprez | 618f0e1 | 2018-10-12 13:48:14 -0700 | [diff] [blame] | 714 | python_test_host { | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 715 | name: "adb_integration_test_device", | 
|  | 716 | main: "test_device.py", | 
|  | 717 | srcs: [ | 
|  | 718 | "test_device.py", | 
|  | 719 | ], | 
|  | 720 | libs: [ | 
|  | 721 | "adb_py", | 
|  | 722 | ], | 
| Julien Desprez | 618f0e1 | 2018-10-12 13:48:14 -0700 | [diff] [blame] | 723 | test_config: "adb_integration_test_device.xml", | 
|  | 724 | test_suites: ["general-tests"], | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 725 | version: { | 
|  | 726 | py2: { | 
| Josh Gao | 93dee96 | 2020-02-06 17:52:38 -0800 | [diff] [blame] | 727 | enabled: false, | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 728 | }, | 
|  | 729 | py3: { | 
| Josh Gao | 93dee96 | 2020-02-06 17:52:38 -0800 | [diff] [blame] | 730 | enabled: true, | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 731 | }, | 
| GuangHui Liu | 41bda34 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 732 | }, | 
| GuangHui Liu | 41bda34 | 2017-05-10 14:37:17 -0700 | [diff] [blame] | 733 | } | 
| Joshua Gilpatrick | af3ce08 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 734 |  | 
|  | 735 | // Note: using pipe for xxd to control the variable name generated | 
|  | 736 | // the default name used by xxd is the path to the input file. | 
|  | 737 | java_genrule { | 
|  | 738 | name: "bin2c_fastdeployagent", | 
|  | 739 | out: ["deployagent.inc"], | 
|  | 740 | srcs: [":deployagent"], | 
|  | 741 | cmd: "(echo 'unsigned char kDeployAgent[] = {' && xxd -i <$(in) && echo '};') > $(out)", | 
|  | 742 | } | 
|  | 743 |  | 
|  | 744 | genrule { | 
|  | 745 | name: "bin2c_fastdeployagentscript", | 
|  | 746 | out: ["deployagentscript.inc"], | 
|  | 747 | srcs: ["fastdeploy/deployagent/deployagent.sh"], | 
|  | 748 | cmd: "(echo 'unsigned char kDeployAgentScript[] = {' && xxd -i <$(in) && echo '};') > $(out)", | 
|  | 749 | } | 
|  | 750 |  | 
|  | 751 | cc_library_host_static { | 
|  | 752 | name: "libfastdeploy_host", | 
|  | 753 | defaults: ["adb_defaults"], | 
|  | 754 | srcs: [ | 
| Alex Buynytskyy | 665f3ff | 2019-09-16 12:10:54 -0700 | [diff] [blame] | 755 | "fastdeploy/deploypatchgenerator/apk_archive.cpp", | 
| Joshua Gilpatrick | af3ce08 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 756 | "fastdeploy/deploypatchgenerator/deploy_patch_generator.cpp", | 
|  | 757 | "fastdeploy/deploypatchgenerator/patch_utils.cpp", | 
|  | 758 | "fastdeploy/proto/ApkEntry.proto", | 
|  | 759 | ], | 
|  | 760 | static_libs: [ | 
|  | 761 | "libadb_host", | 
|  | 762 | "libandroidfw", | 
|  | 763 | "libbase", | 
|  | 764 | "libcutils", | 
|  | 765 | "libcrypto_utils", | 
|  | 766 | "libcrypto", | 
|  | 767 | "libdiagnose_usb", | 
|  | 768 | "liblog", | 
|  | 769 | "libmdnssd", | 
|  | 770 | "libusb", | 
|  | 771 | "libutils", | 
|  | 772 | "libziparchive", | 
|  | 773 | "libz", | 
|  | 774 | ], | 
| Joshua Gilpatrick | af3ce08 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 775 | proto: { | 
|  | 776 | type: "lite", | 
|  | 777 | export_proto_headers: true, | 
|  | 778 | }, | 
|  | 779 | target: { | 
|  | 780 | windows: { | 
|  | 781 | enabled: true, | 
|  | 782 | shared_libs: ["AdbWinApi"], | 
|  | 783 | }, | 
|  | 784 | }, | 
|  | 785 | } | 
|  | 786 |  | 
|  | 787 | cc_test_host { | 
|  | 788 | name: "fastdeploy_test", | 
|  | 789 | defaults: ["adb_defaults"], | 
|  | 790 | srcs: [ | 
| Alex Buynytskyy | 665f3ff | 2019-09-16 12:10:54 -0700 | [diff] [blame] | 791 | "fastdeploy/deploypatchgenerator/apk_archive_test.cpp", | 
| Joshua Gilpatrick | af3ce08 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 792 | "fastdeploy/deploypatchgenerator/deploy_patch_generator_test.cpp", | 
|  | 793 | "fastdeploy/deploypatchgenerator/patch_utils_test.cpp", | 
|  | 794 | ], | 
|  | 795 | static_libs: [ | 
| Joshua Duong | d85f5c0 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 796 | "libadb_crypto_static", | 
| Joshua Gilpatrick | af3ce08 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 797 | "libadb_host", | 
| Joshua Duong | d85f5c0 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 798 | "libadb_pairing_auth_static", | 
|  | 799 | "libadb_pairing_connection_static", | 
|  | 800 | "libadb_protos_static", | 
|  | 801 | "libadb_tls_connection_static", | 
| Joshua Gilpatrick | af3ce08 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 802 | "libandroidfw", | 
|  | 803 | "libbase", | 
|  | 804 | "libcutils", | 
|  | 805 | "libcrypto_utils", | 
|  | 806 | "libcrypto", | 
|  | 807 | "libdiagnose_usb", | 
|  | 808 | "libfastdeploy_host", | 
|  | 809 | "liblog", | 
|  | 810 | "libmdnssd", | 
|  | 811 | "libprotobuf-cpp-lite", | 
| Joshua Duong | d85f5c0 | 2019-11-20 14:18:43 -0800 | [diff] [blame] | 812 | "libssl", | 
| Joshua Gilpatrick | af3ce08 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 813 | "libusb", | 
|  | 814 | "libutils", | 
|  | 815 | "libziparchive", | 
|  | 816 | "libz", | 
|  | 817 | ], | 
|  | 818 | target: { | 
|  | 819 | windows: { | 
|  | 820 | enabled: true, | 
|  | 821 | shared_libs: ["AdbWinApi"], | 
|  | 822 | }, | 
|  | 823 | }, | 
|  | 824 | data: [ | 
| Alex Buynytskyy | 665f3ff | 2019-09-16 12:10:54 -0700 | [diff] [blame] | 825 | "fastdeploy/testdata/rotating_cube-metadata-release.data", | 
| Joshua Gilpatrick | af3ce08 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 826 | "fastdeploy/testdata/rotating_cube-release.apk", | 
| Alex Buynytskyy | 665f3ff | 2019-09-16 12:10:54 -0700 | [diff] [blame] | 827 | "fastdeploy/testdata/sample.apk", | 
|  | 828 | "fastdeploy/testdata/sample.cd", | 
| Joshua Gilpatrick | af3ce08 | 2019-07-19 09:42:12 -0700 | [diff] [blame] | 829 | ], | 
|  | 830 | } |