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