Skip to content

Commit

Permalink
Update to 2025 Beta
Browse files Browse the repository at this point in the history
  • Loading branch information
JaciBrunning committed Nov 29, 2024
1 parent 9ddecf6 commit da9942d
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 35 deletions.
20 changes: 10 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand All @@ -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"
Expand All @@ -49,7 +49,7 @@ nativeUtils {

nativeDependencyContainer {
libgrapplefrcdriver(getNativeDependencyTypeClass('WPISharedMavenDependency')) {
version = "2024.3.1"
version = "2025.0.0"
groupId = "au.grapplerobotics"
artifactId = "libgrapplefrcdriver"
ext = "zip"
Expand Down
8 changes: 4 additions & 4 deletions config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
72 changes: 72 additions & 0 deletions depjson/libgrapplefrc2025.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
]
}
2 changes: 1 addition & 1 deletion grapplefrcdriver/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion grapplefrcdriver/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "grapplefrcdriver"
version = "2024.3.1"
version = "2025.0.0"
edition = "2021"

include = [
Expand Down
2 changes: 1 addition & 1 deletion grapplefrcdriver/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
23 changes: 10 additions & 13 deletions src/main/java/au/grapplerobotics/GrappleJNI.java
Original file line number Diff line number Diff line change
@@ -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<GrappleJNI> loader = null;

public static class Helper {
private static AtomicBoolean extractOnStaticLoad = new AtomicBoolean(true);
Expand All @@ -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);
}
Expand All @@ -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;
}
}
3 changes: 1 addition & 2 deletions src/main/java/au/grapplerobotics/LaserCan.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package au.grapplerobotics;

import java.io.IOException;
import java.lang.AutoCloseable;
import java.lang.ref.Cleaner;

Expand Down Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/au/grapplerobotics/MitoCANdria.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package au.grapplerobotics;

import java.io.IOException;
import java.lang.AutoCloseable;
import java.lang.ref.Cleaner;

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit da9942d

Please sign in to comment.