blob: b6b6b9b69aa732d8df9770df80ff2f64a122663a [file] [log] [blame]
Niko Sohmers3860f8a2024-01-12 21:05:19 -08001load("//tools/build_rules:js.bzl", "rollup_bundle", "ts_project")
2load("//frc971/downloader:downloader.bzl", "aos_downloader_dir")
3
4filegroup(
5 name = "files",
6 srcs = glob([
7 "**/*.html",
8 "**/*.css",
9 "**/*.png",
10 ]) + ["2024.png"],
11 visibility = ["//visibility:public"],
12)
13
Niko Sohmers3860f8a2024-01-12 21:05:19 -080014genrule(
15 name = "2024_field_png",
Niko Sohmers2d108762024-02-02 20:21:14 -080016 srcs = ["//third_party/y2024/field:pictures"],
Niko Sohmers3860f8a2024-01-12 21:05:19 -080017 outs = ["2024.png"],
Niko Sohmers2d108762024-02-02 20:21:14 -080018 cmd = "cp third_party/y2024/field/2024.png $@",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080019)
20
21ts_project(
22 name = "field_main",
23 srcs = [
24 "constants.ts",
25 "field_handler.ts",
26 "field_main.ts",
27 ],
28 target_compatible_with = ["@platforms//os:linux"],
29 deps = [
30 "//aos/network:connect_ts_fbs",
31 "//aos/network:message_bridge_client_ts_fbs",
32 "//aos/network:message_bridge_server_ts_fbs",
33 "//aos/network:web_proxy_ts_fbs",
34 "//aos/network/www:proxy",
35 "//frc971/control_loops:control_loops_ts_fbs",
36 "//frc971/control_loops/drivetrain:drivetrain_can_position_ts_fbs",
37 "//frc971/control_loops/drivetrain:drivetrain_position_ts_fbs",
38 "//frc971/control_loops/drivetrain:drivetrain_status_ts_fbs",
39 "//frc971/control_loops/drivetrain/localization:localizer_output_ts_fbs",
40 "//frc971/vision:target_map_ts_fbs",
41 "//y2024/control_loops/superstructure:superstructure_status_ts_fbs",
Niko Sohmersf1b9eb92024-03-03 15:30:07 -080042 "//y2024/localizer:status_ts_fbs",
43 "//y2024/localizer:visualization_ts_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080044 "@com_github_google_flatbuffers//ts:flatbuffers_ts",
45 ],
46)
47
48rollup_bundle(
49 name = "field_main_bundle",
50 entry_point = "field_main.ts",
51 target_compatible_with = ["@platforms//os:linux"],
52 visibility = ["//y2024:__subpackages__"],
53 deps = [
54 ":field_main",
55 ],
56)
57
Niko Sohmerse92516c2024-03-23 18:40:30 -070058ts_project(
59 name = "starter_main",
60 srcs = [
61 "starter_handler.ts",
62 "starter_main.ts",
63 ],
64 target_compatible_with = ["@platforms//os:linux"],
65 deps = [
66 "//aos/network:connect_ts_fbs",
67 "//aos/network:message_bridge_client_ts_fbs",
68 "//aos/network/www:proxy",
69 "//aos/starter:starter_ts_fbs",
70 "@com_github_google_flatbuffers//ts:flatbuffers_ts",
71 ],
72)
73
74rollup_bundle(
75 name = "starter_main_bundle",
76 entry_point = "starter_main.ts",
77 target_compatible_with = ["@platforms//os:linux"],
78 visibility = ["//y2024:__subpackages__"],
79 deps = [
80 ":starter_main",
81 ],
82)
83
Niko Sohmers3860f8a2024-01-12 21:05:19 -080084aos_downloader_dir(
85 name = "www_files",
86 srcs = [
87 ":field_main_bundle.min.js",
88 ":files",
Niko Sohmerse92516c2024-03-23 18:40:30 -070089 ":starter_main_bundle.min.js",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080090 "//frc971/analysis:plot_index_bundle.min.js",
91 ],
92 dir = "www",
93 target_compatible_with = ["@platforms//os:linux"],
94 visibility = ["//visibility:public"],
95)