blob: 957045d90cb06372e86c17748fc4d8be16d98de8 [file] [log] [blame]
James Kuszmaulf3ef9e12022-03-05 17:13:00 -08001load("@npm//@bazel/typescript:index.bzl", "ts_library")
2load("//tools/build_rules:js.bzl", "rollup_bundle")
Austin Schuh76f227c2022-02-23 16:34:08 -08003load("//frc971/downloader:downloader.bzl", "aos_downloader_dir")
4
5filegroup(
6 name = "files",
7 srcs = glob([
8 "**/*.html",
9 "**/*.css",
James Kuszmaulf3ef9e12022-03-05 17:13:00 -080010 "**/*.png",
Austin Schuh76f227c2022-02-23 16:34:08 -080011 ]),
12 visibility = ["//visibility:public"],
13)
14
James Kuszmaulf3ef9e12022-03-05 17:13:00 -080015ts_library(
16 name = "field_main",
17 srcs = [
18 "constants.ts",
19 "field_handler.ts",
20 "field_main.ts",
21 ],
22 target_compatible_with = ["@platforms//os:linux"],
23 deps = [
24 "//aos/network:connect_ts_fbs",
25 "//aos/network:web_proxy_ts_fbs",
26 "//aos/network/www:proxy",
James Kuszmaulb84c0912022-04-13 19:44:52 -070027 "//frc971/control_loops/drivetrain:drivetrain_status_ts_fbs",
James Kuszmaulf3ef9e12022-03-05 17:13:00 -080028 "//y2022/control_loops/superstructure:superstructure_status_ts_fbs",
29 "//y2022/localizer:localizer_output_ts_fbs",
James Kuszmauldac091f2022-03-22 09:35:06 -070030 "//y2022/localizer:localizer_status_ts_fbs",
James Kuszmaulf3ef9e12022-03-05 17:13:00 -080031 "//y2022/localizer:localizer_visualization_ts_fbs",
32 "@com_github_google_flatbuffers//ts:flatbuffers_ts",
33 ],
34)
35
36rollup_bundle(
37 name = "field_main_bundle",
38 entry_point = "field_main.ts",
39 target_compatible_with = ["@platforms//os:linux"],
40 visibility = ["//y2022:__subpackages__"],
41 deps = [
42 ":field_main",
43 ],
44)
45
Austin Schuh76f227c2022-02-23 16:34:08 -080046aos_downloader_dir(
47 name = "www_files",
48 srcs = [
James Kuszmaul1b734232022-03-12 10:40:28 -080049 ":field_main_bundle.min.js",
Austin Schuh76f227c2022-02-23 16:34:08 -080050 ":files",
51 "//frc971/analysis:plot_index_bundle.min.js",
52 ],
53 dir = "www",
54 target_compatible_with = ["@platforms//os:linux"],
55 visibility = ["//visibility:public"],
56)