blob: cc7ea04c6a87c2ea102f79e711d88405bf4cd21d [file] [log] [blame]
Tyler Chatowa79419d2020-08-12 20:12:11 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
2
Brian Silverman96d12952015-10-12 13:36:42 -04003# This target is everything which should get deployed to the robot.
4filegroup(
Austin Schuhdde64052019-12-11 20:28:00 -08005 name = "starter",
6 srcs = [
7 "starter.sh",
Tyler Chatow03fdb2a2020-12-26 18:39:36 -08008 "starter_cmd",
Austin Schuh1bd52e22021-02-07 22:14:56 -08009 "starterd",
Austin Schuhdde64052019-12-11 20:28:00 -080010 ],
11 visibility = ["//visibility:public"],
Brian Silverman96d12952015-10-12 13:36:42 -040012)
Brian Silverman100534c2015-09-07 15:51:23 -040013
Tyler Chatowa79419d2020-08-12 20:12:11 -070014cc_library(
15 name = "starterd_lib",
16 srcs = ["starterd_lib.cc"],
17 hdrs = ["starterd_lib.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080018 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070019 deps = [
20 ":starter_fbs",
21 ":starter_rpc_fbs",
22 "//aos:configuration",
23 "//aos:macros",
24 "//aos/events:shm_event_loop",
25 "@com_github_google_glog//:glog",
26 ],
27)
28
29cc_test(
30 name = "starter_test",
31 srcs = ["starter_test.cc"],
32 data = [
33 "//aos/events:ping",
34 "//aos/events:pingpong_config",
35 "//aos/events:pong",
36 ],
Austin Schuh5f79a5a2021-10-12 17:46:50 -070037 shard_count = 3,
Philipp Schraderdada1072020-11-24 11:34:46 -080038 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070039 deps = [
40 ":starter_rpc_lib",
41 ":starterd_lib",
42 "//aos/events:ping_fbs",
43 "//aos/events:pong_fbs",
44 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -070045 "//aos/testing:path",
Tyler Chatowa79419d2020-08-12 20:12:11 -070046 "//aos/testing:tmpdir",
47 ],
48)
49
50cc_binary(
51 name = "starterd",
52 srcs = ["starterd.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080053 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070054 deps = [
55 ":starterd_lib",
56 "//aos:init",
57 ],
58)
59
60cc_library(
61 name = "starter_rpc_lib",
62 srcs = ["starter_rpc_lib.cc"],
63 hdrs = ["starter_rpc_lib.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080064 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070065 deps = [
66 ":starter_fbs",
67 ":starter_rpc_fbs",
68 "//aos:configuration",
69 "//aos:init",
70 "//aos/events:shm_event_loop",
71 ],
72)
73
74cc_binary(
75 name = "starter_cmd",
76 srcs = ["starter_cmd.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080077 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070078 deps = [
79 ":starter_rpc_lib",
Austin Schuhc61e9c02021-04-26 12:10:40 -070080 "//aos/time",
Tyler Chatowa79419d2020-08-12 20:12:11 -070081 "@com_github_google_glog//:glog",
Philipp Schrader08537492021-01-23 16:17:55 -080082 "@com_google_absl//absl/strings:str_format",
Tyler Chatowa79419d2020-08-12 20:12:11 -070083 ],
84)
85
86flatbuffer_cc_library(
87 name = "starter_fbs",
88 srcs = ["starter.fbs"],
89 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -080090 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070091 visibility = ["//visibility:public"],
92)
93
94flatbuffer_cc_library(
95 name = "starter_rpc_fbs",
96 srcs = ["starter_rpc.fbs"],
97 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -080098 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070099 visibility = ["//visibility:public"],
100)
James Kuszmaul77e19812021-05-19 21:36:10 -0700101
102py_binary(
103 name = "starter_demo",
104 srcs = ["starter_demo.py"],
105 args = [
106 "$(rootpath :starterd)",
107 "\"$(rootpaths //aos/events:pingpong_config)\"",
108 "$(rootpath //aos/events:ping)",
109 "$(rootpath //aos/events:pong)",
110 "$(rootpath :starter_cmd)",
111 ],
112 data = [
113 ":starter_cmd",
114 ":starterd",
115 "//aos/events:ping",
116 "//aos/events:pingpong_config",
117 "//aos/events:pong",
118 ],
119)