blob: 187b0b01fe434c0c409e2777459f4b190fa9e890 [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 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"],
Austin Schuh529ac592021-10-14 16:11:13 -070054 visibility = ["//visibility:public"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070055 deps = [
56 ":starterd_lib",
57 "//aos:init",
58 ],
59)
60
61cc_library(
62 name = "starter_rpc_lib",
63 srcs = ["starter_rpc_lib.cc"],
64 hdrs = ["starter_rpc_lib.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080065 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070066 deps = [
67 ":starter_fbs",
68 ":starter_rpc_fbs",
69 "//aos:configuration",
70 "//aos:init",
71 "//aos/events:shm_event_loop",
72 ],
73)
74
75cc_binary(
Austin Schuh529ac592021-10-14 16:11:13 -070076 name = "aos_starter",
Tyler Chatowa79419d2020-08-12 20:12:11 -070077 srcs = ["starter_cmd.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080078 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh529ac592021-10-14 16:11:13 -070079 visibility = ["//visibility:public"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070080 deps = [
81 ":starter_rpc_lib",
Austin Schuhc61e9c02021-04-26 12:10:40 -070082 "//aos/time",
Tyler Chatowa79419d2020-08-12 20:12:11 -070083 "@com_github_google_glog//:glog",
Philipp Schrader08537492021-01-23 16:17:55 -080084 "@com_google_absl//absl/strings:str_format",
Tyler Chatowa79419d2020-08-12 20:12:11 -070085 ],
86)
87
88flatbuffer_cc_library(
89 name = "starter_fbs",
90 srcs = ["starter.fbs"],
91 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -080092 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070093 visibility = ["//visibility:public"],
94)
95
96flatbuffer_cc_library(
97 name = "starter_rpc_fbs",
98 srcs = ["starter_rpc.fbs"],
99 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800100 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -0700101 visibility = ["//visibility:public"],
102)
James Kuszmaul77e19812021-05-19 21:36:10 -0700103
104py_binary(
105 name = "starter_demo",
106 srcs = ["starter_demo.py"],
107 args = [
108 "$(rootpath :starterd)",
109 "\"$(rootpaths //aos/events:pingpong_config)\"",
110 "$(rootpath //aos/events:ping)",
111 "$(rootpath //aos/events:pong)",
Austin Schuh529ac592021-10-14 16:11:13 -0700112 "$(rootpath :aos_starter)",
James Kuszmaul77e19812021-05-19 21:36:10 -0700113 ],
114 data = [
Austin Schuh529ac592021-10-14 16:11:13 -0700115 ":aos_starter",
James Kuszmaul77e19812021-05-19 21:36:10 -0700116 ":starterd",
117 "//aos/events:ping",
118 "//aos/events:pingpong_config",
119 "//aos/events:pong",
120 ],
121)