Compare commits
10 Commits
74e7147c31
...
1599355b19
Author | SHA1 | Date | |
---|---|---|---|
|
1599355b19 | ||
|
ebbe7ed050 | ||
|
2ee0e066e0 | ||
|
20364e3fd3 | ||
|
e7a7440903 | ||
|
9419c4cf30 | ||
|
93767cf757 | ||
|
136fdda420 | ||
|
464d8b6acc | ||
|
3bfbd91270 |
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
@ -8,20 +8,20 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- container: wpilib/roborio-cross-ubuntu:2024-22.04
|
- container: wpilib/roborio-cross-ubuntu:2025-22.04
|
||||||
artifact-name: Athena
|
artifact-name: Athena
|
||||||
build-options: "-Ponlylinuxathena"
|
build-options: "-Ponlylinuxathena"
|
||||||
- container: wpilib/raspbian-cross-ubuntu:bullseye-22.04
|
- container: wpilib/raspbian-cross-ubuntu:bookworm-22.04
|
||||||
artifact-name: Arm32
|
artifact-name: Arm32
|
||||||
build-options: "-Ponlylinuxarm32"
|
build-options: "-Ponlylinuxarm32"
|
||||||
- container: wpilib/aarch64-cross-ubuntu:bullseye-22.04
|
- container: wpilib/aarch64-cross-ubuntu:bookworm-22.04
|
||||||
artifact-name: Arm64
|
artifact-name: Arm64
|
||||||
build-options: "-Ponlylinuxarm64"
|
build-options: "-Ponlylinuxarm64"
|
||||||
- container: wpilib/ubuntu-base:22.04
|
- container: wpilib/ubuntu-base:22.04
|
||||||
artifact-name: Linux
|
artifact-name: Linux
|
||||||
build-options: ""
|
build-options: ""
|
||||||
name: "Build - ${{ matrix.artifact-name }}"
|
name: "Build - ${{ matrix.artifact-name }}"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
container: ${{ matrix.container }}
|
container: ${{ matrix.container }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@ -40,7 +40,7 @@ jobs:
|
|||||||
|
|
||||||
build-host:
|
build-host:
|
||||||
env:
|
env:
|
||||||
MACOSX_DEPLOYMENT_TARGET: 13
|
MACOSX_DEPLOYMENT_TARGET: 13.3
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@ -50,7 +50,7 @@ jobs:
|
|||||||
architecture: x64
|
architecture: x64
|
||||||
- os: macos-14
|
- os: macos-14
|
||||||
artifact-name: macOS
|
artifact-name: macOS
|
||||||
architecture: x64
|
architecture: aarch64
|
||||||
name: "Build - ${{ matrix.artifact-name }}"
|
name: "Build - ${{ matrix.artifact-name }}"
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
@ -74,7 +74,7 @@ jobs:
|
|||||||
combine:
|
combine:
|
||||||
name: Combine
|
name: Combine
|
||||||
needs: [build-docker, build-host]
|
needs: [build-docker, build-host]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"fileName": "ExampleVendorJson.json",
|
"fileName": "ExampleVendorJson.json",
|
||||||
"name": "ExampleVendorDep",
|
"name": "ExampleVendorDep",
|
||||||
"version": "0.0.1",
|
"version": "${version}",
|
||||||
"frcYear": "2025",
|
"frcYear": "2025",
|
||||||
"uuid": "Generate A Unique GUID https://guidgenerator.com/online-guid-generator.aspx and insert it here", This line is to purposely make this fail to parse
|
"uuid": "Generate A Unique GUID https://guidgenerator.com/online-guid-generator.aspx and insert it here", This line is to purposely make this fail to parse
|
||||||
"mavenUrls": [
|
"mavenUrls": [
|
||||||
@ -10,21 +10,20 @@
|
|||||||
"jsonUrl": "InsertSomeUrlHere",
|
"jsonUrl": "InsertSomeUrlHere",
|
||||||
"javaDependencies": [
|
"javaDependencies": [
|
||||||
{
|
{
|
||||||
"groupId": "com.vendor.frc",
|
"groupId": "${groupId}",
|
||||||
"artifactId": "Vendor-java",
|
"artifactId": "${artifactId}-java",
|
||||||
"version": "0.0.1"
|
"version": "${version}"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"jniDependencies": [
|
"jniDependencies": [
|
||||||
{
|
{
|
||||||
"groupId": "com.vendor.frc",
|
"groupId": "${groupId}",
|
||||||
"artifactId": "Vendor-driver",
|
"artifactId": "${artifactId}-driver",
|
||||||
"version": "0.0.1",
|
"version": "${version}",
|
||||||
"skipInvalidPlatforms": true,
|
"skipInvalidPlatforms": true,
|
||||||
"isJar": false,
|
"isJar": false,
|
||||||
"validPlatforms": [
|
"validPlatforms": [
|
||||||
"windowsx86-64",
|
"windowsx86-64",
|
||||||
"windowsx86",
|
|
||||||
"linuxarm64",
|
"linuxarm64",
|
||||||
"linuxx86-64",
|
"linuxx86-64",
|
||||||
"linuxathena",
|
"linuxathena",
|
||||||
@ -35,16 +34,15 @@
|
|||||||
],
|
],
|
||||||
"cppDependencies": [
|
"cppDependencies": [
|
||||||
{
|
{
|
||||||
"groupId": "com.vendor.frc",
|
"groupId": "${groupId}",
|
||||||
"artifactId": "Vendor-cpp",
|
"artifactId": "${artifactId}-cpp",
|
||||||
"version": "0.0.1",
|
"version": "${version}",
|
||||||
"libName": "Vendor",
|
"libName": "Vendor",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": false,
|
"sharedLibrary": false,
|
||||||
"skipInvalidPlatforms": true,
|
"skipInvalidPlatforms": true,
|
||||||
"binaryPlatforms": [
|
"binaryPlatforms": [
|
||||||
"windowsx86-64",
|
"windowsx86-64",
|
||||||
"windowsx86",
|
|
||||||
"linuxarm64",
|
"linuxarm64",
|
||||||
"linuxx86-64",
|
"linuxx86-64",
|
||||||
"linuxathena",
|
"linuxathena",
|
||||||
@ -53,16 +51,15 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"groupId": "com.vendor.frc",
|
"groupId": "${groupId}",
|
||||||
"artifactId": "Vendor-driver",
|
"artifactId": "${artifactId}-driver",
|
||||||
"version": "0.0.1",
|
"version": "${version}",
|
||||||
"libName": "VendorDriver",
|
"libName": "VendorDriver",
|
||||||
"headerClassifier": "headers",
|
"headerClassifier": "headers",
|
||||||
"sharedLibrary": false,
|
"sharedLibrary": false,
|
||||||
"skipInvalidPlatforms": true,
|
"skipInvalidPlatforms": true,
|
||||||
"binaryPlatforms": [
|
"binaryPlatforms": [
|
||||||
"windowsx86-64",
|
"windowsx86-64",
|
||||||
"windowsx86",
|
|
||||||
"linuxarm64",
|
"linuxarm64",
|
||||||
"linuxx86-64",
|
"linuxx86-64",
|
||||||
"linuxathena",
|
"linuxathena",
|
||||||
|
75
build.gradle
75
build.gradle
@ -1,13 +1,18 @@
|
|||||||
|
import edu.wpi.first.toolchain.*
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'cpp'
|
id 'cpp'
|
||||||
id 'java'
|
id 'java'
|
||||||
id 'google-test'
|
id 'google-test'
|
||||||
id 'edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin' version '2020.2'
|
id 'edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin' version '2025.0'
|
||||||
id 'edu.wpi.first.NativeUtils' version '2025.3.0'
|
id 'edu.wpi.first.NativeUtils' version '2025.9.0'
|
||||||
id 'edu.wpi.first.GradleJni' version '1.1.0'
|
id 'edu.wpi.first.GradleJni' version '1.1.0'
|
||||||
id 'edu.wpi.first.GradleVsCode' version '2.1.0'
|
id 'edu.wpi.first.GradleVsCode' version '2.1.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WPILib Version
|
||||||
|
ext.wpilibVersion = "2025.+"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
@ -21,25 +26,55 @@ java {
|
|||||||
sourceCompatibility = JavaVersion.VERSION_17
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
targetCompatibility = JavaVersion.VERSION_17
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
}
|
}
|
||||||
|
var javaVersion = "17"
|
||||||
|
|
||||||
// Apply C++ configuration
|
// Apply C++ configuration
|
||||||
apply from: 'config.gradle'
|
apply from: 'config.gradle'
|
||||||
|
|
||||||
// Apply Java configuration
|
// Apply Java configuration
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'edu.wpi.first.cscore:cscore-java:2025.+'
|
implementation "edu.wpi.first.cscore:cscore-java:$wpilibVersion"
|
||||||
implementation 'edu.wpi.first.cameraserver:cameraserver-java:2025.+'
|
implementation "edu.wpi.first.cameraserver:cameraserver-java:$wpilibVersion"
|
||||||
implementation 'edu.wpi.first.ntcore:ntcore-java:2025.+'
|
implementation "edu.wpi.first.ntcore:ntcore-java:$wpilibVersion"
|
||||||
implementation 'edu.wpi.first.wpilibj:wpilibj-java:2025.+'
|
implementation "edu.wpi.first.wpilibj:wpilibj-java:$wpilibVersion"
|
||||||
implementation 'edu.wpi.first.wpiutil:wpiutil-java:2025.+'
|
implementation "edu.wpi.first.wpiutil:wpiutil-java:$wpilibVersion"
|
||||||
implementation 'edu.wpi.first.wpimath:wpimath-java:2025.+'
|
implementation "edu.wpi.first.wpimath:wpimath-java:$wpilibVersion"
|
||||||
implementation 'edu.wpi.first.wpiunits:wpiunits-java:2025.+'
|
implementation "edu.wpi.first.wpiunits:wpiunits-java:$wpilibVersion"
|
||||||
implementation 'edu.wpi.first.hal:hal-java:2025.+'
|
implementation "edu.wpi.first.hal:hal-java:$wpilibVersion"
|
||||||
implementation "org.ejml:ejml-simple:0.43.1"
|
implementation "org.ejml:ejml-simple:0.43.1"
|
||||||
implementation "com.fasterxml.jackson.core:jackson-annotations:2.15.2"
|
implementation "com.fasterxml.jackson.core:jackson-annotations:2.15.2"
|
||||||
implementation "com.fasterxml.jackson.core:jackson-core:2.15.2"
|
implementation "com.fasterxml.jackson.core:jackson-core:2.15.2"
|
||||||
implementation "com.fasterxml.jackson.core:jackson-databind:2.15.2"
|
implementation "com.fasterxml.jackson.core:jackson-databind:2.15.2"
|
||||||
implementation 'edu.wpi.first.thirdparty.frc2024.opencv:opencv-java:4.8.0-4'
|
implementation 'edu.wpi.first.thirdparty.frc2025.opencv:opencv-java:4.10.0-2'
|
||||||
|
|
||||||
|
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
|
||||||
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set up java tests
|
||||||
|
test {
|
||||||
|
useJUnitPlatform()
|
||||||
|
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
|
||||||
|
testLogging {
|
||||||
|
events "failed"
|
||||||
|
exceptionFormat "full"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (project.hasProperty('onlylinuxathena') || project.hasProperty('onlylinuxarm32') || project.hasProperty('onlylinuxarm64') || project.hasProperty('onlywindowsarm64') || project.hasProperty('onlylinuxsystemcore')) {
|
||||||
|
test.enabled = false
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs.add '-XDstringConcat=inline'
|
||||||
|
options.encoding = 'UTF-8'
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setup Javadocs to link back to WPILib docs
|
||||||
|
javadoc {
|
||||||
|
options {
|
||||||
|
links "https://docs.oracle.com/en/java/javase/$javaVersion/docs/api/", 'https://github.wpilib.org/allwpilib/docs/release/java/'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up exports properly
|
// Set up exports properly
|
||||||
@ -57,6 +92,12 @@ nativeUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ext.getCurrentArch = {
|
||||||
|
return NativePlatforms.desktop
|
||||||
|
}
|
||||||
|
|
||||||
|
def systemArch = getCurrentArch()
|
||||||
|
|
||||||
model {
|
model {
|
||||||
components {
|
components {
|
||||||
Vendor(NativeLibrarySpec) {
|
Vendor(NativeLibrarySpec) {
|
||||||
@ -110,6 +151,15 @@ model {
|
|||||||
|
|
||||||
binaries.all {
|
binaries.all {
|
||||||
lib library: 'VendorDriver', linkage: 'shared'
|
lib library: 'VendorDriver', linkage: 'shared'
|
||||||
|
|
||||||
|
def arch = it.targetPlatform.name
|
||||||
|
if (systemArch == arch && it.buildType.name == 'debug') {
|
||||||
|
def filePath = it.tasks.install.installDirectory.get().toString() + File.separatorChar + 'lib'
|
||||||
|
test.dependsOn it.tasks.install
|
||||||
|
test.systemProperty 'java.library.path', filePath
|
||||||
|
test.environment 'LD_LIBRARY_PATH', filePath
|
||||||
|
test.workingDir filePath
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nativeUtils.useRequiredLibrary(it, "wpilib_executable_shared", "googletest_static")
|
nativeUtils.useRequiredLibrary(it, "wpilib_executable_shared", "googletest_static")
|
||||||
@ -122,7 +172,6 @@ model {
|
|||||||
include '**/*.cpp'
|
include '**/*.cpp'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nativeUtils.useRequiredLibrary(it, "wpilib_executable_shared", "googletest_static")
|
nativeUtils.useRequiredLibrary(it, "wpilib_executable_shared", "googletest_static")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -131,5 +180,5 @@ model {
|
|||||||
apply from: 'publish.gradle'
|
apply from: 'publish.gradle'
|
||||||
|
|
||||||
wrapper {
|
wrapper {
|
||||||
gradleVersion '8.10.2'
|
gradleVersion '8.11'
|
||||||
}
|
}
|
||||||
|
@ -8,10 +8,10 @@ nativeUtils.withCrossLinuxArm64()
|
|||||||
nativeUtils {
|
nativeUtils {
|
||||||
wpi {
|
wpi {
|
||||||
configureDependencies {
|
configureDependencies {
|
||||||
wpiVersion = "2025.+"
|
wpiVersion = wpilibVersion
|
||||||
opencvYear = "frc2024"
|
opencvYear = "frc2025"
|
||||||
niLibVersion = "2025.0.0"
|
niLibVersion = "2025.0.0"
|
||||||
opencvVersion = "4.8.0-4"
|
opencvVersion = "4.10.0-2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
|
import org.apache.tools.ant.filters.FixCrLfFilter
|
||||||
|
import org.apache.tools.ant.filters.ReplaceTokens
|
||||||
|
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
|
|
||||||
ext.licenseFile = files("$rootDir/LICENSE.txt")
|
ext.licenseFile = files("$rootDir/LICENSE.txt")
|
||||||
|
|
||||||
|
def templateVendorFile = "ExampleVendorJson.json"
|
||||||
|
|
||||||
def pubVersion = '0.0.1'
|
def pubVersion = '0.0.1'
|
||||||
|
|
||||||
def outputsFolder = file("$buildDir/outputs")
|
def outputsFolder = file("$buildDir/outputs")
|
||||||
@ -127,6 +132,32 @@ task outputJavadocJar(type: Jar, dependsOn: javadoc) {
|
|||||||
from javadoc.destinationDir
|
from javadoc.destinationDir
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Apply template variables from the vendordep file.
|
||||||
|
// Replaces ${VARIABLE} with VARIABLE: value in expand()
|
||||||
|
task vendordepJson() {
|
||||||
|
description = 'Builds the vendordep json file.'
|
||||||
|
group = 'Build'
|
||||||
|
outputs.file("$buildDir/repos/$templateVendorFile")
|
||||||
|
|
||||||
|
copy {
|
||||||
|
from templateVendorFile
|
||||||
|
into "$buildDir/repos/"
|
||||||
|
expand(version: pubVersion,
|
||||||
|
groupId: artifactGroupId,
|
||||||
|
artifactId: baseArtifactId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task vendordepJsonZip(type: Zip) {
|
||||||
|
destinationDirectory = outputsFolder
|
||||||
|
archiveBaseName = "vendordepJson"
|
||||||
|
|
||||||
|
from("$buildDir/repos/$templateVendorFile") {
|
||||||
|
into '/'
|
||||||
|
}
|
||||||
|
dependsOn vendordepJson
|
||||||
|
}
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
archives sourcesJar
|
archives sourcesJar
|
||||||
archives javadocJar
|
archives javadocJar
|
||||||
@ -138,10 +169,12 @@ artifacts {
|
|||||||
addTaskToCopyAllOutputs(outputSourcesJar)
|
addTaskToCopyAllOutputs(outputSourcesJar)
|
||||||
addTaskToCopyAllOutputs(outputJavadocJar)
|
addTaskToCopyAllOutputs(outputJavadocJar)
|
||||||
addTaskToCopyAllOutputs(outputJar)
|
addTaskToCopyAllOutputs(outputJar)
|
||||||
|
addTaskToCopyAllOutputs(vendordepJsonZip)
|
||||||
|
|
||||||
build.dependsOn outputSourcesJar
|
build.dependsOn outputSourcesJar
|
||||||
build.dependsOn outputJavadocJar
|
build.dependsOn outputJavadocJar
|
||||||
build.dependsOn outputJar
|
build.dependsOn outputJar
|
||||||
|
build.dependsOn vendordepJsonZip
|
||||||
|
|
||||||
libraryBuild.dependsOn build
|
libraryBuild.dependsOn build
|
||||||
|
|
||||||
@ -200,6 +233,14 @@ model {
|
|||||||
groupId artifactGroupId
|
groupId artifactGroupId
|
||||||
version pubVersion
|
version pubVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vendordep(MavenPublication) {
|
||||||
|
artifact vendordepJsonZip
|
||||||
|
|
||||||
|
artifactId = "${baseArtifactId}-vendordep"
|
||||||
|
groupId artifactGroupId
|
||||||
|
version pubVersion
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
11
src/test/java/com/vendor/jni/VendorJNITest.java
vendored
Normal file
11
src/test/java/com/vendor/jni/VendorJNITest.java
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package com.vendor.jni;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
public class VendorJNITest {
|
||||||
|
@Test
|
||||||
|
void jniLinkTest() {
|
||||||
|
// Test to verify that the JNI test link works correctly.
|
||||||
|
VendorJNI.initialize();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user