diff --git a/.gitignore b/.gitignore index a332fb2..afba9e5 100644 --- a/.gitignore +++ b/.gitignore @@ -158,3 +158,7 @@ bin/ # End of https://www.gitignore.io/api/c++,java,linux,macos,gradle,windows,visualstudiocode + +# clangd +/.cache +compile_commands.json diff --git a/URCL.json b/URCL.json index a677eaa..33cc527 100644 --- a/URCL.json +++ b/URCL.json @@ -1,25 +1,25 @@ { "fileName": "URCL.json", "name": "URCL", - "version": "2024.0.1", + "version": "2024.1.0", "frcYear": "2024", "uuid": "84246d17-a797-4d1e-bd9f-c59cd8d2477c", "mavenUrls": [ - "https://raw.githubusercontent.com/Mechanical-Advantage/URCL/2024.0.1" + "https://raw.githubusercontent.com/Mechanical-Advantage/URCL/2024.1.0" ], "jsonUrl": "https://raw.githubusercontent.com/Mechanical-Advantage/URCL/maven/URCL.json", "javaDependencies": [ { "groupId": "org.littletonrobotics.urcl", "artifactId": "URCL-java", - "version": "2024.0.1" + "version": "2024.1.0" } ], "jniDependencies": [ { "groupId": "org.littletonrobotics.urcl", "artifactId": "URCL-driver", - "version": "2024.0.1", + "version": "2024.1.0", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ @@ -34,7 +34,7 @@ { "groupId": "org.littletonrobotics.urcl", "artifactId": "URCL-cpp", - "version": "2024.0.1", + "version": "2024.1.0", "libName": "URCL", "headerClassifier": "headers", "sharedLibrary": false, @@ -49,7 +49,7 @@ { "groupId": "org.littletonrobotics.urcl", "artifactId": "URCL-driver", - "version": "2024.0.1", + "version": "2024.1.0", "libName": "URCLDriver", "headerClassifier": "headers", "sharedLibrary": false, diff --git a/publish.gradle b/publish.gradle index 7cb0103..c223312 100644 --- a/publish.gradle +++ b/publish.gradle @@ -2,7 +2,7 @@ apply plugin: 'maven-publish' ext.licenseFile = files("$rootDir/LICENSE.txt") -def pubVersion = '2024.0.1' +def pubVersion = '2024.1.0' def outputsFolder = file("$buildDir/outputs") diff --git a/src/main/java/org/littletonrobotics/urcl/URCLJNI.java b/src/main/java/org/littletonrobotics/urcl/URCLJNI.java index 8ad75d4..fb3ed3d 100644 --- a/src/main/java/org/littletonrobotics/urcl/URCLJNI.java +++ b/src/main/java/org/littletonrobotics/urcl/URCLJNI.java @@ -8,6 +8,7 @@ package org.littletonrobotics.urcl; import java.io.IOException; +import java.lang.System; import java.nio.ByteBuffer; import java.util.concurrent.atomic.AtomicBoolean; @@ -18,7 +19,6 @@ */ public class URCLJNI { static boolean libraryLoaded = false; - static RuntimeLoader loader = null; /** * Helper class for determining whether or not to load the driver on static @@ -29,7 +29,7 @@ public static class Helper { /** * Get whether to load the driver on static init. - * + * * @return true if the driver will load on static init */ public static boolean getExtractOnStaticLoad() { @@ -38,7 +38,7 @@ public static boolean getExtractOnStaticLoad() { /** * Set whether to load the driver on static init. - * + * * @param load the new value */ public static void setExtractOnStaticLoad(boolean load) { @@ -49,9 +49,7 @@ public static void setExtractOnStaticLoad(boolean load) { static { if (Helper.getExtractOnStaticLoad()) { try { - loader = new RuntimeLoader<>("URCLDriver", RuntimeLoader.getDefaultExtractionRoot(), - URCLJNI.class); - loader.loadLibrary(); + RuntimeLoader.loadLibrary("URCLDriver"); } catch (IOException ex) { ex.printStackTrace(); System.exit(1); @@ -62,32 +60,30 @@ public static void setExtractOnStaticLoad(boolean load) { /** * Force load the library. - * + * * @throws java.io.IOException thrown if the native library cannot be found */ public static synchronized void forceLoad() throws IOException { if (libraryLoaded) { return; } - loader = new RuntimeLoader<>("URCLDriver", RuntimeLoader.getDefaultExtractionRoot(), - URCLJNI.class); - loader.loadLibrary(); + RuntimeLoader.loadLibrary("URCLDriver"); libraryLoaded = true; } /** Start logging. */ public static native void start(); - /** + /** * Get the shared buffer with persistent data. - * + * * @return The shared buffer */ public static native ByteBuffer getPersistentBuffer(); - /** + /** * Get the shared buffer with periodic data. - * + * * @return The shared buffer */ public static native ByteBuffer getPeriodicBuffer();