diff --git a/build.gradle b/build.gradle index fa56700..b4eac5c 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id 'cpp' id 'java' id 'edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin' version '2020.2' - id 'edu.wpi.first.NativeUtils' version '2024.7.0' + id 'edu.wpi.first.NativeUtils' version '2025.3.0' id 'edu.wpi.first.GradleJni' version '1.1.0' id 'edu.wpi.first.GradleVsCode' version '2.1.0' } @@ -24,14 +24,14 @@ apply from: 'config.gradle' // Apply Java configuration dependencies { - implementation 'edu.wpi.first.cscore:cscore-java:2024.+' - implementation 'edu.wpi.first.cameraserver:cameraserver-java:2024.+' - implementation 'edu.wpi.first.ntcore:ntcore-java:2024.+' - implementation 'edu.wpi.first.wpilibj:wpilibj-java:2024.+' - implementation 'edu.wpi.first.wpiutil:wpiutil-java:2024.+' - implementation 'edu.wpi.first.wpimath:wpimath-java:2024.+' - implementation 'edu.wpi.first.wpiunits:wpiunits-java:2024.+' - implementation 'edu.wpi.first.hal:hal-java:2024.+' + implementation 'edu.wpi.first.cscore:cscore-java:2025.+' + implementation 'edu.wpi.first.cameraserver:cameraserver-java:2025.+' + implementation 'edu.wpi.first.ntcore:ntcore-java:2025.+' + implementation 'edu.wpi.first.wpilibj:wpilibj-java:2025.+' + implementation 'edu.wpi.first.wpiutil:wpiutil-java:2025.+' + implementation 'edu.wpi.first.wpimath:wpimath-java:2025.+' + implementation 'edu.wpi.first.wpiunits:wpiunits-java:2025.+' + implementation 'edu.wpi.first.hal:hal-java:2025.+' implementation "org.ejml:ejml-simple:0.43.1" implementation "com.fasterxml.jackson.core:jackson-annotations:2.12.4" implementation "com.fasterxml.jackson.core:jackson-core:2.12.4" @@ -49,7 +49,7 @@ nativeUtils { nativeDependencyContainer { libgrapplefrcdriver(getNativeDependencyTypeClass('WPISharedMavenDependency')) { - version = "2024.3.1" + version = "2025.0.0" groupId = "au.grapplerobotics" artifactId = "libgrapplefrcdriver" ext = "zip" diff --git a/config.gradle b/config.gradle index ea621e1..05e8c41 100644 --- a/config.gradle +++ b/config.gradle @@ -8,10 +8,10 @@ nativeUtils.withCrossLinuxArm64() nativeUtils { wpi { configureDependencies { - wpiVersion = "2024.+" - opencvYear = "frc2024" - googleTestYear = "frc2024" - niLibVersion = "2024.2.1" + wpiVersion = "2025.+" + opencvYear = "frc2025" + googleTestYear = "frc2025" + niLibVersion = "2025.0.0" opencvVersion = "4.8.0-2" googleTestVersion = "1.14.0-1" } diff --git a/depjson/libgrapplefrc2025.json b/depjson/libgrapplefrc2025.json new file mode 100644 index 0000000..04e9af2 --- /dev/null +++ b/depjson/libgrapplefrc2025.json @@ -0,0 +1,72 @@ +{ + "fileName": "libgrapplefrc2024.json", + "name": "libgrapplefrc", + "version": "2025.0.0", + "frcYear": "2024", + "uuid": "8ef3423d-9532-4665-8339-206dae1d7168", + "mavenUrls": [ "https://storage.googleapis.com/grapple-frc-maven" ], + "jsonUrl": "https://storage.googleapis.com/grapple-frc-maven/libgrapplefrc2024.json", + "javaDependencies": [ + { + "groupId": "au.grapplerobotics", + "artifactId": "libgrapplefrcjava", + "version": "2025.0.0" + } + ], + "jniDependencies": [ + { + "groupId": "au.grapplerobotics", + "artifactId": "libgrapplefrcdriver", + "version": "2025.0.0", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "windowsx86", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + } + ], + "cppDependencies": [ + { + "groupId": "au.grapplerobotics", + "artifactId": "libgrapplefrccpp", + "version": "2025.0.0", + "libName": "grapplefrc", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "windowsx86", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "au.grapplerobotics", + "artifactId": "libgrapplefrcdriver", + "version": "2025.0.0", + "libName": "grapplefrcdriver", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "windowsx86", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + } + ] +} diff --git a/grapplefrcdriver/Cargo.lock b/grapplefrcdriver/Cargo.lock index 71a2a6c..42395bb 100644 --- a/grapplefrcdriver/Cargo.lock +++ b/grapplefrcdriver/Cargo.lock @@ -611,7 +611,7 @@ dependencies = [ [[package]] name = "grapplefrcdriver" -version = "2024.3.1" +version = "2025.0.0" dependencies = [ "anyhow", "bindgen", diff --git a/grapplefrcdriver/Cargo.toml b/grapplefrcdriver/Cargo.toml index ee3bbc6..e86734a 100644 --- a/grapplefrcdriver/Cargo.toml +++ b/grapplefrcdriver/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "grapplefrcdriver" -version = "2024.3.1" +version = "2025.0.0" edition = "2021" include = [ diff --git a/grapplefrcdriver/build.py b/grapplefrcdriver/build.py index 0e96737..8f31f73 100644 --- a/grapplefrcdriver/build.py +++ b/grapplefrcdriver/build.py @@ -6,7 +6,7 @@ NEW_PATH = os.getenv("PATH") + ";" + os.path.expanduser("~/.gradle/toolchains/frc/2024/roborio/bin") # TODO: Load from cargo metadata -VERSION = "2024.3.1" +VERSION = "2025.0.0" def run(*cmd): env = os.environ.copy() diff --git a/publish.gradle b/publish.gradle index 1170cd2..354ec23 100644 --- a/publish.gradle +++ b/publish.gradle @@ -2,7 +2,7 @@ apply plugin: 'maven-publish' ext.licenseFile = files("$rootDir/LICENSE.txt") -def pubVersion = '2024.3.1' +def pubVersion = '2025.0.0' def outputsFolder = file("$buildDir/outputs") diff --git a/src/main/java/au/grapplerobotics/GrappleJNI.java b/src/main/java/au/grapplerobotics/GrappleJNI.java index 525f224..4666bde 100644 --- a/src/main/java/au/grapplerobotics/GrappleJNI.java +++ b/src/main/java/au/grapplerobotics/GrappleJNI.java @@ -1,16 +1,12 @@ package au.grapplerobotics; -import java.io.IOException; import java.util.concurrent.atomic.AtomicBoolean; import java.lang.ref.Cleaner; -import edu.wpi.first.util.RuntimeLoader; - public class GrappleJNI { public static final Cleaner cleaner = Cleaner.create(); static boolean libraryLoaded = false; - static RuntimeLoader loader = null; public static class Helper { private static AtomicBoolean extractOnStaticLoad = new AtomicBoolean(true); @@ -27,10 +23,11 @@ public static void setExtractOnStaticLoad(boolean load) { static { if (Helper.getExtractOnStaticLoad()) { try { - // RuntimeLoader.loadLibrary("grapplefrcdriver"); - loader = new RuntimeLoader<>("grapplefrcdriver", RuntimeLoader.getDefaultExtractionRoot(), GrappleJNI.class); - loader.loadLibrary(); - } catch (IOException ex) { + System.loadLibrary("grapplefrcdriver"); + // // RuntimeLoader.loadLibrary("grapplefrcdriver"); + // loader = new RuntimeLoader<>("grapplefrcdriver", RuntimeLoader.getDefaultExtractionRoot(), GrappleJNI.class); + // loader.loadLibrary(); + } catch (UnsatisfiedLinkError ex) { ex.printStackTrace(); System.exit(1); } @@ -40,15 +37,15 @@ public static void setExtractOnStaticLoad(boolean load) { /** * Force load the library. - * @throws java.io.IOException thrown if the native library cannot be found + * @throws java.lang.UnsatisfiedLinkError thrown if the native library cannot be found */ - public static synchronized void forceLoad() throws IOException { + public static synchronized void forceLoad() throws UnsatisfiedLinkError { if (libraryLoaded) { return; } - loader = new RuntimeLoader<>("grapplefrcdriver", RuntimeLoader.getDefaultExtractionRoot(), GrappleJNI.class); - loader.loadLibrary(); - // RuntimeLoader.loadLibrary("grapplefrcdriver"); + // loader = new RuntimeLoader<>("grapplefrcdriver", RuntimeLoader.getDefaultExtractionRoot(), GrappleJNI.class); + // loader.loadLibrary(); + System.loadLibrary("grapplefrcdriver"); libraryLoaded = true; } } diff --git a/src/main/java/au/grapplerobotics/LaserCan.java b/src/main/java/au/grapplerobotics/LaserCan.java index 172f6ba..6ba69ad 100644 --- a/src/main/java/au/grapplerobotics/LaserCan.java +++ b/src/main/java/au/grapplerobotics/LaserCan.java @@ -1,6 +1,5 @@ package au.grapplerobotics; -import java.io.IOException; import java.lang.AutoCloseable; import java.lang.ref.Cleaner; @@ -167,7 +166,7 @@ public void run() { public LaserCan(int can_id) { try { GrappleJNI.forceLoad(); - } catch (IOException e) { + } catch (UnsatisfiedLinkError e) { e.printStackTrace(); System.exit(1); } diff --git a/src/main/java/au/grapplerobotics/MitoCANdria.java b/src/main/java/au/grapplerobotics/MitoCANdria.java index d104cc8..d1a924e 100644 --- a/src/main/java/au/grapplerobotics/MitoCANdria.java +++ b/src/main/java/au/grapplerobotics/MitoCANdria.java @@ -1,6 +1,5 @@ package au.grapplerobotics; -import java.io.IOException; import java.lang.AutoCloseable; import java.lang.ref.Cleaner; @@ -45,7 +44,7 @@ public void run() { public MitoCANdria(int can_id) { try { GrappleJNI.forceLoad(); - } catch (IOException e) { + } catch (UnsatisfiedLinkError e) { e.printStackTrace(); System.exit(1); }