blob: 06cfcbfa4e5b62bf3cf5739647bf12e9b770fcee [file] [log] [blame]
GuangHui Liu41bda342017-05-10 14:37:17 -07001// 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 Gao27768452018-01-02 12:01:43 -080015cc_defaults {
16 name: "adb_defaults",
17
18 cflags: [
19 "-Wall",
20 "-Wextra",
21 "-Werror",
Pirama Arumuga Nainar79821782018-06-01 11:31:38 -070022 "-Wexit-time-destructors",
Josh Gao27768452018-01-02 12:01:43 -080023 "-Wno-unused-parameter",
24 "-Wno-missing-field-initializers",
Josh Gao776c2ec2019-01-22 19:36:15 -080025 "-Wthread-safety",
Josh Gao27768452018-01-02 12:01:43 -080026 "-Wvla",
Bowgo Tsai9b30c0a2019-03-12 04:25:33 +080027 "-DADB_HOST=1", // overridden by adbd_defaults
28 "-DALLOW_ADBD_ROOT=0", // overridden by adbd_defaults
Josh Gao27241a72019-04-25 14:04:57 -070029 "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION=1",
Joshua Gilpatrickaf3ce082019-07-19 09:42:12 -070030 "-DENABLE_FASTDEPLOY=1", // enable fast deploy
Josh Gao27768452018-01-02 12:01:43 -080031 ],
Josh Gao6eb78822018-11-16 15:40:16 -080032 cpp_std: "experimental",
Josh Gao27768452018-01-02 12:01:43 -080033
Josh Gaoc7567fa2018-02-27 15:49:23 -080034 use_version_lib: true,
Josh Gao27768452018-01-02 12:01:43 -080035 compile_multilib: "first",
Josh Gao27768452018-01-02 12:01:43 -080036
37 target: {
Josh Gao27768452018-01-02 12:01:43 -080038 darwin: {
39 host_ldlibs: [
40 "-lpthread",
41 "-framework CoreFoundation",
42 "-framework IOKit",
43 "-lobjc",
44 ],
45 },
46
47 windows: {
48 cflags: [
49 // Define windows.h and tchar.h Unicode preprocessor symbols so that
50 // CreateFile(), _tfopen(), etc. map to versions that take wchar_t*, breaking the
51 // build if you accidentally pass char*. Fix by calling like:
52 // std::wstring path_wide;
53 // if (!android::base::UTF8ToWide(path_utf8, &path_wide)) { /* error handling */ }
54 // CreateFileW(path_wide.c_str());
55 "-DUNICODE=1",
56 "-D_UNICODE=1",
57
Elliott Hughes3c59cb82018-12-03 09:02:18 -080058 // Unlike on Linux, -std=gnu++ doesn't set _GNU_SOURCE on Windows.
Josh Gao27768452018-01-02 12:01:43 -080059 "-D_GNU_SOURCE",
Josh Gao2e1e7892018-03-23 13:03:28 -070060
61 // MinGW hides some things behind _POSIX_SOURCE.
62 "-D_POSIX_SOURCE",
Josh Gao776c2ec2019-01-22 19:36:15 -080063
Josh Gao4710e532019-04-17 16:57:43 -070064 // libusb uses __stdcall on a variadic function, which gets ignored.
65 "-Wno-ignored-attributes",
66
Josh Gao776c2ec2019-01-22 19:36:15 -080067 // Not supported yet.
68 "-Wno-thread-safety",
Josh Gao27768452018-01-02 12:01:43 -080069 ],
Josh Gaof8a97c12018-03-23 15:37:20 -070070
71 host_ldlibs: [
72 "-lws2_32",
73 "-lgdi32",
74 "-luserenv",
75 ],
Josh Gao27768452018-01-02 12:01:43 -080076 },
Josh Gao776c2ec2019-01-22 19:36:15 -080077 },
78}
Pirama Arumuga Nainar79821782018-06-01 11:31:38 -070079
Josh Gao776c2ec2019-01-22 19:36:15 -080080cc_defaults {
81 name: "adbd_defaults",
82 defaults: ["adb_defaults"],
83
84 cflags: ["-UADB_HOST", "-DADB_HOST=0"],
85 product_variables: {
86 debuggable: {
Pirama Arumuga Nainar79821782018-06-01 11:31:38 -070087 cflags: [
Bowgo Tsai9b30c0a2019-03-12 04:25:33 +080088 "-UALLOW_ADBD_ROOT",
89 "-DALLOW_ADBD_ROOT=1",
Josh Gao776c2ec2019-01-22 19:36:15 -080090 "-DALLOW_ADBD_DISABLE_VERITY",
91 "-DALLOW_ADBD_NO_AUTH",
Pirama Arumuga Nainar79821782018-06-01 11:31:38 -070092 ],
93 },
Josh Gao27768452018-01-02 12:01:43 -080094 },
95}
96
Josh Gao776c2ec2019-01-22 19:36:15 -080097cc_defaults {
98 name: "host_adbd_supported",
99
100 host_supported: true,
101 target: {
102 linux: {
103 enabled: true,
104 host_ldlibs: [
105 "-lresolv", // b64_pton
106 "-lutil", // forkpty
107 ],
108 },
109 darwin: {
110 enabled: false,
111 },
112 windows: {
113 enabled: false,
114 },
115 },
116}
117
Josh Gao27768452018-01-02 12:01:43 -0800118// libadb
119// =========================================================
120// These files are compiled for both the host and the device.
121libadb_srcs = [
122 "adb.cpp",
123 "adb_io.cpp",
124 "adb_listeners.cpp",
125 "adb_trace.cpp",
Josh Gao6e1246c2018-05-24 22:54:50 -0700126 "adb_unique_fd.cpp",
Josh Gao27768452018-01-02 12:01:43 -0800127 "adb_utils.cpp",
Josh Gao57e09b12019-06-28 13:50:37 -0700128 "fdevent/fdevent.cpp",
Josh Gao95068bb2019-07-08 15:23:17 -0700129 "fdevent/fdevent_poll.cpp",
Josh Gao27768452018-01-02 12:01:43 -0800130 "services.cpp",
131 "sockets.cpp",
132 "socket_spec.cpp",
133 "sysdeps/errno.cpp",
134 "transport.cpp",
Josh Gao6082e7d2018-04-05 16:16:04 -0700135 "transport_fd.cpp",
Josh Gao27768452018-01-02 12:01:43 -0800136 "transport_local.cpp",
137 "transport_usb.cpp",
138]
139
140libadb_posix_srcs = [
141 "sysdeps_unix.cpp",
142 "sysdeps/posix/network.cpp",
143]
144
145libadb_test_srcs = [
146 "adb_io_test.cpp",
147 "adb_listeners_test.cpp",
148 "adb_utils_test.cpp",
Josh Gao57e09b12019-06-28 13:50:37 -0700149 "fdevent/fdevent_test.cpp",
Josh Gao27768452018-01-02 12:01:43 -0800150 "socket_spec_test.cpp",
151 "socket_test.cpp",
152 "sysdeps_test.cpp",
153 "sysdeps/stat_test.cpp",
154 "transport_test.cpp",
Josh Gao7c738cd2018-04-03 14:37:11 -0700155 "types_test.cpp",
Josh Gao27768452018-01-02 12:01:43 -0800156]
157
158cc_library_host_static {
159 name: "libadb_host",
160 defaults: ["adb_defaults"],
161
162 srcs: libadb_srcs + [
163 "client/auth.cpp",
164 "client/usb_libusb.cpp",
165 "client/usb_dispatch.cpp",
166 "client/transport_mdns.cpp",
167 ],
168
Dan Willemsenab971b52018-08-29 14:58:02 -0700169 generated_headers: ["platform_tools_version"],
170
Josh Gao27768452018-01-02 12:01:43 -0800171 target: {
172 linux: {
173 srcs: ["client/usb_linux.cpp"],
174 },
175 darwin: {
176 srcs: ["client/usb_osx.cpp"],
177 },
178
179 not_windows: {
180 srcs: libadb_posix_srcs,
181 },
182 windows: {
183 enabled: true,
184 srcs: [
185 "client/usb_windows.cpp",
186 "sysdeps_win32.cpp",
187 "sysdeps/win32/errno.cpp",
188 "sysdeps/win32/stat.cpp",
189 ],
190 shared_libs: ["AdbWinApi"],
191 },
192 },
193
194 static_libs: [
195 "libbase",
196 "libcrypto_utils",
197 "libcrypto",
198 "libdiagnose_usb",
199 "libmdnssd",
200 "libusb",
Idries Hamadi269a4b42018-09-13 18:00:25 +0100201 "libutils",
202 "liblog",
203 "libcutils",
Josh Gao27768452018-01-02 12:01:43 -0800204 ],
205}
206
207cc_test_host {
208 name: "adb_test",
209 defaults: ["adb_defaults"],
210 srcs: libadb_test_srcs,
211 static_libs: [
212 "libadb_host",
213 "libbase",
214 "libcutils",
215 "libcrypto_utils",
216 "libcrypto",
217 "libmdnssd",
218 "libdiagnose_usb",
219 "libusb",
220 ],
Josh Gaof8a97c12018-03-23 15:37:20 -0700221
222 target: {
223 windows: {
224 enabled: true,
Josh Gaoefd8ae22019-07-16 15:08:42 -0700225 ldflags: ["-municode"],
Josh Gaof8a97c12018-03-23 15:37:20 -0700226 shared_libs: ["AdbWinApi"],
227 },
228 },
Josh Gao27768452018-01-02 12:01:43 -0800229}
230
Josh Gao9c596492018-04-04 11:27:24 -0700231cc_benchmark {
232 name: "adb_benchmark",
233 defaults: ["adb_defaults"],
234
235 srcs: ["transport_benchmark.cpp"],
236 target: {
237 android: {
238 static_libs: [
239 "libadbd",
240 ],
241 },
242 host: {
243 static_libs: [
244 "libadb_host",
245 ],
246 },
247 },
248
249 static_libs: [
250 "libbase",
251 "libcutils",
252 "libcrypto_utils",
253 "libcrypto",
254 "libdiagnose_usb",
255 "liblog",
256 "libusb",
257 ],
258}
259
Josh Gao27768452018-01-02 12:01:43 -0800260cc_binary_host {
261 name: "adb",
Josh Gao27768452018-01-02 12:01:43 -0800262
263 defaults: ["adb_defaults"],
264
265 srcs: [
266 "client/adb_client.cpp",
267 "client/bugreport.cpp",
268 "client/commandline.cpp",
269 "client/file_sync_client.cpp",
270 "client/main.cpp",
271 "client/console.cpp",
Idries Hamadied409ea2018-01-29 16:30:36 +0000272 "client/adb_install.cpp",
Josh Gao27768452018-01-02 12:01:43 -0800273 "client/line_printer.cpp",
Joshua Gilpatrickaf3ce082019-07-19 09:42:12 -0700274 "client/fastdeploy.cpp",
275 "client/fastdeploycallbacks.cpp",
Josh Gao27768452018-01-02 12:01:43 -0800276 "shell_service_protocol.cpp",
277 ],
278
Joshua Gilpatrickaf3ce082019-07-19 09:42:12 -0700279 generated_headers: [
280 "bin2c_fastdeployagent",
281 "bin2c_fastdeployagentscript"
282 ],
283
Josh Gao27768452018-01-02 12:01:43 -0800284 static_libs: [
285 "libadb_host",
Joshua Gilpatrickaf3ce082019-07-19 09:42:12 -0700286 "libandroidfw",
Josh Gao27768452018-01-02 12:01:43 -0800287 "libbase",
288 "libcutils",
289 "libcrypto_utils",
290 "libcrypto",
Joshua Gilpatrickaf3ce082019-07-19 09:42:12 -0700291 "libfastdeploy_host",
Josh Gao27768452018-01-02 12:01:43 -0800292 "libdiagnose_usb",
293 "liblog",
294 "libmdnssd",
Joshua Gilpatrickaf3ce082019-07-19 09:42:12 -0700295 "libprotobuf-cpp-lite",
Josh Gao27768452018-01-02 12:01:43 -0800296 "libusb",
Idries Hamadi269a4b42018-09-13 18:00:25 +0100297 "libutils",
298 "liblog",
Joshua Gilpatrickaf3ce082019-07-19 09:42:12 -0700299 "libziparchive",
300 "libz",
Josh Gao27768452018-01-02 12:01:43 -0800301 ],
302
303 stl: "libc++_static",
304
305 // Don't add anything here, we don't want additional shared dependencies
306 // on the host adb tool, and shared libraries that link against libc++
307 // will violate ODR
308 shared_libs: [],
309
Dan Willemsen3f439a72018-11-19 19:11:35 -0800310 // Archive adb, adb.exe.
311 dist: {
312 targets: [
313 "dist_files",
314 "sdk",
315 "win_sdk",
316 ],
317 },
318
Josh Gao27768452018-01-02 12:01:43 -0800319 target: {
320 darwin: {
321 cflags: [
322 "-Wno-sizeof-pointer-memaccess",
323 ],
324 },
325 windows: {
326 enabled: true,
327 ldflags: ["-municode"],
Josh Gao27768452018-01-02 12:01:43 -0800328 shared_libs: ["AdbWinApi"],
329 required: [
330 "AdbWinUsbApi",
331 ],
332 },
333 },
334}
335
Tao Baoeca59ae2018-07-30 20:45:27 -0700336// libadbd_core contains the common sources to build libadbd and libadbd_services.
Josh Gao27768452018-01-02 12:01:43 -0800337cc_library_static {
Tao Baoeca59ae2018-07-30 20:45:27 -0700338 name: "libadbd_core",
Josh Gao776c2ec2019-01-22 19:36:15 -0800339 defaults: ["adbd_defaults", "host_adbd_supported"],
Tao Baoeca59ae2018-07-30 20:45:27 -0700340 recovery_available: true,
341
342 // libminadbd wants both, as it's used to build native tests.
343 compile_multilib: "both",
344
345 srcs: libadb_srcs + libadb_posix_srcs + [
346 "daemon/auth.cpp",
347 "daemon/jdwp_service.cpp",
Tao Baoeca59ae2018-07-30 20:45:27 -0700348 ],
349
350 local_include_dirs: [
351 "daemon/include",
352 ],
353
Dan Willemsenab971b52018-08-29 14:58:02 -0700354 generated_headers: ["platform_tools_version"],
355
Tao Baoeca59ae2018-07-30 20:45:27 -0700356 static_libs: [
Josh Gao5f2c5bb2019-06-19 14:14:57 -0700357 "libadbconnection_server",
Tao Baoeca59ae2018-07-30 20:45:27 -0700358 "libdiagnose_usb",
Tao Baoeca59ae2018-07-30 20:45:27 -0700359 ],
360
361 shared_libs: [
362 "libasyncio",
363 "libbase",
364 "libcrypto",
365 "libcrypto_utils",
366 "libcutils",
367 "liblog",
368 ],
Josh Gao776c2ec2019-01-22 19:36:15 -0800369
370 target: {
371 android: {
372 whole_static_libs: [
373 "libqemu_pipe",
374 ],
375 srcs: [
376 "daemon/transport_qemu.cpp",
377 "daemon/usb.cpp",
378 "daemon/usb_ffs.cpp",
379 "daemon/usb_legacy.cpp",
380 ]
381 },
382 linux_glibc: {
383 srcs: [
384 "daemon/usb_dummy.cpp",
385 ]
386 }
387 },
Tao Baoeca59ae2018-07-30 20:45:27 -0700388}
389
390cc_library {
391 name: "libadbd_services",
Josh Gao776c2ec2019-01-22 19:36:15 -0800392 defaults: ["adbd_defaults", "host_adbd_supported"],
Tao Baoeca59ae2018-07-30 20:45:27 -0700393 recovery_available: true,
394 compile_multilib: "both",
395
396 srcs: [
397 "daemon/file_sync_service.cpp",
Tao Baoeca59ae2018-07-30 20:45:27 -0700398 "daemon/services.cpp",
Tao Baoeca59ae2018-07-30 20:45:27 -0700399 "daemon/shell_service.cpp",
400 "shell_service_protocol.cpp",
401 ],
402
403 cflags: [
404 "-D_GNU_SOURCE",
405 "-Wno-deprecated-declarations",
406 ],
407
408 static_libs: [
Josh Gao5f2c5bb2019-06-19 14:14:57 -0700409 "libadbconnection_server",
Tao Baoeca59ae2018-07-30 20:45:27 -0700410 "libadbd_core",
Tao Baoeca59ae2018-07-30 20:45:27 -0700411 "libdiagnose_usb",
Tao Baoeca59ae2018-07-30 20:45:27 -0700412 ],
413
414 shared_libs: [
415 "libasyncio",
416 "libbase",
Tao Baoeca59ae2018-07-30 20:45:27 -0700417 "libcrypto",
418 "libcrypto_utils",
419 "libcutils",
Tao Baoeca59ae2018-07-30 20:45:27 -0700420 "liblog",
Tao Baoeca59ae2018-07-30 20:45:27 -0700421 ],
Alex Buynytskyy640407d2018-12-12 10:48:50 -0800422
Mark Salyzyn2f6c1802019-02-15 07:45:26 -0800423 product_variables: {
424 debuggable: {
425 required: [
426 "remount",
427 ],
428 },
429 },
430
Alex Buynytskyy640407d2018-12-12 10:48:50 -0800431 target: {
Josh Gao776c2ec2019-01-22 19:36:15 -0800432 android: {
433 srcs: [
434 "daemon/abb_service.cpp",
435 "daemon/framebuffer_service.cpp",
436 "daemon/mdns.cpp",
437 "daemon/reboot_service.cpp",
438 "daemon/remount_service.cpp",
439 "daemon/restart_service.cpp",
440 "daemon/set_verity_enable_state_service.cpp",
441 ],
442 static_libs: [
443 "libavb_user",
444 ],
445 shared_libs: [
446 "libbootloader_message",
447 "libmdnssd",
Josh Gao776c2ec2019-01-22 19:36:15 -0800448 "libfec",
449 "libfs_mgr",
450 "libselinux",
451 ],
452 },
Alex Buynytskyy640407d2018-12-12 10:48:50 -0800453 recovery: {
454 exclude_srcs: [
455 "daemon/abb_service.cpp",
456 ],
457 },
458 },
Tao Baoeca59ae2018-07-30 20:45:27 -0700459}
460
461cc_library {
Josh Gao27768452018-01-02 12:01:43 -0800462 name: "libadbd",
Josh Gao776c2ec2019-01-22 19:36:15 -0800463 defaults: ["adbd_defaults", "host_adbd_supported"],
Jiyong Parka0e75042018-05-24 14:11:00 +0900464 recovery_available: true,
Josh Gao27768452018-01-02 12:01:43 -0800465
Tao Baoeca59ae2018-07-30 20:45:27 -0700466 // Avoid getting duplicate symbol of android::build::GetBuildNumber().
467 use_version_lib: false,
468
469 // libminadbd wants both, as it's used to build native tests.
Josh Gao27768452018-01-02 12:01:43 -0800470 compile_multilib: "both",
Tao Baoeca59ae2018-07-30 20:45:27 -0700471
472 // libadbd doesn't build any additional source, but to expose libadbd_core as a shared library.
473 whole_static_libs: [
474 "libadbd_core",
Josh Gao27768452018-01-02 12:01:43 -0800475 ],
476
Tao Baoeca59ae2018-07-30 20:45:27 -0700477 shared_libs: [
478 "libadbd_services",
Josh Gao27768452018-01-02 12:01:43 -0800479 "libasyncio",
Josh Gao27768452018-01-02 12:01:43 -0800480 "libbase",
Tao Baoeca59ae2018-07-30 20:45:27 -0700481 "libcrypto",
482 "libcrypto_utils",
483 "libcutils",
484 "liblog",
Josh Gao27768452018-01-02 12:01:43 -0800485 ],
Jerry Zhangb156c602018-05-07 15:14:47 -0700486
487 export_include_dirs: [
488 "daemon/include",
489 ],
Josh Gao27768452018-01-02 12:01:43 -0800490}
491
492cc_binary {
493 name: "adbd",
Josh Gao776c2ec2019-01-22 19:36:15 -0800494 defaults: ["adbd_defaults", "host_adbd_supported"],
Jiyong Parka0e75042018-05-24 14:11:00 +0900495 recovery_available: true,
Josh Gao8db99f82018-03-06 12:57:27 -0800496
Josh Gao27768452018-01-02 12:01:43 -0800497 srcs: [
498 "daemon/main.cpp",
Josh Gao27768452018-01-02 12:01:43 -0800499 ],
500
501 cflags: [
502 "-D_GNU_SOURCE",
503 "-Wno-deprecated-declarations",
504 ],
505
506 strip: {
507 keep_symbols: true,
508 },
509
Tao Baoeca59ae2018-07-30 20:45:27 -0700510 shared_libs: [
Josh Gao27768452018-01-02 12:01:43 -0800511 "libadbd",
Tao Baoeca59ae2018-07-30 20:45:27 -0700512 "libadbd_services",
513 "libbase",
514 "libcap",
Josh Gao27768452018-01-02 12:01:43 -0800515 "libcrypto",
Tao Baoeca59ae2018-07-30 20:45:27 -0700516 "libcutils",
Josh Gao27768452018-01-02 12:01:43 -0800517 "liblog",
Josh Gao27768452018-01-02 12:01:43 -0800518 "libminijail",
519 "libselinux",
Josh Gao27768452018-01-02 12:01:43 -0800520 ],
521}
522
Alex Buynytskyy640407d2018-12-12 10:48:50 -0800523cc_binary {
Josh Gaobde8c842019-05-01 18:25:14 -0700524 name: "static_adbd",
525 defaults: ["adbd_defaults", "host_adbd_supported"],
526
527 recovery_available: false,
528 static_executable: true,
529 host_supported: false,
530
531 srcs: [
532 "daemon/main.cpp",
533 ],
534
535 cflags: [
536 "-D_GNU_SOURCE",
537 "-Wno-deprecated-declarations",
538 ],
539
540 strip: {
541 keep_symbols: true,
542 },
543
544 static_libs: [
Josh Gao5f2c5bb2019-06-19 14:14:57 -0700545 "libadbconnection_server",
Josh Gaobde8c842019-05-01 18:25:14 -0700546 "libadbd",
547 "libadbd_services",
548 "libasyncio",
549 "libavb_user",
550 "libbase",
551 "libbootloader_message",
552 "libcap",
553 "libcrypto",
554 "libcrypto_utils",
555 "libcutils",
556 "libdiagnose_usb",
557 "libext4_utils",
558 "libfec",
559 "libfec_rs",
560 "libfs_mgr",
561 "liblog",
562 "liblp",
563 "libmdnssd",
564 "libminijail",
565 "libselinux",
566 "libsquashfs_utils",
567 ],
568}
569
570cc_binary {
Alex Buynytskyy640407d2018-12-12 10:48:50 -0800571 name: "abb",
572
Josh Gao776c2ec2019-01-22 19:36:15 -0800573 defaults: ["adbd_defaults"],
Alex Buynytskyy640407d2018-12-12 10:48:50 -0800574 recovery_available: false,
575
576 srcs: [
577 "daemon/abb.cpp",
578 ],
579
580 cflags: [
581 "-D_GNU_SOURCE",
582 "-Wno-deprecated-declarations",
583 ],
584
585 strip: {
586 keep_symbols: true,
587 },
588
589 static_libs: [
590 "libadbd_core",
591 "libadbd_services",
592 "libcmd",
593 ],
594
595 shared_libs: [
596 "libbase",
597 "libbinder",
598 "liblog",
599 "libutils",
600 "libselinux",
601 ],
602}
603
Josh Gao27768452018-01-02 12:01:43 -0800604cc_test {
605 name: "adbd_test",
Josh Gao776c2ec2019-01-22 19:36:15 -0800606 defaults: ["adbd_defaults"],
Josh Gao27768452018-01-02 12:01:43 -0800607 srcs: libadb_test_srcs + [
Josh Gao997cfac2018-07-25 18:15:52 -0700608 "daemon/services.cpp",
Josh Gao27768452018-01-02 12:01:43 -0800609 "daemon/shell_service.cpp",
610 "daemon/shell_service_test.cpp",
611 "shell_service_protocol.cpp",
612 "shell_service_protocol_test.cpp",
613 ],
614
615 static_libs: [
616 "libadbd",
617 "libbase",
Josh Gao997cfac2018-07-25 18:15:52 -0700618 "libbootloader_message",
Josh Gao27768452018-01-02 12:01:43 -0800619 "libcutils",
620 "libcrypto_utils",
621 "libcrypto",
622 "libdiagnose_usb",
623 "liblog",
624 "libusb",
625 "libmdnssd",
Jiyong Park011ee122018-05-29 16:41:30 +0900626 "libselinux",
Josh Gao27768452018-01-02 12:01:43 -0800627 ],
Elliott Hughes40fdf3f2018-04-27 16:12:06 -0700628 test_suites: ["device-tests"],
Josh Gao27768452018-01-02 12:01:43 -0800629}
630
Julien Desprez75fea7e2018-08-08 12:08:50 -0700631python_test_host {
Elliott Hughesdc699a22018-02-16 17:58:14 -0800632 name: "adb_integration_test_adb",
633 main: "test_adb.py",
634 srcs: [
635 "test_adb.py",
636 ],
Julien Desprez75fea7e2018-08-08 12:08:50 -0700637 test_config: "adb_integration_test_adb.xml",
638 test_suites: ["general-tests"],
Elliott Hughesdc699a22018-02-16 17:58:14 -0800639 version: {
640 py2: {
Josh Gao9b6522b2018-08-07 14:31:17 -0700641 enabled: false,
Elliott Hughesdc699a22018-02-16 17:58:14 -0800642 },
643 py3: {
Josh Gao9b6522b2018-08-07 14:31:17 -0700644 enabled: true,
Elliott Hughesdc699a22018-02-16 17:58:14 -0800645 },
GuangHui Liu41bda342017-05-10 14:37:17 -0700646 },
GuangHui Liu41bda342017-05-10 14:37:17 -0700647}
648
Julien Desprez618f0e12018-10-12 13:48:14 -0700649python_test_host {
Elliott Hughesdc699a22018-02-16 17:58:14 -0800650 name: "adb_integration_test_device",
651 main: "test_device.py",
652 srcs: [
653 "test_device.py",
654 ],
655 libs: [
656 "adb_py",
657 ],
Julien Desprez618f0e12018-10-12 13:48:14 -0700658 test_config: "adb_integration_test_device.xml",
659 test_suites: ["general-tests"],
Elliott Hughesdc699a22018-02-16 17:58:14 -0800660 version: {
661 py2: {
662 enabled: true,
663 },
664 py3: {
665 enabled: false,
666 },
GuangHui Liu41bda342017-05-10 14:37:17 -0700667 },
GuangHui Liu41bda342017-05-10 14:37:17 -0700668}
Joshua Gilpatrickaf3ce082019-07-19 09:42:12 -0700669
670// Note: using pipe for xxd to control the variable name generated
671// the default name used by xxd is the path to the input file.
672java_genrule {
673 name: "bin2c_fastdeployagent",
674 out: ["deployagent.inc"],
675 srcs: [":deployagent"],
676 cmd: "(echo 'unsigned char kDeployAgent[] = {' && xxd -i <$(in) && echo '};') > $(out)",
677}
678
679genrule {
680 name: "bin2c_fastdeployagentscript",
681 out: ["deployagentscript.inc"],
682 srcs: ["fastdeploy/deployagent/deployagent.sh"],
683 cmd: "(echo 'unsigned char kDeployAgentScript[] = {' && xxd -i <$(in) && echo '};') > $(out)",
684}
685
686cc_library_host_static {
687 name: "libfastdeploy_host",
688 defaults: ["adb_defaults"],
689 srcs: [
690 "fastdeploy/deploypatchgenerator/deploy_patch_generator.cpp",
691 "fastdeploy/deploypatchgenerator/patch_utils.cpp",
692 "fastdeploy/proto/ApkEntry.proto",
693 ],
694 static_libs: [
695 "libadb_host",
696 "libandroidfw",
697 "libbase",
698 "libcutils",
699 "libcrypto_utils",
700 "libcrypto",
701 "libdiagnose_usb",
702 "liblog",
703 "libmdnssd",
704 "libusb",
705 "libutils",
706 "libziparchive",
707 "libz",
708 ],
709 stl: "libc++_static",
710 proto: {
711 type: "lite",
712 export_proto_headers: true,
713 },
714 target: {
715 windows: {
716 enabled: true,
717 shared_libs: ["AdbWinApi"],
718 },
719 },
720}
721
722cc_test_host {
723 name: "fastdeploy_test",
724 defaults: ["adb_defaults"],
725 srcs: [
726 "fastdeploy/deploypatchgenerator/deploy_patch_generator_test.cpp",
727 "fastdeploy/deploypatchgenerator/patch_utils_test.cpp",
728 ],
729 static_libs: [
730 "libadb_host",
731 "libandroidfw",
732 "libbase",
733 "libcutils",
734 "libcrypto_utils",
735 "libcrypto",
736 "libdiagnose_usb",
737 "libfastdeploy_host",
738 "liblog",
739 "libmdnssd",
740 "libprotobuf-cpp-lite",
741 "libusb",
742 "libutils",
743 "libziparchive",
744 "libz",
745 ],
746 target: {
747 windows: {
748 enabled: true,
749 shared_libs: ["AdbWinApi"],
750 },
751 },
752 data: [
753 "fastdeploy/testdata/rotating_cube-release.apk",
754 ],
755}