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