mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
The framework fundamentally relies on the continuation API added in Java 21 (which is currently internal to the JDK). Continuations allow for call stacks to be saved to the heap and resumed later. The async framework allows command bodies to be written in an imperative style. However, an async command will need to be actively cooperative and periodically call coroutine.yield() in loops to yield control back to the command scheduler to let it process other commands. There are also some other additions like priority levels (as opposed to a blanket yes/no for ignoring incoming commands), factories requiring names be provided for commands, and the scheduler tracking all running commands and not just the highest-level groups. However, those changes aren't unique to an async framework, and could just as easily be used in a traditional command framework.
129 lines
5.3 KiB
Python
129 lines
5.3 KiB
Python
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files")
|
|
load("@rules_pkg//:mappings.bzl", "pkg_files")
|
|
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
|
|
load("//shared/bazel/rules:publishing.bzl", "publish_all")
|
|
|
|
exports_files([
|
|
"LICENSE.md",
|
|
"ThirdPartyNotices.txt",
|
|
])
|
|
|
|
pkg_files(
|
|
name = "license_pkg_files",
|
|
srcs = [
|
|
"LICENSE.md",
|
|
"ThirdPartyNotices.txt",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
# bazel build //:requirements.lock
|
|
compile_pip_requirements(
|
|
name = "requirements",
|
|
extra_args = ["--allow-unsafe"],
|
|
requirements_in = "requirements.txt",
|
|
requirements_txt = "requirements_lock.txt",
|
|
requirements_windows = "//:requirements_windows_lock.txt",
|
|
# compile_pip_requirements does not respect target_compatible_with for some of the targets it generates under the hood
|
|
tags = ["no-systemcore"],
|
|
)
|
|
|
|
alias(
|
|
name = "quickbuf_protoc",
|
|
actual = select({
|
|
"@platforms//os:windows": "@quickbuffer_protoc_windows//file",
|
|
"@rules_bzlmodrio_toolchains//conditions:osx_aarch64": "@quickbuffer_protoc_osx_aarch64//file",
|
|
"@rules_bzlmodrio_toolchains//conditions:osx_x86_64": "@quickbuffer_protoc_osx_x86-64//file",
|
|
"@rules_bzlmodrio_toolchains//constraints/combined:is_linux": "@quickbuffer_protoc_linux//file",
|
|
}),
|
|
tags = ["pregeneration"],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
# This is a helper to run all of the pregeneration scripts at once.
|
|
write_source_files(
|
|
name = "write_all",
|
|
additional_update_targets = [
|
|
"//hal:write_hal",
|
|
"//ntcore:write_ntcore",
|
|
"//wpilibc:write_wpilibc",
|
|
"//wpilibcExamples:write_example_project_list",
|
|
"//wpilibj:write_wpilibj",
|
|
"//wpilibjExamples:write_example_project_list",
|
|
"//wpilibNewCommands:write_wpilib_new_commands",
|
|
"//commandsv3:write_commandsv3",
|
|
"//wpimath:write_wpimath",
|
|
"//wpiunits:write_wpiunits",
|
|
"//wpiutil:write_wpiutil",
|
|
],
|
|
tags = ["pregeneration"],
|
|
)
|
|
|
|
publish_all(
|
|
name = "publish",
|
|
targets = [
|
|
"//apriltag:apriltag-cpp_publish.publish",
|
|
"//apriltag:apriltag-java_publish.publish",
|
|
"//cameraserver:cameraserver-cpp_publish.publish",
|
|
"//cameraserver:cameraserver-java_publish.publish",
|
|
"//cscore:cscore-cpp_publish.publish",
|
|
"//cscore:cscore-java_publish.publish",
|
|
"//datalog:datalog-cpp_publish.publish",
|
|
"//datalog:datalog-java_publish.publish",
|
|
"//datalogtool:datalogtool_publish.publish",
|
|
"//docs:wpilibj_publish.publish",
|
|
"//epilogue-processor:processor-java_publish.publish",
|
|
"//epilogue-runtime:epilogue-java_publish.publish",
|
|
"//fieldImages:fieldImages-cpp_publish.publish",
|
|
"//fieldImages:fieldImages-java_publish.publish",
|
|
"//glass:glass-cpp_publish.publish",
|
|
"//glass:glassapp_publish.publish",
|
|
"//glass:glassnt-cpp_publish.publish",
|
|
"//hal:hal-java_publish.publish",
|
|
"//hal:wpiHal-cpp_publish.publish",
|
|
"//ntcore:ntcore-cpp_publish.publish",
|
|
"//ntcore:ntcore-java_publish.publish",
|
|
"//ntcoreffi:ntcoreffi-cpp_publish.publish",
|
|
"//outlineviewer:outlineviewer_publish.publish",
|
|
"//processstarter:processstarter_publish.publish",
|
|
"//romiVendordep:romiVendordep-cpp_publish.publish",
|
|
"//romiVendordep:romiVendordep-java_publish.publish",
|
|
"//simulation/halsim_ds_socket:halsim_ds_socket-cpp_publish.publish",
|
|
"//simulation/halsim_gui:halsim_gui-cpp_publish.publish",
|
|
"//simulation/halsim_ws_client:halsim_ws_client-cpp_publish.publish",
|
|
"//simulation/halsim_ws_core:halsim_ws_core-cpp_publish.publish",
|
|
"//simulation/halsim_ws_server:halsim_ws_server-cpp_publish.publish",
|
|
"//simulation/halsim_xrp:halsim_xrp-cpp_publish.publish",
|
|
"//sysid:sysid_publish.publish",
|
|
"//thirdparty/googletest:googletest-cpp_publish.publish",
|
|
"//thirdparty/imgui_suite:imguiSuite-cpp_publish.publish",
|
|
"//wpical:wpical_publish.publish",
|
|
"//wpigui:wpigui-cpp_publish.publish",
|
|
"//wpilibNewCommands:wpilibNewCommands-cpp_publish.publish",
|
|
"//wpilibNewCommands:wpilibNewCommands-java_publish.publish",
|
|
"//commandsv3:commandsv3-java_publish.publish",
|
|
"//wpilibc:wpilibc-cpp_publish.publish",
|
|
"//wpilibcExamples:commands_publish.publish",
|
|
"//wpilibcExamples:examples_publish.publish",
|
|
"//wpilibcExamples:templates_publish.publish",
|
|
"//wpilibj:wpilibj-java_publish.publish",
|
|
"//wpilibjExamples:commands_publish.publish",
|
|
"//wpilibjExamples:examples_publish.publish",
|
|
"//wpilibjExamples:templates_publish.publish",
|
|
"//wpimath:wpimath-cpp_publish.publish",
|
|
"//wpimath:wpimath-java_publish.publish",
|
|
"//wpinet:wpinet-cpp_publish.publish",
|
|
"//wpinet:wpinet-java_publish.publish",
|
|
"//wpiunits:wpiunits-java_publish.publish",
|
|
"//wpiutil:wpiutil-cpp_publish.publish",
|
|
"//wpiutil:wpiutil-java_publish.publish",
|
|
"//xrpVendordep:xrpVendordep-cpp_publish.publish",
|
|
"//xrpVendordep:xrpVendordep-java_publish.publish",
|
|
] + select({
|
|
"@platforms//cpu:x86_64": [
|
|
"//docs:wpilibc_publish.publish",
|
|
],
|
|
"//conditions:default": [],
|
|
}),
|
|
)
|