[bazel] Create better static libraries and add basic publishing (#8029)

This commit is contained in:
PJ Reiniger
2025-06-27 19:36:12 -04:00
committed by GitHub
parent 22b58c1853
commit e13d237390
38 changed files with 1445 additions and 216 deletions

View File

@@ -1,9 +1,9 @@
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_test")
load("@rules_java//java:defs.bzl", "java_binary", "java_library")
load("//shared/bazel/rules:cc_rules.bzl", "wpilib_cc_library")
load("//shared/bazel/rules:cc_rules.bzl", "wpilib_cc_library", "wpilib_cc_static_library")
wpilib_cc_library(
name = "romi-cpp.static",
name = "romiVendordep",
srcs = glob([
"src/main/native/cpp/**",
]),
@@ -11,17 +11,32 @@ wpilib_cc_library(
strip_include_prefix = "src/main/native/include",
visibility = ["//visibility:public"],
deps = [
"//wpilibc:wpilibc.static",
"//ntcore",
"//wpilibc",
"//wpinet",
],
)
wpilib_cc_static_library(
name = "static/romiVendordep",
static_deps = [
"//ntcore:static/ntcore",
"//wpilibc:static/wpilibc",
"//wpinet:static/wpinet",
],
visibility = ["//visibility:public"],
deps = [
":romiVendordep",
],
)
java_library(
name = "romi-java",
name = "romiVendordep-java",
srcs = glob(["src/main/java/**/*.java"]),
visibility = ["//visibility:public"],
deps = [
"//hal:hal-java",
"//wpilibj",
"//wpilibj:wpilibj-java",
],
)
@@ -30,7 +45,8 @@ cc_test(
size = "small",
srcs = glob(["src/test/native/cpp/**"]),
deps = [
"//thirdparty/googletest:googletest.static",
":romiVendordep",
"//thirdparty/googletest",
],
)
@@ -38,7 +54,7 @@ cc_binary(
name = "DevMain-Cpp",
srcs = ["src/dev/native/cpp/main.cpp"],
deps = [
":romi-cpp.static",
":romiVendordep",
],
)
@@ -48,7 +64,7 @@ java_binary(
main_class = "edu.wpi.first.wpilibj.romi.DevMain",
deps = [
"//hal:hal-java",
"//ntcore:networktables-java",
"//ntcore:ntcore-java",
"//wpiutil:wpiutil-java",
],
)