Update ~all flatbuffer rules to static_flatbuffer rules

Don't update things that use unions or circular dependencies.

Used buildozer to make most changes; didn't document the precise steps,
but the approximate steps were:
* Alter the load statements to use the new rule.
* Make all flatbuffer_cc_library rules:
  * No longer specify gen_reflections.
  * Move all includes attributes to use deps (including stripping the
    _includes prefix off of the items in the includes list).
* Rename all flatbuffer_cc_library rules to static_flatbuffer rules.
* Manually fix the spyglass flatbuffer_py_library target that depended
  directly on some outputs of the flatbuffer_cc_library macro.
* Manually undo anything that can't build with the new rules (should
  just be the json_to_flatbuffer target, web_proxy_fbs, and one of the
  flatbuffers used to test the static flatbuffers codegen itself).
* Run the cleanup to get rid of unused load statements.

Change-Id: Ie37a13585228847b19177dc86a9aa603ad90e890
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/frc971/BUILD b/frc971/BUILD
index 4287462..a861316 100644
--- a/frc971/BUILD
+++ b/frc971/BUILD
@@ -1,4 +1,4 @@
-load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
+load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
 
 package(default_visibility = ["//visibility:public"])
 
@@ -26,12 +26,11 @@
     visibility = ["//visibility:public"],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "can_configuration_fbs",
     srcs = [
         ":can_configuration.fbs",
     ],
-    gen_reflections = 1,
     visibility = ["//visibility:public"],
 )
 
diff --git a/frc971/analysis/BUILD b/frc971/analysis/BUILD
index 9b9ab86..93f50f4 100644
--- a/frc971/analysis/BUILD
+++ b/frc971/analysis/BUILD
@@ -1,5 +1,5 @@
+load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
 load("//tools/build_rules:js.bzl", "rollup_bundle", "ts_project")
-load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
 load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
 load("//aos:config.bzl", "aos_config")
 
@@ -112,12 +112,11 @@
     target_compatible_with = ["@platforms//os:linux"],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "plot_data_fbs",
     srcs = [
         "plot_data.fbs",
     ],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
 )
 
diff --git a/frc971/autonomous/BUILD b/frc971/autonomous/BUILD
index 58dce60..d5b8cdc 100644
--- a/frc971/autonomous/BUILD
+++ b/frc971/autonomous/BUILD
@@ -1,20 +1,18 @@
+load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
 load("//aos:config.bzl", "aos_config")
-load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
 
 package(default_visibility = ["//visibility:public"])
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "auto_fbs",
     srcs = ["auto.fbs"],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
     visibility = ["//visibility:public"],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "auto_mode_fbs",
     srcs = ["auto_mode.fbs"],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
     visibility = ["//visibility:public"],
 )
diff --git a/frc971/can_logger/BUILD b/frc971/can_logger/BUILD
index a18a379..f568aa9 100644
--- a/frc971/can_logger/BUILD
+++ b/frc971/can_logger/BUILD
@@ -1,4 +1,4 @@
-load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
+load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
 
 cc_binary(
     name = "can_logger",
@@ -29,12 +29,11 @@
     ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "can_logging_fbs",
     srcs = [
         "can_logging.fbs",
     ],
-    gen_reflections = 1,
     visibility = ["//visibility:public"],
 )
 
diff --git a/frc971/codelab/BUILD b/frc971/codelab/BUILD
index 4e1da3d..5e0c1ea 100644
--- a/frc971/codelab/BUILD
+++ b/frc971/codelab/BUILD
@@ -1,4 +1,4 @@
-load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
+load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
 load("//aos:config.bzl", "aos_config")
 
 package(default_visibility = ["//visibility:public"])
@@ -37,39 +37,35 @@
     ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "basic_goal_fbs",
     srcs = [
         "basic_goal.fbs",
     ],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "basic_output_fbs",
     srcs = [
         "basic_output.fbs",
     ],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "basic_status_fbs",
     srcs = [
         "basic_status.fbs",
     ],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "basic_position_fbs",
     srcs = [
         "basic_position.fbs",
     ],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
 )
 
diff --git a/frc971/constants/testdata/BUILD b/frc971/constants/testdata/BUILD
index a20264c..fee7b86 100644
--- a/frc971/constants/testdata/BUILD
+++ b/frc971/constants/testdata/BUILD
@@ -1,26 +1,24 @@
+load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
 load("//aos:config.bzl", "aos_config")
-load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
 
 exports_files([
     "test_constants.json",
     "syntax_error.json",
 ])
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "constants_list_fbs",
     srcs = ["constants_list.fbs"],
-    gen_reflections = 1,
-    includes = [
-        ":constants_data_fbs_includes",
-    ],
     target_compatible_with = ["@platforms//os:linux"],
     visibility = ["//visibility:public"],
+    deps = [
+        ":constants_data_fbs",
+    ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "constants_data_fbs",
     srcs = ["constants_data.fbs"],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
     visibility = ["//visibility:public"],
 )
diff --git a/frc971/control_loops/BUILD b/frc971/control_loops/BUILD
index c03a964..1a98691 100644
--- a/frc971/control_loops/BUILD
+++ b/frc971/control_loops/BUILD
@@ -1,5 +1,5 @@
 load("//aos:config.bzl", "aos_config")
-load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
+load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
 load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
 
 package(default_visibility = ["//visibility:public"])
@@ -192,7 +192,7 @@
     ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "control_loops_fbs",
     srcs = [
         "control_loops.fbs",
@@ -206,7 +206,7 @@
     ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "can_falcon_fbs",
     srcs = [
         "can_falcon.fbs",
@@ -395,15 +395,15 @@
     ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "profiled_subsystem_fbs",
     srcs = [
         "profiled_subsystem.fbs",
     ],
-    includes = [
-        ":control_loops_fbs_includes",
-    ],
     target_compatible_with = ["@platforms//os:linux"],
+    deps = [
+        ":control_loops_fbs",
+    ],
 )
 
 cc_library(
@@ -575,76 +575,70 @@
     ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal_fbs",
     srcs = [
         "static_zeroing_single_dof_profiled_subsystem_test_subsystem_goal.fbs",
     ],
-    gen_reflections = 1,
-    includes = [
-        ":control_loops_fbs_includes",
-        ":profiled_subsystem_fbs_includes",
-    ],
     target_compatible_with = ["@platforms//os:linux"],
+    deps = [
+        ":control_loops_fbs",
+        ":profiled_subsystem_fbs",
+    ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output_fbs",
     srcs = [
         "static_zeroing_single_dof_profiled_subsystem_test_subsystem_output.fbs",
     ],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position_fbs",
     srcs = [
         "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_position.fbs",
     ],
-    gen_reflections = 1,
-    includes = [
-        ":control_loops_fbs_includes",
-    ],
     target_compatible_with = ["@platforms//os:linux"],
+    deps = [
+        ":control_loops_fbs",
+    ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_position_fbs",
     srcs = [
         "static_zeroing_single_dof_profiled_subsystem_test_absolute_position.fbs",
     ],
-    gen_reflections = 1,
-    includes = [
-        ":control_loops_fbs_includes",
-    ],
     target_compatible_with = ["@platforms//os:linux"],
+    deps = [
+        ":control_loops_fbs",
+    ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status_fbs",
     srcs = [
         "static_zeroing_single_dof_profiled_subsystem_test_pot_and_absolute_encoder_status.fbs",
     ],
-    gen_reflections = 1,
-    includes = [
-        ":control_loops_fbs_includes",
-        ":profiled_subsystem_fbs_includes",
-    ],
     target_compatible_with = ["@platforms//os:linux"],
+    deps = [
+        ":control_loops_fbs",
+        ":profiled_subsystem_fbs",
+    ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status_fbs",
     srcs = [
         "static_zeroing_single_dof_profiled_subsystem_test_absolute_encoder_status.fbs",
     ],
-    gen_reflections = 1,
-    includes = [
-        ":control_loops_fbs_includes",
-        ":profiled_subsystem_fbs_includes",
-    ],
     target_compatible_with = ["@platforms//os:linux"],
+    deps = [
+        ":control_loops_fbs",
+        ":profiled_subsystem_fbs",
+    ],
 )
 
 cc_test(
diff --git a/frc971/control_loops/drivetrain/BUILD b/frc971/control_loops/drivetrain/BUILD
index e631799..424c257 100644
--- a/frc971/control_loops/drivetrain/BUILD
+++ b/frc971/control_loops/drivetrain/BUILD
@@ -1,5 +1,5 @@
+load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
 load("//tools/build_rules:js.bzl", "ts_project")
-load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
 load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
 load("//aos:config.bzl", "aos_config")
 load("//tools/build_rules:select.bzl", "cpu_select")
@@ -7,54 +7,47 @@
 
 package(default_visibility = ["//visibility:public"])
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "drivetrain_can_position_fbs",
     srcs = ["drivetrain_can_position.fbs"],
-    gen_reflections = 1,
     deps = ["//frc971/control_loops:can_falcon_fbs"],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "spline_goal_fbs",
     srcs = ["spline_goal.fbs"],
-    gen_reflections = 1,
-    includes = ["//frc971/control_loops:control_loops_fbs_includes"],
+    deps = ["//frc971/control_loops:control_loops_fbs"],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "drivetrain_goal_fbs",
     srcs = ["drivetrain_goal.fbs"],
-    gen_reflections = 1,
-    includes = [
-        ":spline_goal_fbs_includes",
-        "//frc971/control_loops:control_loops_fbs_includes",
+    deps = [
+        ":spline_goal_fbs",
+        "//frc971/control_loops:control_loops_fbs",
     ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "drivetrain_output_fbs",
     srcs = ["drivetrain_output.fbs"],
-    gen_reflections = 1,
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "drivetrain_position_fbs",
     srcs = ["drivetrain_position.fbs"],
-    gen_reflections = 1,
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "drivetrain_status_fbs",
     srcs = ["drivetrain_status.fbs"],
-    gen_reflections = 1,
-    includes = ["//frc971/control_loops:control_loops_fbs_includes"],
+    deps = ["//frc971/control_loops:control_loops_fbs"],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "trajectory_fbs",
     srcs = ["trajectory.fbs"],
-    gen_reflections = 1,
-    includes = ["//frc971/control_loops:control_loops_fbs_includes"],
+    deps = ["//frc971/control_loops:control_loops_fbs"],
 )
 
 cc_static_flatbuffer(
@@ -112,33 +105,29 @@
     cmd = "cat $(SRCS) | sed 's/double/float/g' > $(OUTS)",
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "drivetrain_goal_float_fbs",
     srcs = ["drivetrain_goal_float.fbs"],
-    gen_reflections = 1,
-    includes = [
-        ":spline_goal_fbs_includes",
-        "//frc971/control_loops:control_loops_fbs_includes",
+    deps = [
+        ":spline_goal_fbs",
+        "//frc971/control_loops:control_loops_fbs",
     ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "drivetrain_output_float_fbs",
     srcs = ["drivetrain_output_float.fbs"],
-    gen_reflections = 1,
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "drivetrain_position_float_fbs",
     srcs = ["drivetrain_position_float.fbs"],
-    gen_reflections = 1,
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "drivetrain_status_float_fbs",
     srcs = ["drivetrain_status_float.fbs"],
-    gen_reflections = 1,
-    includes = ["//frc971/control_loops:control_loops_fbs_includes"],
+    deps = ["//frc971/control_loops:control_loops_fbs"],
 )
 
 aos_config(
@@ -228,10 +217,9 @@
     ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "localizer_fbs",
     srcs = ["localizer.fbs"],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
 )
 
diff --git a/frc971/control_loops/drivetrain/localization/BUILD b/frc971/control_loops/drivetrain/localization/BUILD
index 06c8d57..7b86f09 100644
--- a/frc971/control_loops/drivetrain/localization/BUILD
+++ b/frc971/control_loops/drivetrain/localization/BUILD
@@ -1,4 +1,4 @@
-load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
+load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
 load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
 
 cc_library(
@@ -49,12 +49,11 @@
     ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "localizer_output_fbs",
     srcs = [
         "localizer_output.fbs",
     ],
-    gen_reflections = True,
     target_compatible_with = ["@platforms//os:linux"],
     visibility = ["//visibility:public"],
 )
diff --git a/frc971/control_loops/drivetrain/swerve/BUILD b/frc971/control_loops/drivetrain/swerve/BUILD
index 06ba36a..5b94fa8 100644
--- a/frc971/control_loops/drivetrain/swerve/BUILD
+++ b/frc971/control_loops/drivetrain/swerve/BUILD
@@ -1,15 +1,13 @@
-load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
+load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
 
 package(default_visibility = ["//visibility:public"])
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "swerve_drivetrain_output_fbs",
     srcs = ["swerve_drivetrain_output.fbs"],
-    gen_reflections = 1,
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "swerve_drivetrain_position_fbs",
     srcs = ["swerve_drivetrain_position.fbs"],
-    gen_reflections = 1,
 )
diff --git a/frc971/control_loops/flywheel/BUILD b/frc971/control_loops/flywheel/BUILD
index 6399abe..0cf5d00 100644
--- a/frc971/control_loops/flywheel/BUILD
+++ b/frc971/control_loops/flywheel/BUILD
@@ -1,12 +1,11 @@
-load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
+load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
 load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "flywheel_controller_status_fbs",
     srcs = [
         "flywheel_controller_status.fbs",
     ],
-    gen_reflections = 1,
     visibility = ["//visibility:public"],
 )
 
diff --git a/frc971/imu_reader/BUILD b/frc971/imu_reader/BUILD
index 4825900..cf2df44 100644
--- a/frc971/imu_reader/BUILD
+++ b/frc971/imu_reader/BUILD
@@ -1,4 +1,4 @@
-load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
+load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
 load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
 
 cc_library(
@@ -22,7 +22,7 @@
     ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "imu_failures_fbs",
     srcs = [
         "imu_failures.fbs",
diff --git a/frc971/input/BUILD b/frc971/input/BUILD
index 8515153..329dfce 100644
--- a/frc971/input/BUILD
+++ b/frc971/input/BUILD
@@ -1,5 +1,5 @@
+load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
 load("//aos:config.bzl", "aos_config")
-load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
 
 package(default_visibility = ["//visibility:public"])
 
@@ -90,17 +90,15 @@
     ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "robot_state_fbs",
     srcs = ["robot_state.fbs"],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "joystick_state_fbs",
     srcs = ["joystick_state.fbs"],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
 )
 
diff --git a/frc971/queues/BUILD b/frc971/queues/BUILD
index 17b610c..8d7563b 100644
--- a/frc971/queues/BUILD
+++ b/frc971/queues/BUILD
@@ -1,21 +1,19 @@
-load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
+load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
 
 package(default_visibility = ["//visibility:public"])
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "gyro_fbs",
     srcs = [
         "gyro.fbs",
     ],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "gyro_uid_fbs",
     srcs = [
         "gyro_uid.fbs",
     ],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
 )
diff --git a/frc971/vision/BUILD b/frc971/vision/BUILD
index 84f3be7..3c94b35 100644
--- a/frc971/vision/BUILD
+++ b/frc971/vision/BUILD
@@ -1,11 +1,11 @@
-load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_py_library")
+load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
+load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_py_library")
 load("//aos:config.bzl", "aos_config")
 load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "vision_fbs",
     srcs = ["vision.fbs"],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
     visibility = ["//visibility:public"],
 )
@@ -17,10 +17,9 @@
     visibility = ["//visibility:public"],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "calibration_fbs",
     srcs = ["calibration.fbs"],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
     visibility = ["//visibility:public"],
 )
@@ -146,10 +145,9 @@
     ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "target_map_fbs",
     srcs = ["target_map.fbs"],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
     visibility = ["//visibility:public"],
 )
diff --git a/frc971/wpilib/BUILD b/frc971/wpilib/BUILD
index ac9446e..1941a96 100644
--- a/frc971/wpilib/BUILD
+++ b/frc971/wpilib/BUILD
@@ -1,16 +1,15 @@
+load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
 load("//tools/build_rules:js.bzl", "ts_project")
-load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
 load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
 load("//aos:config.bzl", "aos_config")
 
 package(default_visibility = ["//visibility:public"])
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "logging_fbs",
     srcs = [
         "logging.fbs",
     ],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
 )
 
@@ -126,12 +125,11 @@
     ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "loop_output_handler_test_fbs",
     srcs = [
         "loop_output_handler_test.fbs",
     ],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
 )
 
@@ -229,12 +227,11 @@
     ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "pdp_values_fbs",
     srcs = [
         "pdp_values.fbs",
     ],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
 )
 
@@ -268,25 +265,23 @@
     ],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "imu_fbs",
     srcs = [
         "imu.fbs",
     ],
-    gen_reflections = 1,
     target_compatible_with = ["@platforms//os:linux"],
 )
 
-flatbuffer_cc_library(
+static_flatbuffer(
     name = "imu_batch_fbs",
     srcs = [
         "imu_batch.fbs",
     ],
-    gen_reflections = 1,
-    includes = [
-        ":imu_fbs_includes",
-    ],
     target_compatible_with = ["@platforms//os:linux"],
+    deps = [
+        ":imu_fbs",
+    ],
 )
 
 flatbuffer_ts_library(