[bazel] Clean up bazel scripts (#7984)

This commit is contained in:
PJ Reiniger
2025-06-13 23:53:09 -04:00
committed by GitHub
parent 5dfc664b93
commit fbbc4bc53c
54 changed files with 1774 additions and 854 deletions

View File

@@ -1,5 +1,6 @@
load("@rules_java//java:defs.bzl", "java_binary", "java_library")
load("//wpilibjExamples:example_projects.bzl", "COMMANDS_V2_FOLDERS", "EXAMPLES_FOLDERS", "SNIPPETS_FOLDERS", "TEMPLATES_FOLDERS")
load("//shared/bazel/rules:java_rules.bzl", "wpilib_java_junit5_test")
load("//wpilibjExamples:example_projects.bzl", "COMMANDS_V2_FOLDERS", "EXAMPLES_FOLDERS", "SNIPPETS_FOLDERS", "TEMPLATES_FOLDERS", "TEST_FOLDERS")
def build_examples(halsim_deps):
for folder in EXAMPLES_FOLDERS:
@@ -69,3 +70,20 @@ def build_templates():
],
tags = ["wpi-example"],
)
def build_tests():
for folder in TEST_FOLDERS:
wpilib_java_junit5_test(
name = folder + "-test",
srcs = native.glob(["src/test/java/edu/wpi/first/wpilibj/examples/" + folder + "/**/*.java"]),
deps = [
":" + folder + "-example",
"//hal:hal-java",
"//ntcore:networktables-java",
"//wpilibj:wpilibj",
"//wpilibNewCommands:wpilibNewCommands-java",
"//wpimath:wpimath-java",
"//wpiutil:wpiutil-java",
],
tags = ["wpi-example"],
)