mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[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:
17
BUILD.bazel
17
BUILD.bazel
@@ -85,12 +85,14 @@ publish_all(
|
||||
"//apriltag:apriltag-java_publish.publish",
|
||||
"//cameraserver:cameraserver-cpp_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-java_publish.publish",
|
||||
"//cscore:cscorejnicvstatic-cpp_publish.publish",
|
||||
"//datalog:datalog-cpp_publish.publish",
|
||||
"//datalog:datalog-java_publish.publish",
|
||||
"//tools/datalogtool:datalogtool_publish.publish",
|
||||
"//docs:wpilibj_publish.publish",
|
||||
"//epilogue-processor:processor-java_publish.publish",
|
||||
"//epilogue-runtime:epilogue-java_publish.publish",
|
||||
@@ -101,11 +103,10 @@ publish_all(
|
||||
"//glass:glassnt-cpp_publish.publish",
|
||||
"//hal:hal-java_publish.publish",
|
||||
"//hal:wpiHal-cpp_publish.publish",
|
||||
"//javacPlugin:javacPlugin_publish.publish",
|
||||
"//ntcore:ntcore-cpp_publish.publish",
|
||||
"//ntcore:ntcore-java_publish.publish",
|
||||
"//ntcoreffi:ntcoreffi-cpp_publish.publish",
|
||||
"//tools/outlineviewer:outlineviewer_publish.publish",
|
||||
"//tools/processstarter:processstarter_publish.publish",
|
||||
"//romiVendordep:romiVendordep-cpp_publish.publish",
|
||||
"//romiVendordep:romiVendordep-java_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_server:halsim_ws_server-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/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",
|
||||
"//wpiannotations:wpiannotations_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",
|
||||
"//wpilibcExamples:commands_publish.publish",
|
||||
"//wpilibcExamples:examples_publish.publish",
|
||||
|
||||
@@ -18,7 +18,7 @@ The first types are Java artifacts. These are usually published as `jar` files.
|
||||
|
||||
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.
|
||||
@@ -29,8 +29,8 @@ Native artifacts are published with the base artifact name as their artifact ID,
|
||||
|
||||
Example:
|
||||
```
|
||||
edu.wpi.first.wpimath:wpimath-cpp:version:classifier@zip
|
||||
edu.wpi.first.wpimath:wpimath-cpp:version:windowsx86-64staticdebug@zip
|
||||
org.wpilib.wpimath:wpimath-cpp:version:classifier@zip
|
||||
org.wpilib.wpimath:wpimath-cpp:version:windowsx86-64staticdebug@zip
|
||||
```
|
||||
|
||||
## 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.
|
||||
|
||||
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
|
||||
|
||||
@@ -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.
|
||||
|
||||
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
|
||||
* googletest
|
||||
|
||||
@@ -46,7 +46,7 @@ wpilib_java_library(
|
||||
srcs = glob(["src/main/java/**/*.java"]) + [":generated_java"],
|
||||
exported_plugins = ["//javacPlugin:plugin"],
|
||||
maven_artifact_name = "commands3-java",
|
||||
maven_group_id = "org.wpilib.commands3",
|
||||
maven_group_id = "org.wpilib",
|
||||
plugins = ["//javacPlugin:plugin"],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
|
||||
@@ -298,5 +298,5 @@ alias(
|
||||
package_shared_cc_project(
|
||||
name = "cscorejnicvstatic",
|
||||
maven_artifact_name = "cscore-jnicvstatic",
|
||||
maven_group_id = "edu.wpi.first.cscore",
|
||||
maven_group_id = "org.wpilib.cscore",
|
||||
)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Glass</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>edu.wpi.first.tools.Glass</string>
|
||||
<string>org.wpilib.tools.Glass</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>glass.icns</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
|
||||
@@ -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(
|
||||
name = "plugin",
|
||||
wpilib_java_library(
|
||||
name = "javacPlugin",
|
||||
srcs = glob(["src/main/java/**/*.java"]),
|
||||
maven_artifact_name = "wpilibj-javac-plugin-java",
|
||||
maven_group_id = "org.wpilib",
|
||||
resources = glob(["src/main/resources/**"]),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//wpiannotations",
|
||||
],
|
||||
)
|
||||
|
||||
java_plugin(
|
||||
name = "plugin",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
":javacPlugin",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -44,6 +44,8 @@ wpilib_cc_library(
|
||||
"//wpiutil:sigslot-hdrs-pkg",
|
||||
"//wpiutil:nanopb-hdrs-pkg",
|
||||
"//wpiutil:argparse-hdrs-pkg",
|
||||
"//wpiutil:upb-hdrs-pkg",
|
||||
"//wpiutil:double-conversion-hdrs-pkg",
|
||||
"//ntcore:ntcore-hdrs-pkg",
|
||||
"//ntcore:generated_cc-hdrs-pkg",
|
||||
],
|
||||
|
||||
@@ -55,8 +55,8 @@ class RobotContainer:
|
||||
def configureButtonBindings(self) -> None:
|
||||
"""Use this method to define your button->command mappings. Buttons can be created by
|
||||
instantiating a {GenericHID} or one of its subclasses
|
||||
({edu.wpi.first.wpilibj.Joystick} or {XboxController}), and then calling passing it to a
|
||||
{edu.wpi.first.wpilibj2.command.button.JoystickButton}.
|
||||
({org.wpilib.driverstation.Joystick} or {XboxController}), and then calling passing it to a
|
||||
{org.wpilib.command2.button.JoystickButton}.
|
||||
"""
|
||||
|
||||
def getAutonomousCommand(self) -> commands2.Command:
|
||||
|
||||
@@ -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
|
||||
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
|
||||
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.
|
||||
|
||||
|
||||
22
thirdparty/catch2/BUILD.bazel
vendored
22
thirdparty/catch2/BUILD.bazel
vendored
@@ -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(
|
||||
name = "catch2.static",
|
||||
wpilib_cc_library(
|
||||
name = "catch2",
|
||||
srcs = glob(["src/main/native/cpp/**"]),
|
||||
hdrs = glob(["src/main/native/include/**"]),
|
||||
include_license_files = True,
|
||||
includes = ["src/main/native/include"],
|
||||
strip_include_prefix = "src/main/native/include",
|
||||
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",
|
||||
)
|
||||
|
||||
2
thirdparty/catch2/publish.gradle
vendored
2
thirdparty/catch2/publish.gradle
vendored
@@ -1,7 +1,7 @@
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
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 outputsFolder = file("$project.buildDir/outputs")
|
||||
|
||||
2
thirdparty/googletest/BUILD.bazel
vendored
2
thirdparty/googletest/BUILD.bazel
vendored
@@ -28,5 +28,5 @@ wpilib_cc_static_library(
|
||||
package_static_cc_project(
|
||||
name = "googletest",
|
||||
maven_artifact_name = "googletest-cpp",
|
||||
maven_group_id = "edu.wpi.first.thirdparty.googletest",
|
||||
maven_group_id = "org.wpilib.thirdparty.googletest",
|
||||
)
|
||||
|
||||
2
thirdparty/googletest/publish.gradle
vendored
2
thirdparty/googletest/publish.gradle
vendored
@@ -1,7 +1,7 @@
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
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 outputsFolder = file("$project.buildDir/outputs")
|
||||
|
||||
2
thirdparty/imgui_suite/BUILD.bazel
vendored
2
thirdparty/imgui_suite/BUILD.bazel
vendored
@@ -491,5 +491,5 @@ package_static_cc_project(
|
||||
name = "imguiSuite",
|
||||
architectures = host_architectures,
|
||||
maven_artifact_name = "imguiSuite-cpp",
|
||||
maven_group_id = "edu.wpi.first.thirdparty.imguiSuite",
|
||||
maven_group_id = "org.wpilib.thirdparty.imguiSuite",
|
||||
)
|
||||
|
||||
2
thirdparty/imgui_suite/publish.gradle
vendored
2
thirdparty/imgui_suite/publish.gradle
vendored
@@ -1,7 +1,7 @@
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
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 outputsFolder = file("$project.buildDir/outputs")
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>datalogTool</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>edu.wpi.first.tools.datalogTool</string>
|
||||
<string>org.wpilib.tools.datalogTool</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>datalogtool.icns</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>OutlineViewer</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>edu.wpi.first.tools.OutlineViewer</string>
|
||||
<string>org.wpilib.tools.OutlineViewer</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>ov.icns</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>SysId</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>edu.wpi.first.tools.SysId</string>
|
||||
<string>org.wpilib.tools.SysId</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>sysid.icns</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>WPIcal</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>edu.wpi.first.tools.WPIcal</string>
|
||||
<string>org.wpilib.tools.WPIcal</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>wpical.icns</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
|
||||
@@ -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",
|
||||
srcs = glob(["src/main/java/**/*.java"]),
|
||||
maven_artifact_name = "annotations-java",
|
||||
maven_group_id = "org.wpilib",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [],
|
||||
)
|
||||
|
||||
@@ -157,6 +157,7 @@ third_party_cc_lib_helper(
|
||||
name = "upb",
|
||||
include_root = "src/main/native/thirdparty/upb/include",
|
||||
src_root = "src/main/native/thirdparty/upb/src",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
generate_resources(
|
||||
@@ -318,7 +319,7 @@ cc_test(
|
||||
":nanopb-test-headers",
|
||||
":wpiutil",
|
||||
":wpiutil-testlib",
|
||||
"//thirdparty/catch2:catch2.static",
|
||||
"//thirdparty/catch2",
|
||||
"//thirdparty/googletest",
|
||||
],
|
||||
)
|
||||
@@ -331,7 +332,7 @@ cc_test(
|
||||
deps = [
|
||||
":wpiutil",
|
||||
":wpiutil-testlib",
|
||||
"//thirdparty/catch2:catch2.static",
|
||||
"//thirdparty/catch2",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user