Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 1 | load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") |
| 2 | |
Brian Silverman | 96d1295 | 2015-10-12 13:36:42 -0400 | [diff] [blame] | 3 | # This target is everything which should get deployed to the robot. |
| 4 | filegroup( |
Austin Schuh | dde6405 | 2019-12-11 20:28:00 -0800 | [diff] [blame] | 5 | name = "starter", |
| 6 | srcs = [ |
Austin Schuh | 529ac59 | 2021-10-14 16:11:13 -0700 | [diff] [blame^] | 7 | "aos_starter", |
Austin Schuh | dde6405 | 2019-12-11 20:28:00 -0800 | [diff] [blame] | 8 | "starter.sh", |
Austin Schuh | 1bd52e2 | 2021-02-07 22:14:56 -0800 | [diff] [blame] | 9 | "starterd", |
Austin Schuh | dde6405 | 2019-12-11 20:28:00 -0800 | [diff] [blame] | 10 | ], |
| 11 | visibility = ["//visibility:public"], |
Brian Silverman | 96d1295 | 2015-10-12 13:36:42 -0400 | [diff] [blame] | 12 | ) |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 13 | |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 14 | cc_library( |
| 15 | name = "starterd_lib", |
| 16 | srcs = ["starterd_lib.cc"], |
| 17 | hdrs = ["starterd_lib.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 18 | target_compatible_with = ["@platforms//os:linux"], |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 19 | 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 | |
| 29 | cc_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 Schuh | 5f79a5a | 2021-10-12 17:46:50 -0700 | [diff] [blame] | 37 | shard_count = 3, |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 38 | target_compatible_with = ["@platforms//os:linux"], |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 39 | deps = [ |
| 40 | ":starter_rpc_lib", |
| 41 | ":starterd_lib", |
| 42 | "//aos/events:ping_fbs", |
| 43 | "//aos/events:pong_fbs", |
| 44 | "//aos/testing:googletest", |
Austin Schuh | 373f176 | 2021-06-02 21:07:09 -0700 | [diff] [blame] | 45 | "//aos/testing:path", |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 46 | "//aos/testing:tmpdir", |
| 47 | ], |
| 48 | ) |
| 49 | |
| 50 | cc_binary( |
| 51 | name = "starterd", |
| 52 | srcs = ["starterd.cc"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 53 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 529ac59 | 2021-10-14 16:11:13 -0700 | [diff] [blame^] | 54 | visibility = ["//visibility:public"], |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 55 | deps = [ |
| 56 | ":starterd_lib", |
| 57 | "//aos:init", |
| 58 | ], |
| 59 | ) |
| 60 | |
| 61 | cc_library( |
| 62 | name = "starter_rpc_lib", |
| 63 | srcs = ["starter_rpc_lib.cc"], |
| 64 | hdrs = ["starter_rpc_lib.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 65 | target_compatible_with = ["@platforms//os:linux"], |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 66 | deps = [ |
| 67 | ":starter_fbs", |
| 68 | ":starter_rpc_fbs", |
| 69 | "//aos:configuration", |
| 70 | "//aos:init", |
| 71 | "//aos/events:shm_event_loop", |
| 72 | ], |
| 73 | ) |
| 74 | |
| 75 | cc_binary( |
Austin Schuh | 529ac59 | 2021-10-14 16:11:13 -0700 | [diff] [blame^] | 76 | name = "aos_starter", |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 77 | srcs = ["starter_cmd.cc"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 78 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 529ac59 | 2021-10-14 16:11:13 -0700 | [diff] [blame^] | 79 | visibility = ["//visibility:public"], |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 80 | deps = [ |
| 81 | ":starter_rpc_lib", |
Austin Schuh | c61e9c0 | 2021-04-26 12:10:40 -0700 | [diff] [blame] | 82 | "//aos/time", |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 83 | "@com_github_google_glog//:glog", |
Philipp Schrader | 0853749 | 2021-01-23 16:17:55 -0800 | [diff] [blame] | 84 | "@com_google_absl//absl/strings:str_format", |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 85 | ], |
| 86 | ) |
| 87 | |
| 88 | flatbuffer_cc_library( |
| 89 | name = "starter_fbs", |
| 90 | srcs = ["starter.fbs"], |
| 91 | gen_reflections = True, |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 92 | target_compatible_with = ["@platforms//os:linux"], |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 93 | visibility = ["//visibility:public"], |
| 94 | ) |
| 95 | |
| 96 | flatbuffer_cc_library( |
| 97 | name = "starter_rpc_fbs", |
| 98 | srcs = ["starter_rpc.fbs"], |
| 99 | gen_reflections = True, |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 100 | target_compatible_with = ["@platforms//os:linux"], |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 101 | visibility = ["//visibility:public"], |
| 102 | ) |
James Kuszmaul | 77e1981 | 2021-05-19 21:36:10 -0700 | [diff] [blame] | 103 | |
| 104 | py_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 Schuh | 529ac59 | 2021-10-14 16:11:13 -0700 | [diff] [blame^] | 112 | "$(rootpath :aos_starter)", |
James Kuszmaul | 77e1981 | 2021-05-19 21:36:10 -0700 | [diff] [blame] | 113 | ], |
| 114 | data = [ |
Austin Schuh | 529ac59 | 2021-10-14 16:11:13 -0700 | [diff] [blame^] | 115 | ":aos_starter", |
James Kuszmaul | 77e1981 | 2021-05-19 21:36:10 -0700 | [diff] [blame] | 116 | ":starterd", |
| 117 | "//aos/events:ping", |
| 118 | "//aos/events:pingpong_config", |
| 119 | "//aos/events:pong", |
| 120 | ], |
| 121 | ) |