blob: 0f811d9f43871e69bb0ef413264cdb9650d6a1c3 [file] [log] [blame]
GuangHui Liu35994392017-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
Bob Badour4a6774b2021-02-12 19:46:09 -080015package {
16 default_applicable_licenses: ["packages_modules_adb_license"],
17}
18
19// Added automatically by a large-scale-change
20// See: http://go/android-license-faq
21license {
22 name: "packages_modules_adb_license",
23 visibility: [":__subpackages__"],
24 license_kinds: [
25 "SPDX-license-identifier-Apache-2.0",
26 ],
27 license_text: [
28 "NOTICE",
29 ],
30}
31
Joshua Duongb5c3bec2020-07-17 14:14:00 -070032tidy_errors = [
33 "-*",
34 "bugprone-inaccurate-erase",
Joshua Duongf4ba8d72021-01-13 12:18:15 -080035 "bugprone-use-after-move",
Joshua Duongb5c3bec2020-07-17 14:14:00 -070036]
37
Josh Gao361148b2018-01-02 12:01:43 -080038cc_defaults {
39 name: "adb_defaults",
40
41 cflags: [
42 "-Wall",
43 "-Wextra",
44 "-Werror",
Jiyong Parkf2721bc2020-09-18 16:35:06 +090045 "-Wno-non-virtual-dtor",
Josh Gao361148b2018-01-02 12:01:43 -080046 "-Wno-unused-parameter",
47 "-Wno-missing-field-initializers",
Josh Gao0560feb2019-01-22 19:36:15 -080048 "-Wthread-safety",
Josh Gao361148b2018-01-02 12:01:43 -080049 "-Wvla",
Bowgo Tsai35b817b2019-03-12 04:25:33 +080050 "-DADB_HOST=1", // overridden by adbd_defaults
Josh Gao90228a62019-04-25 14:04:57 -070051 "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION=1",
Josh Gao361148b2018-01-02 12:01:43 -080052 ],
Josh Gao3edf8072018-11-16 15:40:16 -080053 cpp_std: "experimental",
Josh Gao361148b2018-01-02 12:01:43 -080054
Josh Gao66766f82018-02-27 15:49:23 -080055 use_version_lib: true,
Josh Gao361148b2018-01-02 12:01:43 -080056 compile_multilib: "first",
Josh Gao361148b2018-01-02 12:01:43 -080057
58 target: {
Josh Gao361148b2018-01-02 12:01:43 -080059 darwin: {
60 host_ldlibs: [
61 "-lpthread",
62 "-framework CoreFoundation",
63 "-framework IOKit",
Elliott Hughes038a7ac2022-08-12 15:26:44 +000064 "-framework Security",
Josh Gao361148b2018-01-02 12:01:43 -080065 "-lobjc",
66 ],
Joshua Duong28fd4e52021-03-19 12:12:35 -070067 cflags: [
68 // Required, to use the new IPv6 Sockets options introduced by RFC 3542.
69 "-D__APPLE_USE_RFC_3542",
70 ],
Josh Gao361148b2018-01-02 12:01:43 -080071 },
72
73 windows: {
74 cflags: [
75 // Define windows.h and tchar.h Unicode preprocessor symbols so that
76 // CreateFile(), _tfopen(), etc. map to versions that take wchar_t*, breaking the
77 // build if you accidentally pass char*. Fix by calling like:
78 // std::wstring path_wide;
79 // if (!android::base::UTF8ToWide(path_utf8, &path_wide)) { /* error handling */ }
80 // CreateFileW(path_wide.c_str());
81 "-DUNICODE=1",
82 "-D_UNICODE=1",
83
Elliott Hughesc229a722018-12-03 09:02:18 -080084 // Unlike on Linux, -std=gnu++ doesn't set _GNU_SOURCE on Windows.
Josh Gao361148b2018-01-02 12:01:43 -080085 "-D_GNU_SOURCE",
Josh Gao96049b92018-03-23 13:03:28 -070086
87 // MinGW hides some things behind _POSIX_SOURCE.
88 "-D_POSIX_SOURCE",
Josh Gao0560feb2019-01-22 19:36:15 -080089
Josh Gaoc3b64032019-04-17 16:57:43 -070090 // libusb uses __stdcall on a variadic function, which gets ignored.
91 "-Wno-ignored-attributes",
92
Josh Gao0560feb2019-01-22 19:36:15 -080093 // Not supported yet.
94 "-Wno-thread-safety",
Josh Gao361148b2018-01-02 12:01:43 -080095 ],
Josh Gaoea7b95a2018-03-23 15:37:20 -070096
97 host_ldlibs: [
98 "-lws2_32",
99 "-lgdi32",
100 "-luserenv",
Joshua Duongf4ba8d72021-01-13 12:18:15 -0800101 "-liphlpapi",
Josh Gaoea7b95a2018-03-23 15:37:20 -0700102 ],
Josh Gao361148b2018-01-02 12:01:43 -0800103 },
Josh Gao0560feb2019-01-22 19:36:15 -0800104 },
Joshua Duongb5c3bec2020-07-17 14:14:00 -0700105
106 tidy: true,
107 tidy_checks: tidy_errors,
108 tidy_checks_as_errors: tidy_errors,
Josh Gao0560feb2019-01-22 19:36:15 -0800109}
Pirama Arumuga Nainar7aa20232018-06-01 11:31:38 -0700110
Josh Gao0560feb2019-01-22 19:36:15 -0800111cc_defaults {
112 name: "adbd_defaults",
113 defaults: ["adb_defaults"],
114
115 cflags: ["-UADB_HOST", "-DADB_HOST=0"],
Josh Gao361148b2018-01-02 12:01:43 -0800116}
117
Josh Gao0560feb2019-01-22 19:36:15 -0800118cc_defaults {
119 name: "host_adbd_supported",
120
121 host_supported: true,
122 target: {
123 linux: {
124 enabled: true,
125 host_ldlibs: [
126 "-lresolv", // b64_pton
127 "-lutil", // forkpty
128 ],
129 },
130 darwin: {
131 enabled: false,
132 },
133 windows: {
134 enabled: false,
135 },
136 },
137}
138
Liz Kammer6836b052021-01-22 13:39:03 -0500139soong_config_module_type_import {
140 from: "system/apex/Android.bp",
141 module_types: ["library_linking_strategy_cc_defaults"],
142}
143
144library_linking_strategy_cc_defaults {
Josh Gaodc20c2f2020-03-27 19:41:59 -0700145 name: "libadbd_binary_dependencies",
146 static_libs: [
147 "libadb_crypto",
148 "libadb_pairing_connection",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000149 "libadb_protos",
Joshua Duong93b407c2020-07-30 16:34:29 -0700150 "libadb_sysdeps",
Josh Gaodc20c2f2020-03-27 19:41:59 -0700151 "libadb_tls_connection",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000152 "libadbconnection_server",
Josh Gaodc20c2f2020-03-27 19:41:59 -0700153 "libadbd",
154 "libadbd_core",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000155 "libapp_processes_protos_lite",
Josh Gaodc20c2f2020-03-27 19:41:59 -0700156 "libasyncio",
157 "libbrotli",
Josh Gao7e3f8112021-04-09 17:32:58 -0700158 "libcrypto_utils",
Josh Gaodc20c2f2020-03-27 19:41:59 -0700159 "libcutils_sockets",
160 "libdiagnose_usb",
161 "libmdnssd",
Josh Gaodc20c2f2020-03-27 19:41:59 -0700162 "libprotobuf-cpp-lite",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000163 "libzstd",
Josh Gaodc20c2f2020-03-27 19:41:59 -0700164 ],
165
166 shared_libs: [
167 "libadbd_auth",
168 "libadbd_fs",
Josh Gaodc20c2f2020-03-27 19:41:59 -0700169 "liblog",
170 "libselinux",
171 ],
172
Liz Kammer6836b052021-01-22 13:39:03 -0500173 soong_config_variables:{
174 library_linking_strategy: {
175 prefer_static: {
176 static_libs: [
177 "libbase",
178 ],
179 },
180 conditions_default: {
181 shared_libs: [
182 "libbase",
183 ],
184 },
185 },
186 },
187
Josh Gaodc20c2f2020-03-27 19:41:59 -0700188 target: {
Josh Gao7e3f8112021-04-09 17:32:58 -0700189 android: {
190 shared_libs: ["libcrypto"],
191 },
Colin Cross02290862022-03-24 15:47:28 -0700192 host_linux: {
Josh Gao7e3f8112021-04-09 17:32:58 -0700193 static_libs: ["libcrypto_static"],
194 },
Josh Gaodc20c2f2020-03-27 19:41:59 -0700195 recovery: {
196 exclude_static_libs: [
197 "libadb_pairing_auth",
198 "libadb_pairing_connection",
199 ],
200 },
201 },
202}
203
Josh Gao361148b2018-01-02 12:01:43 -0800204// libadb
205// =========================================================
206// These files are compiled for both the host and the device.
207libadb_srcs = [
208 "adb.cpp",
209 "adb_io.cpp",
210 "adb_listeners.cpp",
Joshua Duongf4ba8d72021-01-13 12:18:15 -0800211 "adb_mdns.cpp",
Josh Gao361148b2018-01-02 12:01:43 -0800212 "adb_trace.cpp",
Josh Gao7d5762c2018-05-24 22:54:50 -0700213 "adb_unique_fd.cpp",
Josh Gao361148b2018-01-02 12:01:43 -0800214 "adb_utils.cpp",
Josh Gaob51193a2019-06-28 13:50:37 -0700215 "fdevent/fdevent.cpp",
Josh Gao361148b2018-01-02 12:01:43 -0800216 "services.cpp",
217 "sockets.cpp",
218 "socket_spec.cpp",
Joshua Duong93b407c2020-07-30 16:34:29 -0700219 "sysdeps/env.cpp",
Josh Gao361148b2018-01-02 12:01:43 -0800220 "sysdeps/errno.cpp",
221 "transport.cpp",
Josh Gao1e41fda2018-04-05 16:16:04 -0700222 "transport_fd.cpp",
Yurii Zubrytskyie5e6b0d2019-07-12 14:11:54 -0700223 "types.cpp",
Josh Gao361148b2018-01-02 12:01:43 -0800224]
225
Josh Gaod7c49ec2020-04-20 19:22:05 -0700226libadb_darwin_srcs = [
227 "fdevent/fdevent_poll.cpp",
228]
229
230libadb_windows_srcs = [
231 "fdevent/fdevent_poll.cpp",
232 "sysdeps_win32.cpp",
233 "sysdeps/win32/errno.cpp",
234 "sysdeps/win32/stat.cpp",
235]
236
Josh Gao361148b2018-01-02 12:01:43 -0800237libadb_posix_srcs = [
238 "sysdeps_unix.cpp",
239 "sysdeps/posix/network.cpp",
240]
241
Josh Gaodd716422019-07-11 13:47:44 -0700242libadb_linux_srcs = [
243 "fdevent/fdevent_epoll.cpp",
244]
245
Josh Gao361148b2018-01-02 12:01:43 -0800246libadb_test_srcs = [
247 "adb_io_test.cpp",
248 "adb_listeners_test.cpp",
249 "adb_utils_test.cpp",
Josh Gaob51193a2019-06-28 13:50:37 -0700250 "fdevent/fdevent_test.cpp",
Shaju Mathew3f7b4402023-01-19 21:56:37 -0800251 "shell_service_protocol.cpp",
Josh Gao361148b2018-01-02 12:01:43 -0800252 "socket_spec_test.cpp",
253 "socket_test.cpp",
254 "sysdeps_test.cpp",
255 "sysdeps/stat_test.cpp",
256 "transport_test.cpp",
Josh Gao9f155db2018-04-03 14:37:11 -0700257 "types_test.cpp",
Josh Gao361148b2018-01-02 12:01:43 -0800258]
259
260cc_library_host_static {
261 name: "libadb_host",
262 defaults: ["adb_defaults"],
263
264 srcs: libadb_srcs + [
Joshua Duongf4ba8d72021-01-13 12:18:15 -0800265 "client/openscreen/mdns_service_info.cpp",
266 "client/openscreen/mdns_service_watcher.cpp",
267 "client/openscreen/platform/logging.cpp",
268 "client/openscreen/platform/task_runner.cpp",
269 "client/openscreen/platform/udp_socket.cpp",
Josh Gao361148b2018-01-02 12:01:43 -0800270 "client/auth.cpp",
Joshua Duong290ccb52019-11-20 14:18:43 -0800271 "client/adb_wifi.cpp",
Josh Gao361148b2018-01-02 12:01:43 -0800272 "client/usb_libusb.cpp",
Josh Gaoa5baef92020-04-22 17:30:06 -0700273 "client/transport_local.cpp",
Joshua Duongf4ba8d72021-01-13 12:18:15 -0800274 "client/mdnsresponder_client.cpp",
Joshua Duongf2a0d872020-04-30 15:45:38 -0700275 "client/mdns_utils.cpp",
Joshua Duongf4ba8d72021-01-13 12:18:15 -0800276 "client/transport_mdns.cpp",
Josh Gao6b55e752020-03-27 18:09:56 -0700277 "client/transport_usb.cpp",
Joshua Duong290ccb52019-11-20 14:18:43 -0800278 "client/pairing/pairing_client.cpp",
Josh Gao361148b2018-01-02 12:01:43 -0800279 ],
280
Dan Willemsen18861892018-08-29 14:58:02 -0700281 generated_headers: ["platform_tools_version"],
282
Josh Gao361148b2018-01-02 12:01:43 -0800283 target: {
284 linux: {
Josh Gaodd716422019-07-11 13:47:44 -0700285 srcs: ["client/usb_linux.cpp"] + libadb_linux_srcs,
Josh Gao361148b2018-01-02 12:01:43 -0800286 },
287 darwin: {
Josh Gaod7c49ec2020-04-20 19:22:05 -0700288 srcs: ["client/usb_osx.cpp"] + libadb_darwin_srcs,
Josh Gao361148b2018-01-02 12:01:43 -0800289 },
Josh Gao361148b2018-01-02 12:01:43 -0800290 not_windows: {
291 srcs: libadb_posix_srcs,
292 },
293 windows: {
294 enabled: true,
295 srcs: [
296 "client/usb_windows.cpp",
Josh Gaod7c49ec2020-04-20 19:22:05 -0700297 ] + libadb_windows_srcs,
Josh Gao361148b2018-01-02 12:01:43 -0800298 shared_libs: ["AdbWinApi"],
299 },
300 },
301
302 static_libs: [
Joshua Duong090c8072019-12-19 16:36:30 -0800303 "libadb_crypto",
Joshua Duong290ccb52019-11-20 14:18:43 -0800304 "libadb_pairing_connection",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000305 "libadb_protos",
Joshua Duong290ccb52019-11-20 14:18:43 -0800306 "libadb_tls_connection",
Josh Gao361148b2018-01-02 12:01:43 -0800307 "libbase",
Josh Gao361148b2018-01-02 12:01:43 -0800308 "libcrypto",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000309 "libcrypto_utils",
Idries Hamadi78330f02018-09-13 18:00:25 +0100310 "libcutils",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000311 "libdiagnose_usb",
Fabien Sanglard3d155b62023-11-30 14:52:40 -0800312 "libdevices_protos",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000313 "liblog",
314 "libmdnssd",
Joshua Duongf4ba8d72021-01-13 12:18:15 -0800315 "libopenscreen-discovery",
316 "libopenscreen-platform-impl",
Joshua Duong290ccb52019-11-20 14:18:43 -0800317 "libprotobuf-cpp-lite",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000318 "libusb",
319 "libutils",
Josh Gao361148b2018-01-02 12:01:43 -0800320 ],
321}
322
Joshua Duong93b407c2020-07-30 16:34:29 -0700323cc_library {
324 name: "libadb_sysdeps",
325 defaults: ["adb_defaults"],
326 recovery_available: true,
327 host_supported: true,
328 compile_multilib: "both",
329 min_sdk_version: "apex_inherit",
Jiyong Parkc55fa5c2020-08-25 17:05:41 +0900330 // This library doesn't use build::GetBuildNumber()
331 use_version_lib: false,
Joshua Duong93b407c2020-07-30 16:34:29 -0700332
333 srcs: [
334 "sysdeps/env.cpp",
335 ],
336
337 shared_libs: [
338 "libbase",
339 "liblog",
340 ],
341
342 target: {
343 windows: {
344 enabled: true,
345 ldflags: ["-municode"],
346 },
347 },
348
349 export_include_dirs: ["."],
350
351 visibility: [
Joshua Duong93b407c2020-07-30 16:34:29 -0700352 "//bootable/recovery/minadbd:__subpackages__",
Baligh Uddin95e03672020-10-18 15:09:52 +0000353 "//packages/modules/adb:__subpackages__",
Joshua Duong93b407c2020-07-30 16:34:29 -0700354 ],
355
356 apex_available: [
357 "com.android.adbd",
358 "test_com.android.adbd",
359 ],
360}
361
Josh Gao361148b2018-01-02 12:01:43 -0800362cc_test_host {
363 name: "adb_test",
364 defaults: ["adb_defaults"],
Joshua Duongf2a0d872020-04-30 15:45:38 -0700365 srcs: libadb_test_srcs + [
366 "client/mdns_utils_test.cpp",
Shaju Mathew3f7b4402023-01-19 21:56:37 -0800367 "test_utils/test_utils.cpp",
Joshua Duongf2a0d872020-04-30 15:45:38 -0700368 ],
369
Josh Gao361148b2018-01-02 12:01:43 -0800370 static_libs: [
Joshua Duong290ccb52019-11-20 14:18:43 -0800371 "libadb_crypto_static",
Josh Gao361148b2018-01-02 12:01:43 -0800372 "libadb_host",
Joshua Duong290ccb52019-11-20 14:18:43 -0800373 "libadb_pairing_auth_static",
374 "libadb_pairing_connection_static",
375 "libadb_protos_static",
Joshua Duong93b407c2020-07-30 16:34:29 -0700376 "libadb_sysdeps",
Joshua Duong290ccb52019-11-20 14:18:43 -0800377 "libadb_tls_connection_static",
Josh Gao361148b2018-01-02 12:01:43 -0800378 "libbase",
Josh Gao361148b2018-01-02 12:01:43 -0800379 "libcrypto",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000380 "libcrypto_utils",
381 "libcutils",
Fabien Sanglard3d155b62023-11-30 14:52:40 -0800382 "libdevices_protos",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000383 "libdiagnose_usb",
Tom Cherry49b96ec2020-01-08 13:41:56 -0800384 "liblog",
Josh Gao361148b2018-01-02 12:01:43 -0800385 "libmdnssd",
Joshua Duongf4ba8d72021-01-13 12:18:15 -0800386 "libopenscreen-discovery",
387 "libopenscreen-platform-impl",
Fabien Sanglard3d155b62023-11-30 14:52:40 -0800388 "libprotobuf-cpp-full",
Joshua Duong290ccb52019-11-20 14:18:43 -0800389 "libssl",
Josh Gao361148b2018-01-02 12:01:43 -0800390 "libusb",
391 ],
Josh Gaoea7b95a2018-03-23 15:37:20 -0700392
393 target: {
394 windows: {
395 enabled: true,
Josh Gao3e8bdab2019-07-16 15:08:42 -0700396 ldflags: ["-municode"],
Josh Gaoea7b95a2018-03-23 15:37:20 -0700397 shared_libs: ["AdbWinApi"],
398 },
399 },
zeek9afe4f82022-09-20 00:49:44 +0800400
401 test_options: {
402 // TODO(b/247985207) remove "no-remote" tag when b/247985207 is fixed.
403 tags: ["no-remote"],
404 }
Josh Gao361148b2018-01-02 12:01:43 -0800405}
406
407cc_binary_host {
408 name: "adb",
Josh Gao361148b2018-01-02 12:01:43 -0800409
Josh Gao06af61e2020-02-03 23:08:05 -0800410 stl: "libc++_static",
Josh Gao361148b2018-01-02 12:01:43 -0800411 defaults: ["adb_defaults"],
412
413 srcs: [
414 "client/adb_client.cpp",
415 "client/bugreport.cpp",
416 "client/commandline.cpp",
417 "client/file_sync_client.cpp",
418 "client/main.cpp",
419 "client/console.cpp",
Idries Hamadi1ecee442018-01-29 16:30:36 +0000420 "client/adb_install.cpp",
Josh Gao361148b2018-01-02 12:01:43 -0800421 "client/line_printer.cpp",
Joshua Gilpatrick0d384112019-07-19 09:42:12 -0700422 "client/fastdeploy.cpp",
423 "client/fastdeploycallbacks.cpp",
Alex Buynytskyy175ce292020-02-13 06:52:04 -0800424 "client/incremental.cpp",
425 "client/incremental_server.cpp",
Songchun Fan965301e2020-03-13 13:11:43 -0700426 "client/incremental_utils.cpp",
Josh Gao361148b2018-01-02 12:01:43 -0800427 "shell_service_protocol.cpp",
428 ],
429
Joshua Gilpatrick0d384112019-07-19 09:42:12 -0700430 generated_headers: [
431 "bin2c_fastdeployagent",
432 "bin2c_fastdeployagentscript"
433 ],
434
Josh Gao361148b2018-01-02 12:01:43 -0800435 static_libs: [
Joshua Duong090c8072019-12-19 16:36:30 -0800436 "libadb_crypto",
Josh Gao361148b2018-01-02 12:01:43 -0800437 "libadb_host",
Josh Gaod8bad8e2020-03-26 13:46:08 -0700438 "libadb_pairing_auth",
439 "libadb_pairing_connection",
Joshua Duong290ccb52019-11-20 14:18:43 -0800440 "libadb_protos",
Joshua Duong93b407c2020-07-30 16:34:29 -0700441 "libadb_sysdeps",
Joshua Duong290ccb52019-11-20 14:18:43 -0800442 "libadb_tls_connection",
Joshua Gilpatrick0d384112019-07-19 09:42:12 -0700443 "libandroidfw",
Shukang Zhou420ad552020-02-13 17:01:39 -0800444 "libapp_processes_protos_full",
Josh Gao361148b2018-01-02 12:01:43 -0800445 "libbase",
Josh Gao2f0f9eb2020-03-04 19:34:08 -0800446 "libbrotli",
Josh Gao361148b2018-01-02 12:01:43 -0800447 "libcrypto",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000448 "libcrypto_utils",
449 "libcutils",
Josh Gao361148b2018-01-02 12:01:43 -0800450 "libdiagnose_usb",
Fabien Sanglard3d155b62023-11-30 14:52:40 -0800451 "libdevices_protos",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000452 "libfastdeploy_host",
453 "liblog",
Josh Gao361148b2018-01-02 12:01:43 -0800454 "liblog",
Alex Buynytskyy175ce292020-02-13 06:52:04 -0800455 "liblz4",
Josh Gao361148b2018-01-02 12:01:43 -0800456 "libmdnssd",
Joshua Duongf4ba8d72021-01-13 12:18:15 -0800457 "libopenscreen-discovery",
458 "libopenscreen-platform-impl",
Shukang Zhou420ad552020-02-13 17:01:39 -0800459 "libprotobuf-cpp-full",
Joshua Duong290ccb52019-11-20 14:18:43 -0800460 "libssl",
Josh Gao361148b2018-01-02 12:01:43 -0800461 "libusb",
Idries Hamadi78330f02018-09-13 18:00:25 +0100462 "libutils",
Joshua Gilpatrick0d384112019-07-19 09:42:12 -0700463 "libz",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000464 "libziparchive",
Josh Gaobdebc9b2020-05-27 17:52:52 -0700465 "libzstd",
Josh Gao361148b2018-01-02 12:01:43 -0800466 ],
467
Josh Gao361148b2018-01-02 12:01:43 -0800468 // Don't add anything here, we don't want additional shared dependencies
469 // on the host adb tool, and shared libraries that link against libc++
470 // will violate ODR
471 shared_libs: [],
472
Dan Willemsen7024da42018-11-19 19:11:35 -0800473 // Archive adb, adb.exe.
474 dist: {
475 targets: [
476 "dist_files",
477 "sdk",
Shaju Mathew9510d642022-10-06 22:18:29 +0000478 "sdk-repo-platform-tools",
479 "sdk_repo",
Dan Willemsen7024da42018-11-19 19:11:35 -0800480 "win_sdk",
481 ],
482 },
483
Josh Gao361148b2018-01-02 12:01:43 -0800484 target: {
485 darwin: {
486 cflags: [
487 "-Wno-sizeof-pointer-memaccess",
488 ],
489 },
490 windows: {
491 enabled: true,
492 ldflags: ["-municode"],
Josh Gao361148b2018-01-02 12:01:43 -0800493 shared_libs: ["AdbWinApi"],
494 required: [
495 "AdbWinUsbApi",
496 ],
497 },
498 },
499}
500
Tao Bao49042e32018-07-30 20:45:27 -0700501// libadbd_core contains the common sources to build libadbd and libadbd_services.
Josh Gao361148b2018-01-02 12:01:43 -0800502cc_library_static {
Tao Bao49042e32018-07-30 20:45:27 -0700503 name: "libadbd_core",
Josh Gao0560feb2019-01-22 19:36:15 -0800504 defaults: ["adbd_defaults", "host_adbd_supported"],
Tao Bao49042e32018-07-30 20:45:27 -0700505 recovery_available: true,
506
507 // libminadbd wants both, as it's used to build native tests.
508 compile_multilib: "both",
509
Josh Gaodd716422019-07-11 13:47:44 -0700510 srcs: libadb_srcs + libadb_linux_srcs + libadb_posix_srcs + [
Josh Gaoa5baef92020-04-22 17:30:06 -0700511 "daemon/adb_wifi.cpp",
Tao Bao49042e32018-07-30 20:45:27 -0700512 "daemon/auth.cpp",
513 "daemon/jdwp_service.cpp",
Josh Gaobd775212020-02-26 16:39:20 -0800514 "daemon/logging.cpp",
Josh Gaoa5baef92020-04-22 17:30:06 -0700515 "daemon/transport_local.cpp",
Tao Bao49042e32018-07-30 20:45:27 -0700516 ],
517
Dan Willemsen18861892018-08-29 14:58:02 -0700518 generated_headers: ["platform_tools_version"],
519
Tao Bao49042e32018-07-30 20:45:27 -0700520 static_libs: [
521 "libdiagnose_usb",
Tao Bao49042e32018-07-30 20:45:27 -0700522 ],
523
524 shared_libs: [
Joshua Duong090c8072019-12-19 16:36:30 -0800525 "libadb_crypto",
Joshua Duong290ccb52019-11-20 14:18:43 -0800526 "libadb_pairing_connection",
527 "libadb_protos",
528 "libadb_tls_connection",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000529 "libadbconnection_server",
Josh Gao7cac88a2019-10-22 12:30:39 -0700530 "libadbd_auth",
Josh Gaofa3605a2020-03-16 11:30:09 -0700531 "libapp_processes_protos_lite",
Tao Bao49042e32018-07-30 20:45:27 -0700532 "libasyncio",
533 "libbase",
534 "libcrypto",
535 "libcrypto_utils",
Josh Gaodc20c2f2020-03-27 19:41:59 -0700536 "libcutils_sockets",
Tao Bao49042e32018-07-30 20:45:27 -0700537 "liblog",
538 ],
Josh Gao0560feb2019-01-22 19:36:15 -0800539
Shukang Zhou420ad552020-02-13 17:01:39 -0800540 proto: {
541 type: "lite",
542 static: true,
543 export_proto_headers: true,
544 },
545
Josh Gao0560feb2019-01-22 19:36:15 -0800546 target: {
547 android: {
Josh Gao0560feb2019-01-22 19:36:15 -0800548 srcs: [
Josh Gao822f6742021-02-03 22:12:41 -0800549 "daemon/property_monitor.cpp",
Josh Gao0560feb2019-01-22 19:36:15 -0800550 "daemon/usb.cpp",
551 "daemon/usb_ffs.cpp",
Josh Gao2dc61962021-02-03 22:11:45 -0800552 "daemon/watchdog.cpp",
Josh Gao0560feb2019-01-22 19:36:15 -0800553 ]
Joshua Duong929364a2020-02-26 15:43:44 -0800554 },
555 recovery: {
556 exclude_shared_libs: [
557 "libadb_pairing_auth",
558 "libadb_pairing_connection",
Josh Gaofa3605a2020-03-16 11:30:09 -0700559 "libapp_processes_protos_lite",
Joshua Duong929364a2020-02-26 15:43:44 -0800560 ],
Josh Gao0560feb2019-01-22 19:36:15 -0800561 }
562 },
Josh Gao5fcd7ae2020-03-16 12:48:18 -0700563
Jooyung Han9864dad2021-11-22 10:15:19 +0900564 min_sdk_version: "30",
Josh Gao5fcd7ae2020-03-16 12:48:18 -0700565 apex_available: [
566 "//apex_available:platform",
567 "com.android.adbd",
568 ],
569 visibility: [
570 "//bootable/recovery/minadbd",
Baligh Uddin95e03672020-10-18 15:09:52 +0000571 "//packages/modules/adb:__subpackages__",
Josh Gao5fcd7ae2020-03-16 12:48:18 -0700572 ],
Tao Bao49042e32018-07-30 20:45:27 -0700573}
574
Josh Gao2029a372020-03-09 15:20:55 -0700575cc_library {
Tao Bao49042e32018-07-30 20:45:27 -0700576 name: "libadbd_services",
Josh Gao0560feb2019-01-22 19:36:15 -0800577 defaults: ["adbd_defaults", "host_adbd_supported"],
Tao Bao49042e32018-07-30 20:45:27 -0700578 recovery_available: true,
579 compile_multilib: "both",
580
Liz Kammer58c71732023-10-13 17:15:06 -0400581 // avoid getting duplicate symbol of android::build::getbuildnumber().
582 use_version_lib: false,
583
Tao Bao49042e32018-07-30 20:45:27 -0700584 srcs: [
585 "daemon/file_sync_service.cpp",
Tao Bao49042e32018-07-30 20:45:27 -0700586 "daemon/services.cpp",
Tao Bao49042e32018-07-30 20:45:27 -0700587 "daemon/shell_service.cpp",
588 "shell_service_protocol.cpp",
589 ],
590
591 cflags: [
592 "-D_GNU_SOURCE",
593 "-Wno-deprecated-declarations",
594 ],
595
596 static_libs: [
Josh Gaobf5a9362020-01-22 17:58:03 -0800597 "libadbconnection_server",
Tao Bao49042e32018-07-30 20:45:27 -0700598 "libadbd_core",
Josh Gao2f0f9eb2020-03-04 19:34:08 -0800599 "libbrotli",
Tao Bao49042e32018-07-30 20:45:27 -0700600 "libdiagnose_usb",
Josh Gaofb386cc2020-03-26 22:02:03 -0700601 "liblz4",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000602 "libprotobuf-cpp-lite",
Josh Gaobdebc9b2020-05-27 17:52:52 -0700603 "libzstd",
Tao Bao49042e32018-07-30 20:45:27 -0700604 ],
605
606 shared_libs: [
Joshua Duong290ccb52019-11-20 14:18:43 -0800607 "libadb_crypto",
608 "libadb_pairing_connection",
609 "libadb_protos",
610 "libadb_tls_connection",
Josh Gaofa3605a2020-03-16 11:30:09 -0700611 "libapp_processes_protos_lite",
Tao Bao49042e32018-07-30 20:45:27 -0700612 "libasyncio",
613 "libbase",
Tao Bao49042e32018-07-30 20:45:27 -0700614 "libcrypto_utils",
Josh Gao2029a372020-03-09 15:20:55 -0700615 "libcutils_sockets",
Josh Gaodc20c2f2020-03-27 19:41:59 -0700616
617 // APEX dependencies.
618 "libadbd_auth",
619 "libadbd_fs",
620 "libcrypto",
621 "liblog",
Tao Bao49042e32018-07-30 20:45:27 -0700622 ],
Alex Buynytskyyef34f012018-12-12 10:48:50 -0800623
624 target: {
Josh Gao0560feb2019-01-22 19:36:15 -0800625 android: {
626 srcs: [
627 "daemon/abb_service.cpp",
628 "daemon/framebuffer_service.cpp",
629 "daemon/mdns.cpp",
Josh Gao0560feb2019-01-22 19:36:15 -0800630 "daemon/restart_service.cpp",
Josh Gao0560feb2019-01-22 19:36:15 -0800631 ],
632 shared_libs: [
LuK13379c67d4b2020-09-16 19:35:05 +0200633 "libbinder_ndk",
Josh Gao0560feb2019-01-22 19:36:15 -0800634 "libmdnssd",
Josh Gao0560feb2019-01-22 19:36:15 -0800635 "libselinux",
636 ],
LuK13379c67d4b2020-09-16 19:35:05 +0200637 static_libs: [
638 "adbroot_aidl_interface-ndk",
639 ],
Josh Gao0560feb2019-01-22 19:36:15 -0800640 },
Alex Buynytskyyef34f012018-12-12 10:48:50 -0800641 recovery: {
642 exclude_srcs: [
643 "daemon/abb_service.cpp",
644 ],
Joshua Duong929364a2020-02-26 15:43:44 -0800645 exclude_shared_libs: [
LuK13379c67d4b2020-09-16 19:35:05 +0200646 "libbinder_ndk",
Joshua Duong929364a2020-02-26 15:43:44 -0800647 "libadb_pairing_auth",
648 "libadb_pairing_connection",
649 ],
LuK13379c67d4b2020-09-16 19:35:05 +0200650 exclude_static_libs: [
651 "adbroot_aidl_interface-ndk",
652 ],
Alex Buynytskyyef34f012018-12-12 10:48:50 -0800653 },
654 },
Josh Gao5fcd7ae2020-03-16 12:48:18 -0700655
Jooyung Han9864dad2021-11-22 10:15:19 +0900656 min_sdk_version: "30",
Josh Gao5fcd7ae2020-03-16 12:48:18 -0700657 apex_available: [
658 "//apex_available:platform",
659 "com.android.adbd",
660 ],
661 visibility: [
Baligh Uddin95e03672020-10-18 15:09:52 +0000662 "//packages/modules/adb",
Josh Gao5fcd7ae2020-03-16 12:48:18 -0700663 ],
664
Tao Bao49042e32018-07-30 20:45:27 -0700665}
666
667cc_library {
Josh Gao361148b2018-01-02 12:01:43 -0800668 name: "libadbd",
Josh Gao0560feb2019-01-22 19:36:15 -0800669 defaults: ["adbd_defaults", "host_adbd_supported"],
Jiyong Parkeb590392018-05-24 14:11:00 +0900670 recovery_available: true,
Jooyung Han9864dad2021-11-22 10:15:19 +0900671 min_sdk_version: "30",
Jiyong Parkc6afe4a2020-03-23 14:40:50 +0000672 apex_available: ["com.android.adbd"],
Josh Gao361148b2018-01-02 12:01:43 -0800673
Josh Gaobf5a9362020-01-22 17:58:03 -0800674 // avoid getting duplicate symbol of android::build::getbuildnumber().
Tao Bao49042e32018-07-30 20:45:27 -0700675 use_version_lib: false,
676
677 // libminadbd wants both, as it's used to build native tests.
Josh Gao361148b2018-01-02 12:01:43 -0800678 compile_multilib: "both",
Tao Bao49042e32018-07-30 20:45:27 -0700679
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000680 static_libs: [
681 "libadbd_core",
682 "libadbd_services",
683 "libbrotli",
684 "libcutils_sockets",
685 "libdiagnose_usb",
686 "liblz4",
687 "libmdnssd",
688 "libprotobuf-cpp-lite",
689 "libzstd",
690 ],
691
Tao Bao49042e32018-07-30 20:45:27 -0700692 shared_libs: [
Josh Gaofa3605a2020-03-16 11:30:09 -0700693 "libadbconnection_server",
694 "libapp_processes_protos_lite",
Joshua Duong290ccb52019-11-20 14:18:43 -0800695 "libadb_crypto",
696 "libadb_pairing_connection",
697 "libadb_tls_connection",
Josh Gao361148b2018-01-02 12:01:43 -0800698 "libasyncio",
Josh Gao361148b2018-01-02 12:01:43 -0800699 "libbase",
Tao Bao49042e32018-07-30 20:45:27 -0700700 "libcrypto",
701 "libcrypto_utils",
Tao Bao49042e32018-07-30 20:45:27 -0700702 "liblog",
Josh Gaoa4dfc142020-02-19 13:50:57 -0800703 "libselinux",
Josh Gaodc20c2f2020-03-27 19:41:59 -0700704
705 // APEX dependencies on the system image.
706 "libadbd_auth",
707 "libadbd_fs",
Josh Gaoa4dfc142020-02-19 13:50:57 -0800708 ],
709
Joshua Duong929364a2020-02-26 15:43:44 -0800710 target: {
711 recovery: {
712 exclude_shared_libs: [
713 "libadb_pairing_auth",
714 "libadb_pairing_connection",
715 ],
716 }
717 },
718
Jerry Zhangd4fe8b62018-05-07 15:14:47 -0700719
Josh Gao6b55e752020-03-27 18:09:56 -0700720 visibility: [
721 "//bootable/recovery/minadbd",
Baligh Uddin95e03672020-10-18 15:09:52 +0000722 "//packages/modules/adb",
Jerry Zhangd4fe8b62018-05-07 15:14:47 -0700723 ],
Josh Gao361148b2018-01-02 12:01:43 -0800724}
725
726cc_binary {
727 name: "adbd",
Josh Gaodc20c2f2020-03-27 19:41:59 -0700728 defaults: ["adbd_defaults", "host_adbd_supported", "libadbd_binary_dependencies"],
Jiyong Parkeb590392018-05-24 14:11:00 +0900729 recovery_available: true,
Jooyung Han9864dad2021-11-22 10:15:19 +0900730 min_sdk_version: "30",
Jiyong Parkc6afe4a2020-03-23 14:40:50 +0000731 apex_available: ["com.android.adbd"],
Josh Gao3e0540a2018-03-06 12:57:27 -0800732
Josh Gao361148b2018-01-02 12:01:43 -0800733 srcs: [
734 "daemon/main.cpp",
Josh Gao361148b2018-01-02 12:01:43 -0800735 ],
736
737 cflags: [
738 "-D_GNU_SOURCE",
739 "-Wno-deprecated-declarations",
740 ],
741
742 strip: {
743 keep_symbols: true,
744 },
745
Josh Gao2bfc85e2019-08-15 14:05:12 -0700746 static_libs: [
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000747 "libadb_protos",
Josh Gao361148b2018-01-02 12:01:43 -0800748 "libadbd",
Tao Bao49042e32018-07-30 20:45:27 -0700749 "libadbd_services",
Josh Gao2bfc85e2019-08-15 14:05:12 -0700750 "libasyncio",
Tao Bao49042e32018-07-30 20:45:27 -0700751 "libcap",
Josh Gaofb386cc2020-03-26 22:02:03 -0700752 "liblz4",
Josh Gao361148b2018-01-02 12:01:43 -0800753 "libminijail",
Joshua Duong290ccb52019-11-20 14:18:43 -0800754 "libssl",
Josh Gao361148b2018-01-02 12:01:43 -0800755 ],
Josh Gao2bfc85e2019-08-15 14:05:12 -0700756
757 shared_libs: [
Josh Gao090712a2020-01-16 12:40:43 -0800758 "libadbd_auth",
Josh Gao2bfc85e2019-08-15 14:05:12 -0700759 ],
Josh Gao06af61e2020-02-03 23:08:05 -0800760
Joshua Duong929364a2020-02-26 15:43:44 -0800761 target: {
LuK13379c67d4b2020-09-16 19:35:05 +0200762 android: {
763 shared_libs: [
764 "libbinder_ndk",
765 ],
766
767 static_libs: [
768 "adbroot_aidl_interface-ndk",
769 ],
770 },
771
Joshua Duong929364a2020-02-26 15:43:44 -0800772 recovery: {
773 exclude_shared_libs: [
774 "libadb_pairing_auth",
775 "libadb_pairing_connection",
LuK13379c67d4b2020-09-16 19:35:05 +0200776 "libbinder_ndk",
777 ],
778
779 exclude_static_libs: [
780 "adbroot_aidl_interface-ndk",
Joshua Duong929364a2020-02-26 15:43:44 -0800781 ],
782 }
783 },
Josh Gao361148b2018-01-02 12:01:43 -0800784}
785
Josh Gao06e45932019-10-23 13:27:17 -0700786phony {
Josh Gaodf43f5e2020-06-01 18:59:21 -0700787 // Interface between adbd in a module and the system.
788 name: "adbd_system_api",
Josh Gao06e45932019-10-23 13:27:17 -0700789 required: [
Josh Gaodf43f5e2020-06-01 18:59:21 -0700790 "libadbd_auth",
791 "libadbd_fs",
Josh Gao06e45932019-10-23 13:27:17 -0700792 "abb",
Josh Gao83ce3e22019-10-22 12:30:36 -0700793 "reboot",
Yi-Yo Chiangc24ad0d2022-08-05 12:07:34 +0800794 ],
795 product_variables: {
796 debuggable: {
797 required: [
798 "remount",
Yi-Yo Chiangc24ad0d2022-08-05 12:07:34 +0800799 ],
800 },
801 },
Josh Gao06e45932019-10-23 13:27:17 -0700802}
803
804phony {
Josh Gaodf43f5e2020-06-01 18:59:21 -0700805 name: "adbd_system_api_recovery",
Josh Gao06e45932019-10-23 13:27:17 -0700806 required: [
Inseob Kimfc0410d2021-06-30 15:07:24 +0900807 "libadbd_auth.recovery",
808 "libadbd_fs.recovery",
Josh Gao83ce3e22019-10-22 12:30:36 -0700809 "reboot.recovery",
Josh Gao06e45932019-10-23 13:27:17 -0700810 ],
811}
812
Alex Buynytskyyef34f012018-12-12 10:48:50 -0800813cc_binary {
LuK13379c67d4b2020-09-16 19:35:05 +0200814 name: "adb_root",
815 srcs: [
816 "root/adbroot_service.cpp",
817 "root/main.cpp",
818 ],
819 init_rc: [
820 "root/adb_root.rc",
821 ],
822 shared_libs: [
823 "libbase",
824 "libbinder_ndk",
825 "liblog",
826 "libutils",
827 ],
828 static_libs: [
829 "adbroot_aidl_interface-ndk",
830 ],
831 system_ext_specific: true,
832}
833
834cc_binary {
Alex Buynytskyyef34f012018-12-12 10:48:50 -0800835 name: "abb",
836
Josh Gao0560feb2019-01-22 19:36:15 -0800837 defaults: ["adbd_defaults"],
Josh Gao06af61e2020-02-03 23:08:05 -0800838 stl: "libc++",
Alex Buynytskyyef34f012018-12-12 10:48:50 -0800839 recovery_available: false,
840
841 srcs: [
842 "daemon/abb.cpp",
843 ],
844
845 cflags: [
846 "-D_GNU_SOURCE",
847 "-Wno-deprecated-declarations",
848 ],
849
850 strip: {
851 keep_symbols: true,
852 },
853
854 static_libs: [
855 "libadbd_core",
856 "libadbd_services",
857 "libcmd",
858 ],
859
860 shared_libs: [
861 "libbase",
862 "libbinder",
863 "liblog",
864 "libutils",
865 "libselinux",
866 ],
867}
868
Jingwen Chene29935e2022-12-10 03:50:12 +0000869ADBD_TEST_LIBS = [
870 "libadbd",
871 "libadbd_auth",
872 "libbase",
Jingwen Chene29935e2022-12-10 03:50:12 +0000873 "libusb",
874]
875
Josh Gao361148b2018-01-02 12:01:43 -0800876cc_test {
877 name: "adbd_test",
Josh Gao06af61e2020-02-03 23:08:05 -0800878
Josh Gaodc20c2f2020-03-27 19:41:59 -0700879 defaults: ["adbd_defaults", "libadbd_binary_dependencies"],
Josh Gao06af61e2020-02-03 23:08:05 -0800880
881 recovery_available: false,
Josh Gao361148b2018-01-02 12:01:43 -0800882 srcs: libadb_test_srcs + [
Shaju Mathewccdd7ff2023-02-01 03:00:40 -0800883 "daemon/restart_service.cpp",
884 "daemon/restart_service_test.cpp",
Josh Gao5607e922018-07-25 18:15:52 -0700885 "daemon/services.cpp",
Josh Gao361148b2018-01-02 12:01:43 -0800886 "daemon/shell_service.cpp",
887 "daemon/shell_service_test.cpp",
Shaju Mathew3f7b4402023-01-19 21:56:37 -0800888 "test_utils/test_utils.cpp",
Josh Gao361148b2018-01-02 12:01:43 -0800889 "shell_service_protocol_test.cpp",
Joshua Duong77b8ff32020-04-16 15:58:19 -0700890 "mdns_test.cpp",
Josh Gao361148b2018-01-02 12:01:43 -0800891 ],
892
Fabien Sanglardfcd64992022-09-02 17:43:55 -0700893 test_config: "adbd_test.xml",
Chen Zhu72ccee32020-05-08 16:45:11 -0700894
Josh Gao822f6742021-02-03 22:12:41 -0800895 target: {
896 android: {
897 srcs: [
898 "daemon/property_monitor_test.cpp",
899 ],
900 },
901 },
902
Josh Gaodc20c2f2020-03-27 19:41:59 -0700903 shared_libs: [
904 "liblog",
905 ],
906
Jingwen Chene29935e2022-12-10 03:50:12 +0000907 static_libs: ADBD_TEST_LIBS,
908
909 // Shared lib versions of static libs can potentially come from
910 // libadbd_binary_dependencies (e.g. libbase as a shared_lib, depending on
911 // library_linking_strategy), which will cause both shared/static versions of
912 // the same library to be in the link action.
913 //
914 // adbd_test uses the static version of these libraries above, so exclude them here.
915 exclude_shared_libs: ADBD_TEST_LIBS,
916
easoncylee83d1c9d2021-04-15 16:28:54 +0800917 test_suites: ["general-tests", "mts-adbd"],
Dan Shi22e091b2019-09-24 09:04:05 -0700918 require_root: true,
Josh Gao361148b2018-01-02 12:01:43 -0800919}
920
Julien Desprezae94f512018-08-08 12:08:50 -0700921python_test_host {
Elliott Hughes307e7672018-02-16 17:58:14 -0800922 name: "adb_integration_test_adb",
923 main: "test_adb.py",
924 srcs: [
925 "test_adb.py",
926 ],
Julien Desprezae94f512018-08-08 12:08:50 -0700927 test_config: "adb_integration_test_adb.xml",
928 test_suites: ["general-tests"],
Julien Desprezb099b532021-03-25 19:26:23 +0000929 test_options: {
930 unit_test: false,
931 },
GuangHui Liu35994392017-05-10 14:37:17 -0700932}
933
Julien Desprezcd11d0d2018-10-12 13:48:14 -0700934python_test_host {
Elliott Hughes307e7672018-02-16 17:58:14 -0800935 name: "adb_integration_test_device",
936 main: "test_device.py",
937 srcs: [
Fabien Sanglard3d155b62023-11-30 14:52:40 -0800938 "proto/devices.proto",
Elliott Hughes307e7672018-02-16 17:58:14 -0800939 "test_device.py",
940 ],
Fabien Sanglard3d155b62023-11-30 14:52:40 -0800941 proto: {
942 canonical_path_from_root: false,
943 },
Elliott Hughes307e7672018-02-16 17:58:14 -0800944 libs: [
945 "adb_py",
Fabien Sanglard3d155b62023-11-30 14:52:40 -0800946 "libprotobuf-python",
Elliott Hughes307e7672018-02-16 17:58:14 -0800947 ],
Julien Desprezcd11d0d2018-10-12 13:48:14 -0700948 test_config: "adb_integration_test_device.xml",
949 test_suites: ["general-tests"],
Julien Desprezb099b532021-03-25 19:26:23 +0000950 test_options: {
951 unit_test: false,
952 },
GuangHui Liu35994392017-05-10 14:37:17 -0700953}
Joshua Gilpatrick0d384112019-07-19 09:42:12 -0700954
955// Note: using pipe for xxd to control the variable name generated
956// the default name used by xxd is the path to the input file.
957java_genrule {
958 name: "bin2c_fastdeployagent",
959 out: ["deployagent.inc"],
960 srcs: [":deployagent"],
961 cmd: "(echo 'unsigned char kDeployAgent[] = {' && xxd -i <$(in) && echo '};') > $(out)",
962}
963
964genrule {
965 name: "bin2c_fastdeployagentscript",
966 out: ["deployagentscript.inc"],
967 srcs: ["fastdeploy/deployagent/deployagent.sh"],
968 cmd: "(echo 'unsigned char kDeployAgentScript[] = {' && xxd -i <$(in) && echo '};') > $(out)",
969}
970
971cc_library_host_static {
972 name: "libfastdeploy_host",
973 defaults: ["adb_defaults"],
974 srcs: [
Alex Buynytskyy1af550e2019-09-16 12:10:54 -0700975 "fastdeploy/deploypatchgenerator/apk_archive.cpp",
Joshua Gilpatrick0d384112019-07-19 09:42:12 -0700976 "fastdeploy/deploypatchgenerator/deploy_patch_generator.cpp",
977 "fastdeploy/deploypatchgenerator/patch_utils.cpp",
978 "fastdeploy/proto/ApkEntry.proto",
979 ],
980 static_libs: [
981 "libadb_host",
982 "libandroidfw",
983 "libbase",
Joshua Gilpatrick0d384112019-07-19 09:42:12 -0700984 "libcrypto",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000985 "libcrypto_utils",
986 "libcutils",
Joshua Gilpatrick0d384112019-07-19 09:42:12 -0700987 "libdiagnose_usb",
988 "liblog",
989 "libmdnssd",
990 "libusb",
991 "libutils",
Joshua Gilpatrick0d384112019-07-19 09:42:12 -0700992 "libz",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +0000993 "libziparchive",
Joshua Gilpatrick0d384112019-07-19 09:42:12 -0700994 ],
Joshua Gilpatrick0d384112019-07-19 09:42:12 -0700995 proto: {
996 type: "lite",
997 export_proto_headers: true,
998 },
999 target: {
1000 windows: {
1001 enabled: true,
1002 shared_libs: ["AdbWinApi"],
1003 },
1004 },
1005}
1006
1007cc_test_host {
1008 name: "fastdeploy_test",
1009 defaults: ["adb_defaults"],
1010 srcs: [
Alex Buynytskyy1af550e2019-09-16 12:10:54 -07001011 "fastdeploy/deploypatchgenerator/apk_archive_test.cpp",
Joshua Gilpatrick0d384112019-07-19 09:42:12 -07001012 "fastdeploy/deploypatchgenerator/deploy_patch_generator_test.cpp",
1013 "fastdeploy/deploypatchgenerator/patch_utils_test.cpp",
1014 ],
1015 static_libs: [
Joshua Duong290ccb52019-11-20 14:18:43 -08001016 "libadb_crypto_static",
Joshua Gilpatrick0d384112019-07-19 09:42:12 -07001017 "libadb_host",
Joshua Duong290ccb52019-11-20 14:18:43 -08001018 "libadb_pairing_auth_static",
1019 "libadb_pairing_connection_static",
1020 "libadb_protos_static",
Joshua Duong93b407c2020-07-30 16:34:29 -07001021 "libadb_sysdeps",
Joshua Duong290ccb52019-11-20 14:18:43 -08001022 "libadb_tls_connection_static",
Joshua Gilpatrick0d384112019-07-19 09:42:12 -07001023 "libandroidfw",
1024 "libbase",
Joshua Gilpatrick0d384112019-07-19 09:42:12 -07001025 "libcrypto",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +00001026 "libcrypto_utils",
1027 "libcutils",
Fabien Sanglard3d155b62023-11-30 14:52:40 -08001028 "libdevices_protos",
Joshua Gilpatrick0d384112019-07-19 09:42:12 -07001029 "libdiagnose_usb",
1030 "libfastdeploy_host",
1031 "liblog",
1032 "libmdnssd",
Joshua Duongf4ba8d72021-01-13 12:18:15 -08001033 "libopenscreen-discovery",
1034 "libopenscreen-platform-impl",
Fabien Sanglard3d155b62023-11-30 14:52:40 -08001035 "libprotobuf-cpp-full",
Joshua Duong290ccb52019-11-20 14:18:43 -08001036 "libssl",
Joshua Gilpatrick0d384112019-07-19 09:42:12 -07001037 "libusb",
1038 "libutils",
Joshua Gilpatrick0d384112019-07-19 09:42:12 -07001039 "libz",
Oriol Prieto Gasco532e5702021-08-20 14:36:42 +00001040 "libziparchive",
Joshua Gilpatrick0d384112019-07-19 09:42:12 -07001041 ],
1042 target: {
1043 windows: {
1044 enabled: true,
1045 shared_libs: ["AdbWinApi"],
1046 },
1047 },
1048 data: [
Alex Buynytskyy1af550e2019-09-16 12:10:54 -07001049 "fastdeploy/testdata/rotating_cube-metadata-release.data",
Joshua Gilpatrick0d384112019-07-19 09:42:12 -07001050 "fastdeploy/testdata/rotating_cube-release.apk",
Alex Buynytskyy1af550e2019-09-16 12:10:54 -07001051 "fastdeploy/testdata/sample.apk",
1052 "fastdeploy/testdata/sample.cd",
Joshua Gilpatrick0d384112019-07-19 09:42:12 -07001053 ],
1054}
LuK13379c67d4b2020-09-16 19:35:05 +02001055
1056aidl_interface {
1057 name: "adbroot_aidl_interface",
1058 unstable: true,
1059 local_include_dir: "aidl",
1060 srcs: [
1061 "aidl/android/adbroot/IADBRootService.aidl",
1062 ],
1063 backend: {
1064 cpp: {
1065 enabled: false,
1066 },
1067 java: {
1068 enabled: false,
1069 },
1070 ndk: {
1071 apex_available: [
1072 "//apex_available:platform",
1073 "com.android.adbd",
1074 ],
1075 min_sdk_version: "30",
1076 },
1077 },
1078}
1079
1080filegroup {
1081 name: "adbrootservice_aidl",
1082 srcs: [
1083 "aidl/android/adbroot/IADBRootService.aidl",
1084 ],
1085}