Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 1 | load("//tools/build_rules:js.bzl", "rollup_bundle", "ts_project") |
| 2 | load("//frc971/downloader:downloader.bzl", "aos_downloader_dir") |
| 3 | |
| 4 | filegroup( |
| 5 | name = "files", |
| 6 | srcs = glob([ |
| 7 | "**/*.html", |
| 8 | "**/*.css", |
| 9 | "**/*.png", |
| 10 | ]) + ["2024.png"], |
| 11 | visibility = ["//visibility:public"], |
| 12 | ) |
| 13 | |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 14 | genrule( |
| 15 | name = "2024_field_png", |
Niko Sohmers | 2d10876 | 2024-02-02 20:21:14 -0800 | [diff] [blame] | 16 | srcs = ["//third_party/y2024/field:pictures"], |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 17 | outs = ["2024.png"], |
Niko Sohmers | 2d10876 | 2024-02-02 20:21:14 -0800 | [diff] [blame] | 18 | cmd = "cp third_party/y2024/field/2024.png $@", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 19 | ) |
| 20 | |
| 21 | ts_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 Sohmers | 7e21798 | 2024-03-24 15:38:26 -0700 | [diff] [blame] | 41 | "//y2024/control_loops/superstructure:superstructure_position_ts_fbs", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 42 | "//y2024/control_loops/superstructure:superstructure_status_ts_fbs", |
Niko Sohmers | f1b9eb9 | 2024-03-03 15:30:07 -0800 | [diff] [blame] | 43 | "//y2024/localizer:status_ts_fbs", |
| 44 | "//y2024/localizer:visualization_ts_fbs", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 45 | "@com_github_google_flatbuffers//ts:flatbuffers_ts", |
| 46 | ], |
| 47 | ) |
| 48 | |
| 49 | rollup_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 Sohmers | e92516c | 2024-03-23 18:40:30 -0700 | [diff] [blame] | 59 | ts_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 | |
| 75 | rollup_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 Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 85 | aos_downloader_dir( |
| 86 | name = "www_files", |
| 87 | srcs = [ |
| 88 | ":field_main_bundle.min.js", |
| 89 | ":files", |
Niko Sohmers | e92516c | 2024-03-23 18:40:30 -0700 | [diff] [blame] | 90 | ":starter_main_bundle.min.js", |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 91 | "//frc971/analysis:plot_index_bundle.min.js", |
| 92 | ], |
| 93 | dir = "www", |
| 94 | target_compatible_with = ["@platforms//os:linux"], |
| 95 | visibility = ["//visibility:public"], |
| 96 | ) |