[build] Fixup maven publishing (#8753)

This primarily fixes up the bazel publishing to match the gradle
publishing again, as some new libraries were added but not hooked up to
the maven publishing.

During the process, I noticed that the 3rd party libraries (googletest,
catch2, and imgui_suite) were still getting published on the old
`edu.wpi` namespace. I tried to clean up all the other references to
that that I could. Note: opencv and libssh are handled outside
`allwpilib` so they need to be updated separately.
This commit is contained in:
PJ Reiniger
2026-04-11 16:52:43 -04:00
committed by GitHub
parent 9ea63c7fd6
commit c6f54e963c
21 changed files with 72 additions and 37 deletions

View File

@@ -85,12 +85,14 @@ publish_all(
"//apriltag:apriltag-java_publish.publish", "//apriltag:apriltag-java_publish.publish",
"//cameraserver:cameraserver-cpp_publish.publish", "//cameraserver:cameraserver-cpp_publish.publish",
"//cameraserver:cameraserver-java_publish.publish", "//cameraserver:cameraserver-java_publish.publish",
"//commandsv2:commandsv2-cpp_publish.publish",
"//commandsv2:commandsv2-java_publish.publish",
"//commandsv3:commandsv3-java_publish.publish",
"//cscore:cscore-cpp_publish.publish", "//cscore:cscore-cpp_publish.publish",
"//cscore:cscore-java_publish.publish", "//cscore:cscore-java_publish.publish",
"//cscore:cscorejnicvstatic-cpp_publish.publish", "//cscore:cscorejnicvstatic-cpp_publish.publish",
"//datalog:datalog-cpp_publish.publish", "//datalog:datalog-cpp_publish.publish",
"//datalog:datalog-java_publish.publish", "//datalog:datalog-java_publish.publish",
"//tools/datalogtool:datalogtool_publish.publish",
"//docs:wpilibj_publish.publish", "//docs:wpilibj_publish.publish",
"//epilogue-processor:processor-java_publish.publish", "//epilogue-processor:processor-java_publish.publish",
"//epilogue-runtime:epilogue-java_publish.publish", "//epilogue-runtime:epilogue-java_publish.publish",
@@ -101,11 +103,10 @@ publish_all(
"//glass:glassnt-cpp_publish.publish", "//glass:glassnt-cpp_publish.publish",
"//hal:hal-java_publish.publish", "//hal:hal-java_publish.publish",
"//hal:wpiHal-cpp_publish.publish", "//hal:wpiHal-cpp_publish.publish",
"//javacPlugin:javacPlugin_publish.publish",
"//ntcore:ntcore-cpp_publish.publish", "//ntcore:ntcore-cpp_publish.publish",
"//ntcore:ntcore-java_publish.publish", "//ntcore:ntcore-java_publish.publish",
"//ntcoreffi:ntcoreffi-cpp_publish.publish", "//ntcoreffi:ntcoreffi-cpp_publish.publish",
"//tools/outlineviewer:outlineviewer_publish.publish",
"//tools/processstarter:processstarter_publish.publish",
"//romiVendordep:romiVendordep-cpp_publish.publish", "//romiVendordep:romiVendordep-cpp_publish.publish",
"//romiVendordep:romiVendordep-java_publish.publish", "//romiVendordep:romiVendordep-java_publish.publish",
"//simulation/halsim_ds_socket:halsim_ds_socket-cpp_publish.publish", "//simulation/halsim_ds_socket:halsim_ds_socket-cpp_publish.publish",
@@ -114,14 +115,16 @@ publish_all(
"//simulation/halsim_ws_core:halsim_ws_core-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_ws_server:halsim_ws_server-cpp_publish.publish",
"//simulation/halsim_xrp:halsim_xrp-cpp_publish.publish", "//simulation/halsim_xrp:halsim_xrp-cpp_publish.publish",
"//tools/sysid:sysid_publish.publish", "//thirdparty/catch2:catch2-cpp_publish.publish",
"//thirdparty/googletest:googletest-cpp_publish.publish", "//thirdparty/googletest:googletest-cpp_publish.publish",
"//thirdparty/imgui_suite:imguiSuite-cpp_publish.publish", "//thirdparty/imgui_suite:imguiSuite-cpp_publish.publish",
"//tools/datalogtool:datalogtool_publish.publish",
"//tools/outlineviewer:outlineviewer_publish.publish",
"//tools/processstarter:processstarter_publish.publish",
"//tools/sysid:sysid_publish.publish",
"//tools/wpical:wpical_publish.publish", "//tools/wpical:wpical_publish.publish",
"//wpiannotations:wpiannotations_publish.publish",
"//wpigui:wpigui-cpp_publish.publish", "//wpigui:wpigui-cpp_publish.publish",
"//commandsv2:commandsv2-cpp_publish.publish",
"//commandsv2:commandsv2-java_publish.publish",
"//commandsv3:commandsv3-java_publish.publish",
"//wpilibc:wpilibc-cpp_publish.publish", "//wpilibc:wpilibc-cpp_publish.publish",
"//wpilibcExamples:commands_publish.publish", "//wpilibcExamples:commands_publish.publish",
"//wpilibcExamples:examples_publish.publish", "//wpilibcExamples:examples_publish.publish",

View File

@@ -18,7 +18,7 @@ The first types are Java artifacts. These are usually published as `jar` files.
Example: Example:
``` ```
edu.wpi.first.wpilibj:wpilibj-java:version org.wpilib.wpilibj:wpilibj-java:version
``` ```
The second types are native artifacts. These are usually published as `zip` files. The `-sources` and `-headers` classifiers contain the sources and headers respectively for the library. Each artifact also contains a classifier for each platform we publish. This platform is in the format `{os}{arch}`. The full list of supported platforms can be found in [native-utils](https://github.com/wpilibsuite/native-utils/blob/main/src/main/java/edu/wpi/first/nativeutils/WPINativeUtilsExtension.java#L94). If the library is built statically, it will have `static` appended to the classifier. Additionally, if the library was built in debug mode, `debug` will be appended to the classifier. The platform artifact only contains the binaries for a specific platform. Note that the binary artifacts never contain the headers, you always need the `-headers` classifier to get those. The second types are native artifacts. These are usually published as `zip` files. The `-sources` and `-headers` classifiers contain the sources and headers respectively for the library. Each artifact also contains a classifier for each platform we publish. This platform is in the format `{os}{arch}`. The full list of supported platforms can be found in [native-utils](https://github.com/wpilibsuite/native-utils/blob/main/src/main/java/edu/wpi/first/nativeutils/WPINativeUtilsExtension.java#L94). If the library is built statically, it will have `static` appended to the classifier. Additionally, if the library was built in debug mode, `debug` will be appended to the classifier. The platform artifact only contains the binaries for a specific platform. Note that the binary artifacts never contain the headers, you always need the `-headers` classifier to get those.
@@ -29,8 +29,8 @@ Native artifacts are published with the base artifact name as their artifact ID,
Example: Example:
``` ```
edu.wpi.first.wpimath:wpimath-cpp:version:classifier@zip org.wpilib.wpimath:wpimath-cpp:version:classifier@zip
edu.wpi.first.wpimath:wpimath-cpp:version:windowsx86-64staticdebug@zip org.wpilib.wpimath:wpimath-cpp:version:windowsx86-64staticdebug@zip
``` ```
## Provided Artifacts ## Provided Artifacts
@@ -38,7 +38,7 @@ This repository provides the following artifacts. Below each artifact is its dep
For C++, if building with static dependencies, the listed order should be the link order in your linker. For C++, if building with static dependencies, the listed order should be the link order in your linker.
All artifacts are based at `edu.wpi.first.artifactname` in the repository. All artifacts are based at `org.wpilib.halsim.artifactname` in the repository.
* wpiutil * wpiutil
@@ -128,7 +128,7 @@ All artifacts are based at `edu.wpi.first.artifactname` in the repository.
This repository provides the builds of the following third party software. This repository provides the builds of the following third party software.
All artifacts are based at `edu.wpi.first.thirdparty.frcYEAR` in the repository. All artifacts are based at `org.wpilib.thirdparty.frcYEAR` in the repository.
* apriltaglib * apriltaglib
* googletest * googletest

View File

@@ -46,7 +46,7 @@ wpilib_java_library(
srcs = glob(["src/main/java/**/*.java"]) + [":generated_java"], srcs = glob(["src/main/java/**/*.java"]) + [":generated_java"],
exported_plugins = ["//javacPlugin:plugin"], exported_plugins = ["//javacPlugin:plugin"],
maven_artifact_name = "commands3-java", maven_artifact_name = "commands3-java",
maven_group_id = "org.wpilib.commands3", maven_group_id = "org.wpilib",
plugins = ["//javacPlugin:plugin"], plugins = ["//javacPlugin:plugin"],
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [

View File

@@ -298,5 +298,5 @@ alias(
package_shared_cc_project( package_shared_cc_project(
name = "cscorejnicvstatic", name = "cscorejnicvstatic",
maven_artifact_name = "cscore-jnicvstatic", maven_artifact_name = "cscore-jnicvstatic",
maven_group_id = "edu.wpi.first.cscore", maven_group_id = "org.wpilib.cscore",
) )

View File

@@ -9,7 +9,7 @@
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>Glass</string> <string>Glass</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>edu.wpi.first.tools.Glass</string> <string>org.wpilib.tools.Glass</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>glass.icns</string> <string>glass.icns</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>

View File

@@ -1,11 +1,22 @@
load("@rules_java//java:defs.bzl", "java_plugin") load("@rules_java//java:java_plugin.bzl", "java_plugin")
load("//shared/bazel/rules:java_rules.bzl", "wpilib_java_library")
java_plugin( wpilib_java_library(
name = "plugin", name = "javacPlugin",
srcs = glob(["src/main/java/**/*.java"]), srcs = glob(["src/main/java/**/*.java"]),
maven_artifact_name = "wpilibj-javac-plugin-java",
maven_group_id = "org.wpilib",
resources = glob(["src/main/resources/**"]), resources = glob(["src/main/resources/**"]),
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//wpiannotations", "//wpiannotations",
], ],
) )
java_plugin(
name = "plugin",
visibility = ["//visibility:public"],
deps = [
":javacPlugin",
],
)

View File

@@ -44,6 +44,8 @@ wpilib_cc_library(
"//wpiutil:sigslot-hdrs-pkg", "//wpiutil:sigslot-hdrs-pkg",
"//wpiutil:nanopb-hdrs-pkg", "//wpiutil:nanopb-hdrs-pkg",
"//wpiutil:argparse-hdrs-pkg", "//wpiutil:argparse-hdrs-pkg",
"//wpiutil:upb-hdrs-pkg",
"//wpiutil:double-conversion-hdrs-pkg",
"//ntcore:ntcore-hdrs-pkg", "//ntcore:ntcore-hdrs-pkg",
"//ntcore:generated_cc-hdrs-pkg", "//ntcore:generated_cc-hdrs-pkg",
], ],

View File

@@ -55,8 +55,8 @@ class RobotContainer:
def configureButtonBindings(self) -> None: def configureButtonBindings(self) -> None:
"""Use this method to define your button->command mappings. Buttons can be created by """Use this method to define your button->command mappings. Buttons can be created by
instantiating a {GenericHID} or one of its subclasses instantiating a {GenericHID} or one of its subclasses
({edu.wpi.first.wpilibj.Joystick} or {XboxController}), and then calling passing it to a ({org.wpilib.driverstation.Joystick} or {XboxController}), and then calling passing it to a
{edu.wpi.first.wpilibj2.command.button.JoystickButton}. {org.wpilib.command2.button.JoystickButton}.
""" """
def getAutonomousCommand(self) -> commands2.Command: def getAutonomousCommand(self) -> commands2.Command:

View File

@@ -28,7 +28,7 @@ To build an extension for use in a robot project, you'll need to build with Grad
# Using a custom extension # Using a custom extension
After setting up a build.gradle file for a custom extension, follow the guides to build and publish your own local build of allwpilib. Once you've published a local build, follow the instructions in [DevelopmentBuilds.md](/DevelopmentBuilds.md) to use the locally published build in a robot project. Then, place this line your robot project's build.gradle file: After setting up a build.gradle file for a custom extension, follow the guides to build and publish your own local build of allwpilib. Once you've published a local build, follow the instructions in [DevelopmentBuilds.md](/DevelopmentBuilds.md) to use the locally published build in a robot project. Then, place this line your robot project's build.gradle file:
```groovy ```groovy
wpi.sim.addDep("Custom Sim Extension", "edu.wpi.first.halsim", "pluginName") wpi.sim.addDep("Custom Sim Extension", "org.wpilib.halsim", "pluginName")
``` ```
where `Custom Sim Extension` is the name of the extension shown by VS Code and `pluginName` is the same as `pluginName` declared in the build.gradle file for the simulation extension. where `Custom Sim Extension` is the name of the extension shown by VS Code and `pluginName` is the same as `pluginName` declared in the build.gradle file for the simulation extension.

View File

@@ -1,10 +1,26 @@
load("@rules_cc//cc:defs.bzl", "cc_library") load("//shared/bazel/rules:cc_rules.bzl", "wpilib_cc_library", "wpilib_cc_static_library")
load("//shared/bazel/rules:packaging.bzl", "package_static_cc_project")
cc_library( wpilib_cc_library(
name = "catch2.static", name = "catch2",
srcs = glob(["src/main/native/cpp/**"]), srcs = glob(["src/main/native/cpp/**"]),
hdrs = glob(["src/main/native/include/**"]), hdrs = glob(["src/main/native/include/**"]),
include_license_files = True,
includes = ["src/main/native/include"], includes = ["src/main/native/include"],
strip_include_prefix = "src/main/native/include", strip_include_prefix = "src/main/native/include",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )
wpilib_cc_static_library(
name = "static/catch2",
visibility = ["//visibility:public"],
deps = [
":catch2",
],
)
package_static_cc_project(
name = "catch2",
maven_artifact_name = "catch2-cpp",
maven_group_id = "org.wpilib.thirdparty.catch2",
)

View File

@@ -1,7 +1,7 @@
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
def baseArtifactId = 'catch2-cpp' def baseArtifactId = 'catch2-cpp'
def artifactGroupId = 'edu.wpi.first.thirdparty.catch2' def artifactGroupId = 'org.wpilib.thirdparty.catch2'
def zipBaseName = '_GROUP_edu_wpi_first_thirdparty_catch2_ID_catch2-cpp_CLS' def zipBaseName = '_GROUP_edu_wpi_first_thirdparty_catch2_ID_catch2-cpp_CLS'
def outputsFolder = file("$project.buildDir/outputs") def outputsFolder = file("$project.buildDir/outputs")

View File

@@ -28,5 +28,5 @@ wpilib_cc_static_library(
package_static_cc_project( package_static_cc_project(
name = "googletest", name = "googletest",
maven_artifact_name = "googletest-cpp", maven_artifact_name = "googletest-cpp",
maven_group_id = "edu.wpi.first.thirdparty.googletest", maven_group_id = "org.wpilib.thirdparty.googletest",
) )

View File

@@ -1,7 +1,7 @@
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
def baseArtifactId = 'googletest-cpp' def baseArtifactId = 'googletest-cpp'
def artifactGroupId = 'edu.wpi.first.thirdparty.googletest' def artifactGroupId = 'org.wpilib.thirdparty.googletest'
def zipBaseName = '_GROUP_edu_wpi_first_thirdparty_googletest_ID_googletest-cpp_CLS' def zipBaseName = '_GROUP_edu_wpi_first_thirdparty_googletest_ID_googletest-cpp_CLS'
def outputsFolder = file("$project.buildDir/outputs") def outputsFolder = file("$project.buildDir/outputs")

View File

@@ -491,5 +491,5 @@ package_static_cc_project(
name = "imguiSuite", name = "imguiSuite",
architectures = host_architectures, architectures = host_architectures,
maven_artifact_name = "imguiSuite-cpp", maven_artifact_name = "imguiSuite-cpp",
maven_group_id = "edu.wpi.first.thirdparty.imguiSuite", maven_group_id = "org.wpilib.thirdparty.imguiSuite",
) )

View File

@@ -1,7 +1,7 @@
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
def baseArtifactId = 'imguiSuite-cpp' def baseArtifactId = 'imguiSuite-cpp'
def artifactGroupId = 'edu.wpi.first.thirdparty.imguiSuite' def artifactGroupId = 'org.wpilib.thirdparty.imguiSuite'
def zipBaseName = '_GROUP_edu_wpi_first_thirdparty_imguiSuite_ID_imguiSuite-cpp_CLS' def zipBaseName = '_GROUP_edu_wpi_first_thirdparty_imguiSuite_ID_imguiSuite-cpp_CLS'
def outputsFolder = file("$project.buildDir/outputs") def outputsFolder = file("$project.buildDir/outputs")

View File

@@ -9,7 +9,7 @@
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>datalogTool</string> <string>datalogTool</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>edu.wpi.first.tools.datalogTool</string> <string>org.wpilib.tools.datalogTool</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>datalogtool.icns</string> <string>datalogtool.icns</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>

View File

@@ -9,7 +9,7 @@
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>OutlineViewer</string> <string>OutlineViewer</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>edu.wpi.first.tools.OutlineViewer</string> <string>org.wpilib.tools.OutlineViewer</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>ov.icns</string> <string>ov.icns</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>

View File

@@ -9,7 +9,7 @@
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>SysId</string> <string>SysId</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>edu.wpi.first.tools.SysId</string> <string>org.wpilib.tools.SysId</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>sysid.icns</string> <string>sysid.icns</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>

View File

@@ -9,7 +9,7 @@
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>WPIcal</string> <string>WPIcal</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>edu.wpi.first.tools.WPIcal</string> <string>org.wpilib.tools.WPIcal</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>wpical.icns</string> <string>wpical.icns</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>

View File

@@ -1,8 +1,10 @@
load("@rules_java//java:defs.bzl", "java_library") load("//shared/bazel/rules:java_rules.bzl", "wpilib_java_library")
java_library( wpilib_java_library(
name = "wpiannotations", name = "wpiannotations",
srcs = glob(["src/main/java/**/*.java"]), srcs = glob(["src/main/java/**/*.java"]),
maven_artifact_name = "annotations-java",
maven_group_id = "org.wpilib",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [], deps = [],
) )

View File

@@ -157,6 +157,7 @@ third_party_cc_lib_helper(
name = "upb", name = "upb",
include_root = "src/main/native/thirdparty/upb/include", include_root = "src/main/native/thirdparty/upb/include",
src_root = "src/main/native/thirdparty/upb/src", src_root = "src/main/native/thirdparty/upb/src",
visibility = ["//visibility:public"],
) )
generate_resources( generate_resources(
@@ -318,7 +319,7 @@ cc_test(
":nanopb-test-headers", ":nanopb-test-headers",
":wpiutil", ":wpiutil",
":wpiutil-testlib", ":wpiutil-testlib",
"//thirdparty/catch2:catch2.static", "//thirdparty/catch2",
"//thirdparty/googletest", "//thirdparty/googletest",
], ],
) )
@@ -331,7 +332,7 @@ cc_test(
deps = [ deps = [
":wpiutil", ":wpiutil",
":wpiutil-testlib", ":wpiutil-testlib",
"//thirdparty/catch2:catch2.static", "//thirdparty/catch2",
], ],
) )