Go to file
2024-12-07 14:45:05 -08:00
.github/workflows Various fixes (#45) 2024-12-07 14:09:48 -08:00
.vscode Initial Commit 2019-09-27 11:31:25 -07:00
.wpilib Update project year to intellisense 2023-09-11 09:49:35 -07:00
gradle/wrapper Upgrade to Gradle 8.11 (#44) 2024-12-02 18:51:05 -08:00
src Add JNI test support (#37) 2024-12-02 22:24:21 -08:00
.gitignore Initial Commit 2019-09-27 11:31:25 -07:00
build.gradle Upgrade to NativeUtils 2025.9.0 (#46) 2024-12-07 14:45:05 -08:00
config.gradle Various fixes (#45) 2024-12-07 14:09:48 -08:00
ExampleVendorJson.json Vendordep Templating. (#41) 2024-12-02 22:23:23 -08:00
gradlew Update vendor template for 2025 (#39) 2024-10-13 11:16:41 -07:00
gradlew.bat Update vendor template for 2025 (#39) 2024-10-13 11:16:41 -07:00
publish.gradle Vendordep Templating. (#41) 2024-12-02 22:23:23 -08:00
README.md Update vendor template for 2025 (#39) 2024-10-13 11:16:41 -07:00
settings.gradle Initial Commit 2019-09-27 11:31:25 -07:00

WPILib Vendor Template

This is the base WPILib vendor template for 2025.

Layout

The build is split into 3 libraries. A java library is built. This has access to all of wpilib, and also can JNI load the driver library.

A driver library is built. This should contain all low level code you want to access from both C++, Java and any other text based language. This will not work with LabVIEW. This library has access to the WPILib HAL and wpiutil. This library can only export C symbols. It cannot export C++ symbols at all, and all C symbols must be explicitly listed in the symbols.txt file in the driver folder. JNI symbols must be listed in this file as well. This library however can be written in C++. If you attempt to change this library to have access to all of wpilib, you will break JNI access and it will no longer work.

A native C++ library is built. This has access to all of wpilib, and access to the driver library. This should implment the standard wpilib interfaces.

Customizing

For Java, the library name will be the folder name the build is started from, so rename the folder to the name of your choosing.

For the native impl, you need to change the library name in the exportsConfigs block of build.gradle, the components block of build.gradle, and the taskList input array name in publish.gradle.

For the driver, change the library name in privateExportsConfigs, the driver name in components, and the driverTaskList input array name. In addition, you'll need to change the lib library in the native C++ impl component, and the JNI library name in the JNI java class.

For the maven artifact names, those are all in publish.gradle about 40 lines down.

Building and editing

This uses gradle, and uses the same base setup as a standard GradleRIO robot project. This means you build with ./gradlew build, and can install the native toolchain with ./gradlew installRoboRIOToolchain. If you open this project in VS Code with the wpilib extension installed, you will get intellisense set up for both C++ and Java.

By default, this template builds against the latest WPILib development build. To build against the last WPILib tagged release, build with ./gradlew build -PreleaseMode.