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/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(