Skip to content

Commit bc8b14a

Browse files
committed
Build modem_simulator
- Build modem simulator and install artifacts in debian package. - b/401510338
1 parent 0bc871b commit bc8b14a

File tree

2 files changed

+128
-0
lines changed

2 files changed

+128
-0
lines changed
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
load("//:build_variables.bzl", "COPTS")
2+
load("//tools/lint:linters.bzl", "clang_tidy_test")
3+
4+
package(
5+
default_visibility = ["//:android_cuttlefish"],
6+
)
7+
8+
cc_library(
9+
name = "modem_simulator_lib",
10+
srcs = [
11+
"call_service.cpp",
12+
"cf_device_config.cpp",
13+
"channel_monitor.cpp",
14+
"command_parser.cpp",
15+
"data_service.cpp",
16+
"misc_service.cpp",
17+
"modem_service.cpp",
18+
"modem_simulator.cpp",
19+
"network_service.cpp",
20+
"nvram_config.cpp",
21+
"pdu_parser.cpp",
22+
"sim_service.cpp",
23+
"sms_service.cpp",
24+
"stk_service.cpp",
25+
"sup_service.cpp",
26+
"thread_looper.cpp",
27+
],
28+
hdrs = [
29+
"call_service.h",
30+
"channel_monitor.h",
31+
"command_parser.h",
32+
"data_service.h",
33+
"device_config.h",
34+
"misc_service.h",
35+
"modem_service.h",
36+
"modem_simulator.h",
37+
"network_service.h",
38+
"network_service_constants.h",
39+
"nvram_config.h",
40+
"pdu_parser.h",
41+
"sim_service.h",
42+
"sms_service.h",
43+
"stk_service.h",
44+
"sup_service.h",
45+
"thread_looper.h",
46+
],
47+
copts = [
48+
"-Wall",
49+
"-Werror",
50+
"-fexceptions",
51+
],
52+
strip_include_prefix = "//cuttlefish",
53+
deps = [
54+
"//cuttlefish/common/libs/fs",
55+
"//cuttlefish/common/libs/utils",
56+
"//cuttlefish/host/libs/config",
57+
"//libbase",
58+
"@jsoncpp",
59+
"@tinyxml2",
60+
],
61+
)
62+
63+
cc_binary(
64+
name = "modem_simulator",
65+
srcs = [
66+
"main.cpp",
67+
],
68+
copts = COPTS,
69+
deps = [
70+
":modem_simulator_lib",
71+
"//cuttlefish/common/libs/fs",
72+
"//cuttlefish/common/libs/utils",
73+
"//cuttlefish/host/libs/config",
74+
"//libbase",
75+
"@fmt",
76+
"@gflags",
77+
],
78+
)
79+
80+
cc_library(
81+
name = "modem_simulator_test_lib",
82+
hdrs = [
83+
"unittest/iccfile.txt",
84+
],
85+
)
86+
87+
cc_test(
88+
name = "modem_simulator_test",
89+
srcs = [
90+
"unittest/command_parser_test.cpp",
91+
"unittest/main_test.cpp",
92+
"unittest/pdu_parser_test.cpp",
93+
"unittest/service_test.cpp",
94+
],
95+
deps = [
96+
":modem_simulator_lib",
97+
":modem_simulator_test_lib",
98+
"//cuttlefish/common/libs/fs",
99+
"//cuttlefish/common/libs/utils",
100+
"//cuttlefish/host/commands/assemble_cvd:libassemble_cvd",
101+
"//cuttlefish/host/libs/config",
102+
"//libbase",
103+
"@gflags",
104+
"@googletest//:gtest",
105+
],
106+
)
107+
108+
clang_tidy_test(
109+
name = "modem_simulator_clang_tidy",
110+
srcs = [":modem_simulator"],
111+
tags = ["clang-tidy"],
112+
)
113+
114+
# TODO(b/405163202): Enable back once migration is completed.
115+
#
116+
# clang_tidy_test(
117+
# name = "modem_simulator_lib_clang_tidy",
118+
# srcs = [":modem_simulator_lib"],
119+
# tags = [ "clang-tidy"],
120+
# )
121+
122+
clang_tidy_test(
123+
name = "modem_simulator_test_clang_tidy",
124+
srcs = [":modem_simulator_test"],
125+
tags = [ "clang-tidy"],
126+
)

base/debian/cuttlefish-base.install

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ cvd/bazel-bin/cuttlefish/host/commands/display/cvd_internal_display /usr/lib/cut
1010
cvd/bazel-bin/cuttlefish/host/commands/health/health /usr/lib/cuttlefish-common/bin/
1111
cvd/bazel-bin/cuttlefish/host/commands/logcat_receiver/logcat_receiver /usr/lib/cuttlefish-common/bin/
1212
cvd/bazel-bin/cuttlefish/host/commands/mkenvimage_slim/mkenvimage_slim /usr/lib/cuttlefish-common/bin/
13+
cvd/bazel-bin/cuttlefish/host/commands/modem_simulator/modem_simulator /usr/lib/cuttlefish-common/bin/
1314
cvd/bazel-bin/cuttlefish/host/commands/process_restarter/process_restarter /usr/lib/cuttlefish-common/bin/
1415
cvd/bazel-bin/cuttlefish/host/commands/record_cvd/record_cvd /usr/lib/cuttlefish-common/bin/
1516
cvd/bazel-bin/cuttlefish/host/commands/restart_cvd/restart_cvd /usr/lib/cuttlefish-common/bin/
@@ -28,3 +29,4 @@ host/deploy/capability_query.py /usr/lib/cuttlefish-common/bin/
2829
host/deploy/install_zip.sh /usr/bin/
2930
host/deploy/unpack_boot_image.py /usr/lib/cuttlefish-common/bin/
3031
host/packages/cuttlefish-base/* /
32+
cvd/cuttlefish/host/commands/modem_simulator/files/* /usr/lib/cuttlefish-common/modem_simulator/files/

0 commit comments

Comments
 (0)