blob: 0dc30d1066e828c4ebbc92e800444606b26319c0 [file] [log] [blame]
Niko Sohmers3860f8a2024-01-12 21:05:19 -08001load("//frc971/downloader:downloader.bzl", "aos_downloader_dir")
Austin Schuh8f99c822024-05-05 22:43:40 -07002load("//tools/build_rules:js.bzl", "rollup_bundle", "ts_project")
Niko Sohmers3860f8a2024-01-12 21:05:19 -08003
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",
Niko Sohmers7e217982024-03-24 15:38:26 -070041 "//y2024/control_loops/superstructure:superstructure_position_ts_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080042 "//y2024/control_loops/superstructure:superstructure_status_ts_fbs",
Niko Sohmersf1b9eb92024-03-03 15:30:07 -080043 "//y2024/localizer:status_ts_fbs",
44 "//y2024/localizer:visualization_ts_fbs",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080045 "@com_github_google_flatbuffers//ts:flatbuffers_ts",
46 ],
47)
48
49rollup_bundle(
50 name = "field_main_bundle",
51 entry_point = "field_main.ts",
52 target_compatible_with = ["@platforms//os:linux"],
53 visibility = ["//y2024:__subpackages__"],
54 deps = [
55 ":field_main",
56 ],
57)
58
59aos_downloader_dir(
60 name = "www_files",
61 srcs = [
62 ":field_main_bundle.min.js",
63 ":files",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080064 "//frc971/analysis:plot_index_bundle.min.js",
James Kuszmaulaf3bc6b2024-06-14 18:27:38 -070065 "//frc971/www:starter_files",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080066 ],
67 dir = "www",
68 target_compatible_with = ["@platforms//os:linux"],
69 visibility = ["//visibility:public"],
70)