Files
allwpilib/wpilibjExamples/BUILD.bazel
PJ Reiniger f8de482385 [bazel] Update toolchains to 2027-1 (#9016)
This updates to the 2027-1 toolchains. This also is the first version
with the `rules_bzlmodrio_toolchains -> wpilib_toolchains` rename, so
the surface area of the change is a little bit big.

The opencv dep has bzlmod'ified as part of this as well.
2026-06-26 22:44:00 -07:00

71 lines
2.0 KiB
Python

load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_file")
load("@rules_jvm_external//:defs.bzl", "maven_export")
load("@rules_python//python:defs.bzl", "py_binary")
load("//wpilibjExamples:build_java_examples.bzl", "build_commands", "build_examples", "build_snippets", "build_templates", "build_tests")
py_binary(
name = "generate_bazel_files",
srcs = ["generate_bazel_files.py"],
target_compatible_with = select({
"@wpilib_toolchains//constraints/is_systemcore:systemcore": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
)
genrule(
name = "generate_bazel_files_rule",
srcs = [
"src/main/java/org/wpilib/commands/commands.json",
"src/main/java/org/wpilib/examples/examples.json",
"src/main/java/org/wpilib/snippets/snippets.json",
"src/main/java/org/wpilib/templates/templates.json",
],
outs = ["gen/example_projects.bzl"],
cmd = "$(locations :generate_bazel_files) $(OUTS)",
tools = [":generate_bazel_files"],
)
write_source_file(
name = "write_example_project_list",
diff_args = ["-u"],
in_file = ":generate_bazel_files_rule",
out_file = "example_projects.bzl",
suggested_update_target = "//:write_all",
tags = ["pregeneration"],
visibility = ["//visibility:public"],
)
halsim_deps = [
]
build_commands()
build_examples(halsim_deps = halsim_deps)
build_snippets()
build_templates()
build_tests()
maven_export(
name = "examples_publish",
maven_coordinates = "org.wpilib.wpilibj:examples:$(WPILIB_VERSION)",
target = ":examples-zip",
visibility = ["//visibility:public"],
)
maven_export(
name = "commands_publish",
maven_coordinates = "org.wpilib.wpilibj:commands:$(WPILIB_VERSION)",
target = ":commands-zip",
visibility = ["//visibility:public"],
)
maven_export(
name = "templates_publish",
maven_coordinates = "org.wpilib.wpilibj:templates:$(WPILIB_VERSION)",
target = ":templates-zip",
visibility = ["//visibility:public"],
)