blob: 8bc37553e41a5a8675c18a391e99a2ef1fbfaf04 [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",
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
Niko Sohmerse92516c2024-03-23 18:40:30 -070059ts_project(
60 name = "starter_main",
61 srcs = [
62 "starter_handler.ts",
63 "starter_main.ts",
64 ],
65 target_compatible_with = ["@platforms//os:linux"],
66 deps = [
67 "//aos/network:connect_ts_fbs",
68 "//aos/network:message_bridge_client_ts_fbs",
69 "//aos/network/www:proxy",
70 "//aos/starter:starter_ts_fbs",
71 "@com_github_google_flatbuffers//ts:flatbuffers_ts",
72 ],
73)
74
75rollup_bundle(
76 name = "starter_main_bundle",
77 entry_point = "starter_main.ts",
78 target_compatible_with = ["@platforms//os:linux"],
79 visibility = ["//y2024:__subpackages__"],
80 deps = [
81 ":starter_main",
82 ],
83)
84
Niko Sohmers3860f8a2024-01-12 21:05:19 -080085aos_downloader_dir(
86 name = "www_files",
87 srcs = [
88 ":field_main_bundle.min.js",
89 ":files",
Niko Sohmerse92516c2024-03-23 18:40:30 -070090 ":starter_main_bundle.min.js",
Niko Sohmers3860f8a2024-01-12 21:05:19 -080091 "//frc971/analysis:plot_index_bundle.min.js",
92 ],
93 dir = "www",
94 target_compatible_with = ["@platforms//os:linux"],
95 visibility = ["//visibility:public"],
96)