blob: 8097f6a430a9ed5921818d3d9b933c9bef080e62 [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 = [
Austin Schuh529ac592021-10-14 16:11:13 -07007 "aos_starter",
Austin Schuhdde64052019-12-11 20:28:00 -08008 "starter.sh",
Austin Schuh44e0b142021-10-16 15:51:10 -07009 "starterd.stripped",
10 ],
11 visibility = ["//visibility:public"],
12)
13
14filegroup(
15 name = "starter_stripped",
16 srcs = [
17 "aos_starter.stripped",
18 "starter.sh",
19 "starterd.stripped",
Austin Schuhdde64052019-12-11 20:28:00 -080020 ],
21 visibility = ["//visibility:public"],
Brian Silverman96d12952015-10-12 13:36:42 -040022)
Brian Silverman100534c2015-09-07 15:51:23 -040023
Tyler Chatowa79419d2020-08-12 20:12:11 -070024cc_library(
25 name = "starterd_lib",
26 srcs = ["starterd_lib.cc"],
27 hdrs = ["starterd_lib.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080028 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070029 deps = [
30 ":starter_fbs",
31 ":starter_rpc_fbs",
32 "//aos:configuration",
33 "//aos:macros",
34 "//aos/events:shm_event_loop",
35 "@com_github_google_glog//:glog",
36 ],
37)
38
39cc_test(
40 name = "starter_test",
41 srcs = ["starter_test.cc"],
42 data = [
43 "//aos/events:ping",
44 "//aos/events:pingpong_config",
45 "//aos/events:pong",
46 ],
Austin Schuh5f79a5a2021-10-12 17:46:50 -070047 shard_count = 3,
Philipp Schraderdada1072020-11-24 11:34:46 -080048 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070049 deps = [
50 ":starter_rpc_lib",
51 ":starterd_lib",
52 "//aos/events:ping_fbs",
53 "//aos/events:pong_fbs",
54 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -070055 "//aos/testing:path",
Tyler Chatowa79419d2020-08-12 20:12:11 -070056 "//aos/testing:tmpdir",
57 ],
58)
59
60cc_binary(
61 name = "starterd",
62 srcs = ["starterd.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080063 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh529ac592021-10-14 16:11:13 -070064 visibility = ["//visibility:public"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070065 deps = [
66 ":starterd_lib",
67 "//aos:init",
68 ],
69)
70
71cc_library(
72 name = "starter_rpc_lib",
73 srcs = ["starter_rpc_lib.cc"],
74 hdrs = ["starter_rpc_lib.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080075 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070076 deps = [
77 ":starter_fbs",
78 ":starter_rpc_fbs",
79 "//aos:configuration",
80 "//aos:init",
81 "//aos/events:shm_event_loop",
82 ],
83)
84
85cc_binary(
Austin Schuh529ac592021-10-14 16:11:13 -070086 name = "aos_starter",
Tyler Chatowa79419d2020-08-12 20:12:11 -070087 srcs = ["starter_cmd.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080088 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh529ac592021-10-14 16:11:13 -070089 visibility = ["//visibility:public"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070090 deps = [
91 ":starter_rpc_lib",
Austin Schuhc61e9c02021-04-26 12:10:40 -070092 "//aos/time",
Tyler Chatowa79419d2020-08-12 20:12:11 -070093 "@com_github_google_glog//:glog",
Philipp Schrader08537492021-01-23 16:17:55 -080094 "@com_google_absl//absl/strings:str_format",
Tyler Chatowa79419d2020-08-12 20:12:11 -070095 ],
96)
97
98flatbuffer_cc_library(
99 name = "starter_fbs",
100 srcs = ["starter.fbs"],
101 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800102 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -0700103 visibility = ["//visibility:public"],
104)
105
106flatbuffer_cc_library(
107 name = "starter_rpc_fbs",
108 srcs = ["starter_rpc.fbs"],
109 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800110 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -0700111 visibility = ["//visibility:public"],
112)
James Kuszmaul77e19812021-05-19 21:36:10 -0700113
114py_binary(
115 name = "starter_demo",
116 srcs = ["starter_demo.py"],
117 args = [
118 "$(rootpath :starterd)",
119 "\"$(rootpaths //aos/events:pingpong_config)\"",
120 "$(rootpath //aos/events:ping)",
121 "$(rootpath //aos/events:pong)",
Austin Schuh529ac592021-10-14 16:11:13 -0700122 "$(rootpath :aos_starter)",
James Kuszmaul77e19812021-05-19 21:36:10 -0700123 ],
124 data = [
Austin Schuh529ac592021-10-14 16:11:13 -0700125 ":aos_starter",
James Kuszmaul77e19812021-05-19 21:36:10 -0700126 ":starterd",
127 "//aos/events:ping",
128 "//aos/events:pingpong_config",
129 "//aos/events:pong",
130 ],
131)