mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Currently the major DataLog backend API (reading and writing) is split between wpiutil and glass. In the interest of allowing code that wants to use these APIs to not need to link to glass and declutter wpiutil, all of those APIs are moved to a new library named "datalog". Signed-off-by: Jade Turner <spacey-sooty@proton.me> Co-authored-by: Jade Turner <spacey-sooty@proton.me> Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
124 lines
3.1 KiB
Python
124 lines
3.1 KiB
Python
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
|
|
load("@rules_java//java:defs.bzl", "java_binary")
|
|
load("//shared/bazel/rules:java_rules.bzl", "wpilib_java_junit5_test")
|
|
load("//shared/bazel/rules:jni_rules.bzl", "wpilib_jni_cc_library", "wpilib_jni_java_library")
|
|
|
|
cc_library(
|
|
name = "generated_cc_headers",
|
|
hdrs = glob(["src/generated/main/native/include/**"]),
|
|
includes = ["src/generated/main/native/include"],
|
|
strip_include_prefix = "src/generated/main/native/include",
|
|
visibility = ["//ntcore:__subpackages__"],
|
|
)
|
|
|
|
filegroup(
|
|
name = "generated_cc_source",
|
|
srcs = glob(
|
|
["src/generated/main/native/cpp/**"],
|
|
exclude = ["src/generated/main/native/cpp/jni/**"],
|
|
),
|
|
visibility = ["//ntcore:__subpackages__"],
|
|
)
|
|
|
|
filegroup(
|
|
name = "generated_jni",
|
|
srcs = glob(["src/generated/main/native/cpp/jni/**"]),
|
|
visibility = ["//ntcore:__subpackages__"],
|
|
)
|
|
|
|
filegroup(
|
|
name = "generated_java",
|
|
srcs = glob(["src/generated/main/java/**/*.java"]),
|
|
visibility = ["//ntcore:__subpackages__"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "ntcore.static",
|
|
srcs = glob(
|
|
["src/main/native/cpp/**"],
|
|
exclude = ["src/main/native/cpp/jni/**"],
|
|
) + [":generated_cc_source"],
|
|
hdrs = glob(["src/main/native/include/**/*"]),
|
|
includes = [
|
|
"src/main/native/cpp",
|
|
"src/main/native/include",
|
|
],
|
|
strip_include_prefix = "src/main/native/include",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":generated_cc_headers",
|
|
"//datalog:datalog.static",
|
|
"//wpinet:wpinet.static",
|
|
"//wpiutil:wpiutil.static",
|
|
],
|
|
)
|
|
|
|
wpilib_jni_cc_library(
|
|
name = "ntcorejni",
|
|
srcs = glob(["src/main/native/cpp/jni/**"]) + [":generated_jni"],
|
|
java_dep = ":networktables-java",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":ntcore.static",
|
|
],
|
|
)
|
|
|
|
wpilib_jni_java_library(
|
|
name = "networktables-java",
|
|
srcs = glob(["src/main/java/**/*.java"]) + [":generated_java"],
|
|
native_libs = [":ntcorejni"],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//datalog:datalog-java",
|
|
"//wpiutil:wpiutil-java",
|
|
"@maven//:us_hebi_quickbuf_quickbuf_runtime",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "ntcore-cpp-test",
|
|
size = "small",
|
|
srcs = glob([
|
|
"src/test/native/**/*.cpp",
|
|
"src/test/native/**/*.h",
|
|
]),
|
|
tags = [
|
|
"exclusive",
|
|
"no-asan",
|
|
"no-tsan",
|
|
],
|
|
deps = [
|
|
":ntcore.static",
|
|
"//thirdparty/googletest:googletest.static",
|
|
"//wpiutil:wpiutil-testlib",
|
|
],
|
|
)
|
|
|
|
wpilib_java_junit5_test(
|
|
name = "ntcore-java-test",
|
|
srcs = glob(["src/test/java/**/*.java"]),
|
|
tags = ["exclusive"],
|
|
deps = [
|
|
":networktables-java",
|
|
"//wpiutil:wpiutil-java",
|
|
],
|
|
)
|
|
|
|
cc_binary(
|
|
name = "DevMain-Cpp",
|
|
srcs = ["src/dev/native/cpp/main.cpp"],
|
|
deps = [
|
|
":ntcore.static",
|
|
],
|
|
)
|
|
|
|
java_binary(
|
|
name = "DevMain-Java",
|
|
srcs = ["src/dev/java/edu/wpi/first/ntcore/DevMain.java"],
|
|
main_class = "edu.wpi.first.ntcore.DevMain",
|
|
deps = [
|
|
"networktables-java",
|
|
"//wpiutil:wpiutil-java",
|
|
],
|
|
)
|