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 | 44e0b14 | 2021-10-16 15:51:10 -0700 | [diff] [blame] | 9 | "starterd.stripped", |
| 10 | ], |
| 11 | visibility = ["//visibility:public"], |
| 12 | ) |
| 13 | |
| 14 | filegroup( |
| 15 | name = "starter_stripped", |
| 16 | srcs = [ |
| 17 | "aos_starter.stripped", |
| 18 | "starter.sh", |
| 19 | "starterd.stripped", |
Austin Schuh | dde6405 | 2019-12-11 20:28:00 -0800 | [diff] [blame] | 20 | ], |
| 21 | visibility = ["//visibility:public"], |
Brian Silverman | 96d1295 | 2015-10-12 13:36:42 -0400 | [diff] [blame] | 22 | ) |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 23 | |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 24 | cc_library( |
| 25 | name = "starterd_lib", |
| 26 | srcs = ["starterd_lib.cc"], |
| 27 | hdrs = ["starterd_lib.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 28 | target_compatible_with = ["@platforms//os:linux"], |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 29 | 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 | |
| 39 | cc_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 Schuh | 5f79a5a | 2021-10-12 17:46:50 -0700 | [diff] [blame] | 47 | shard_count = 3, |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 48 | target_compatible_with = ["@platforms//os:linux"], |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 49 | deps = [ |
| 50 | ":starter_rpc_lib", |
| 51 | ":starterd_lib", |
| 52 | "//aos/events:ping_fbs", |
| 53 | "//aos/events:pong_fbs", |
| 54 | "//aos/testing:googletest", |
Austin Schuh | 373f176 | 2021-06-02 21:07:09 -0700 | [diff] [blame] | 55 | "//aos/testing:path", |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 56 | "//aos/testing:tmpdir", |
| 57 | ], |
| 58 | ) |
| 59 | |
| 60 | cc_binary( |
| 61 | name = "starterd", |
| 62 | srcs = ["starterd.cc"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 63 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 529ac59 | 2021-10-14 16:11:13 -0700 | [diff] [blame] | 64 | visibility = ["//visibility:public"], |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 65 | deps = [ |
| 66 | ":starterd_lib", |
| 67 | "//aos:init", |
| 68 | ], |
| 69 | ) |
| 70 | |
| 71 | cc_library( |
| 72 | name = "starter_rpc_lib", |
| 73 | srcs = ["starter_rpc_lib.cc"], |
| 74 | hdrs = ["starter_rpc_lib.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 75 | target_compatible_with = ["@platforms//os:linux"], |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 76 | deps = [ |
| 77 | ":starter_fbs", |
| 78 | ":starter_rpc_fbs", |
| 79 | "//aos:configuration", |
| 80 | "//aos:init", |
| 81 | "//aos/events:shm_event_loop", |
| 82 | ], |
| 83 | ) |
| 84 | |
| 85 | cc_binary( |
Austin Schuh | 529ac59 | 2021-10-14 16:11:13 -0700 | [diff] [blame] | 86 | name = "aos_starter", |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 87 | srcs = ["starter_cmd.cc"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 88 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 529ac59 | 2021-10-14 16:11:13 -0700 | [diff] [blame] | 89 | visibility = ["//visibility:public"], |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 90 | deps = [ |
| 91 | ":starter_rpc_lib", |
Austin Schuh | c61e9c0 | 2021-04-26 12:10:40 -0700 | [diff] [blame] | 92 | "//aos/time", |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 93 | "@com_github_google_glog//:glog", |
Philipp Schrader | 0853749 | 2021-01-23 16:17:55 -0800 | [diff] [blame] | 94 | "@com_google_absl//absl/strings:str_format", |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 95 | ], |
| 96 | ) |
| 97 | |
| 98 | flatbuffer_cc_library( |
| 99 | name = "starter_fbs", |
| 100 | srcs = ["starter.fbs"], |
| 101 | gen_reflections = True, |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 102 | target_compatible_with = ["@platforms//os:linux"], |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 103 | visibility = ["//visibility:public"], |
| 104 | ) |
| 105 | |
| 106 | flatbuffer_cc_library( |
| 107 | name = "starter_rpc_fbs", |
| 108 | srcs = ["starter_rpc.fbs"], |
| 109 | gen_reflections = True, |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 110 | target_compatible_with = ["@platforms//os:linux"], |
Tyler Chatow | a79419d | 2020-08-12 20:12:11 -0700 | [diff] [blame] | 111 | visibility = ["//visibility:public"], |
| 112 | ) |
James Kuszmaul | 77e1981 | 2021-05-19 21:36:10 -0700 | [diff] [blame] | 113 | |
| 114 | py_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 Schuh | 529ac59 | 2021-10-14 16:11:13 -0700 | [diff] [blame] | 122 | "$(rootpath :aos_starter)", |
James Kuszmaul | 77e1981 | 2021-05-19 21:36:10 -0700 | [diff] [blame] | 123 | ], |
| 124 | data = [ |
Austin Schuh | 529ac59 | 2021-10-14 16:11:13 -0700 | [diff] [blame] | 125 | ":aos_starter", |
James Kuszmaul | 77e1981 | 2021-05-19 21:36:10 -0700 | [diff] [blame] | 126 | ":starterd", |
| 127 | "//aos/events:ping", |
| 128 | "//aos/events:pingpong_config", |
| 129 | "//aos/events:pong", |
| 130 | ], |
| 131 | ) |