From 6118e870eb61915453c360f9937fae266924ad00 Mon Sep 17 00:00:00 2001 From: "Lawrence (Drew) Whisenant" <7390131+drewwhis@users.noreply.github.com> Date: Tue, 15 Sep 2026 20:02:36 -0500 Subject: [PATCH 1/4] support alpha 7 --- .wpilib/wpilib_preferences.json | 2 +- README.md | 3 ++- build.gradle | 23 ++++--------------- settings.gradle | 14 ++++++++--- .../frc10101/womp/can/SparkMaxWrapper.java | 7 +++--- .../womp/can/SparkMaxWrapperTest.java | 9 ++++---- vendordeps/REVLib.json | 20 ++++++++-------- 7 files changed, 38 insertions(+), 40 deletions(-) diff --git a/.wpilib/wpilib_preferences.json b/.wpilib/wpilib_preferences.json index 5e810ac..8d69462 100644 --- a/.wpilib/wpilib_preferences.json +++ b/.wpilib/wpilib_preferences.json @@ -1,6 +1,6 @@ { "enableCppIntellisense": false, "currentLanguage": "java", - "projectYear": "2027_alpha5", + "projectYear": "2027_alpha7", "teamNumber": 10101 } \ No newline at end of file diff --git a/README.md b/README.md index f0de89d..857a070 100644 --- a/README.md +++ b/README.md @@ -14,4 +14,5 @@ repositories { Where `TAG` is the version of the library to include in your project. Make sure the vendor dependency versions in your project match those in the version you're trying to use. For this version of the library, those are: -- REVLib 2027.0.0-alpha-6 \ No newline at end of file +- WPILib 2027 alpha 7 +- REVLib 2027.0.0-alpha-7 diff --git a/build.gradle b/build.gradle index fa5b0a1..82c24bb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,9 @@ plugins { - id "java-library" id 'maven-publish' id "java" - id "org.wpilib.GradleRIO" version "2027.0.0-alpha-6" + id "application" + id "org.wpilib.GradleRIO" version "2027.0.0-alpha-7" id 'com.diffplug.spotless' version '8.10.1' - id "com.gradleup.shadow" version "9.3.0" } java { @@ -32,7 +31,7 @@ deploy { } def deployArtifact = deploy.targets.systemcore.artifacts.wpilibJava -wpi.java.debugJni = false +wpi.java.runSimWithDebugJni = false def includeDesktopSupport = true // Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. @@ -69,20 +68,8 @@ test { wpi.sim.addGui().defaultEnabled = true wpi.sim.addDriverstation() -// Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar') -// in order to make them all available at runtime. Also adding the manifest so WPILib -// knows where to look for our Robot Class. -shadowJar { - mergeServiceFiles() - from('src') { into 'backup/src' } - from('vendordeps') { into 'backup/vendordeps' } - from('build.gradle') { into 'backup' } - duplicatesStrategy = DuplicatesStrategy.INCLUDE -} - -// Configure jar and deploy tasks -deployArtifact.jarTask = shadowJar -wpi.java.configureExecutableTasks(shadowJar) +// deployArtifact.configureApplication(application) +// wpi.java.configureApplication(application) wpi.java.configureTestTasks(test) // Configure string concat to always inline compile diff --git a/settings.gradle b/settings.gradle index e2626a8..a17bda0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,18 +2,26 @@ import org.gradle.internal.os.OperatingSystem pluginManagement { repositories { - String wpilibYear = '2027_alpha5' + String wpilibYear = '2027_alpha7' File wpilibHome - if (OperatingSystem.current().isWindows()) { + def os = OperatingSystem.current() + if (os.isWindows()) { String publicFolder = System.getenv('PUBLIC') if (publicFolder == null) { publicFolder = "C:\\Users\\Public" } def homeRoot = new File(publicFolder, "wpilib") wpilibHome = new File(homeRoot, wpilibYear) + } else if (os.isLinux()) { + String xdgDataHome = System.getenv('XDG_DATA_HOME') + if (xdgDataHome == null || xdgDataHome.trim().isEmpty() || !new File(xdgDataHome).isAbsolute()) { + xdgDataHome = new File(System.getProperty("user.home"), ".local/share").getPath() + } + def homeRoot = new File(xdgDataHome, "wpilib") + wpilibHome = new File(homeRoot, wpilibYear) } else { def userFolder = System.getProperty("user.home") - def homeRoot = new File(userFolder, "wpilib") + def homeRoot = new File(userFolder, ".wpilib") wpilibHome = new File(homeRoot, wpilibYear) } def wpilibHomeMaven = new File(wpilibHome, 'maven') diff --git a/src/main/java/org/frc10101/womp/can/SparkMaxWrapper.java b/src/main/java/org/frc10101/womp/can/SparkMaxWrapper.java index 08e9fd2..a16ab88 100644 --- a/src/main/java/org/frc10101/womp/can/SparkMaxWrapper.java +++ b/src/main/java/org/frc10101/womp/can/SparkMaxWrapper.java @@ -2,6 +2,7 @@ import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.SparkMax; +import org.wpilib.hardware.bus.CANPort; /** A REV SPARK Max */ public class SparkMaxWrapper { @@ -10,14 +11,14 @@ public class SparkMaxWrapper { /** * Creates a REV SPARK Max. * - * @param busId the ID of the Systemcore Bus + * @param bus the Systemcore Bus * @param canId the CAN ID of the SPARK Max * @param motorType the type of motor to control (brushed or brushless) */ - public SparkMaxWrapper(int busId, int canId, MotorType motorType) { + public SparkMaxWrapper(CANPort bus, int canId, MotorType motorType) { if (canId < 1) throw new IllegalArgumentException("CAN ID must be greater than or equal to 1."); if (motorType == null) throw new IllegalArgumentException("Motor Type must be specified."); - _sparkMax = new SparkMax(busId, canId, motorType); + _sparkMax = new SparkMax(bus, canId, motorType); } /** diff --git a/src/test/java/org/frc10101/womp/can/SparkMaxWrapperTest.java b/src/test/java/org/frc10101/womp/can/SparkMaxWrapperTest.java index 04fdf88..60d5fbd 100644 --- a/src/test/java/org/frc10101/womp/can/SparkMaxWrapperTest.java +++ b/src/test/java/org/frc10101/womp/can/SparkMaxWrapperTest.java @@ -4,12 +4,13 @@ import com.revrobotics.spark.SparkLowLevel.MotorType; import org.junit.jupiter.api.Test; +import org.wpilib.hardware.bus.CANPort; public class SparkMaxWrapperTest { @Test void create() { - new SparkMaxWrapper(0, 1, MotorType.kBrushed); - new SparkMaxWrapper(0, 2, MotorType.kBrushless); + new SparkMaxWrapper(CANPort.CAN_S0, 1, MotorType.kBrushed); + new SparkMaxWrapper(CANPort.CAN_S0, 2, MotorType.kBrushless); } @Test @@ -17,7 +18,7 @@ void illegalCanId() { assertThrows( IllegalArgumentException.class, () -> { - new SparkMaxWrapper(0, 0, MotorType.kBrushed); + new SparkMaxWrapper(CANPort.CAN_S0, 0, MotorType.kBrushed); }); } @@ -26,7 +27,7 @@ void missingMotorType() { assertThrows( IllegalArgumentException.class, () -> { - new SparkMaxWrapper(0, 1, null); + new SparkMaxWrapper(CANPort.CAN_S0, 1, null); }); } } diff --git a/vendordeps/REVLib.json b/vendordeps/REVLib.json index 2861f9e..33ed264 100644 --- a/vendordeps/REVLib.json +++ b/vendordeps/REVLib.json @@ -1,8 +1,8 @@ { "fileName": "REVLib.json", "name": "REVLib", - "version": "2027.0.0-alpha-6", - "wpilibYear": "2027_alpha5", + "version": "2027.0.0-alpha-7", + "wpilibYear": "2027_alpha7", "uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb", "mavenUrls": [ "https://maven.revrobotics.com/" @@ -12,14 +12,14 @@ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-java", - "version": "2027.0.0-alpha-6" + "version": "2027.0.0-alpha-7" } ], "jniDependencies": [ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-driver", - "version": "2027.0.0-alpha-6", + "version": "2027.0.0-alpha-7", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ @@ -33,7 +33,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "RevLibBackendDriver", - "version": "2027.0.0-alpha-6", + "version": "2027.0.0-alpha-7", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ @@ -47,7 +47,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "RevLibWpiBackendDriver", - "version": "2027.0.0-alpha-6", + "version": "2027.0.0-alpha-7", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ @@ -63,7 +63,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-cpp", - "version": "2027.0.0-alpha-6", + "version": "2027.0.0-alpha-7", "libName": "REVLib", "headerClassifier": "headers", "sharedLibrary": false, @@ -79,7 +79,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-driver", - "version": "2027.0.0-alpha-6", + "version": "2027.0.0-alpha-7", "libName": "REVLibDriver", "headerClassifier": "headers", "sharedLibrary": false, @@ -95,7 +95,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "RevLibBackendDriver", - "version": "2027.0.0-alpha-6", + "version": "2027.0.0-alpha-7", "libName": "BackendDriver", "sharedLibrary": true, "skipInvalidPlatforms": true, @@ -110,7 +110,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "RevLibWpiBackendDriver", - "version": "2027.0.0-alpha-6", + "version": "2027.0.0-alpha-7", "libName": "REVLibWpi", "sharedLibrary": true, "skipInvalidPlatforms": true, From 43199472af2b21a754ace698f3b79749049ec990 Mon Sep 17 00:00:00 2001 From: "Lawrence (Drew) Whisenant" <7390131+drewwhis@users.noreply.github.com> Date: Tue, 15 Sep 2026 20:13:27 -0500 Subject: [PATCH 2/4] indicate class path --- build.gradle | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 82c24bb..2d9417c 100644 --- a/build.gradle +++ b/build.gradle @@ -17,6 +17,8 @@ if (project.hasProperty('projVersion')) { project.version = '0.0.0' } +def ROBOT_MAIN_CLASS = "first.Main" + // Define my targets (RoboRIO) and artifacts (deployable files) // This is added by GradleRIO's backing project DeployUtils. deploy { @@ -68,8 +70,9 @@ test { wpi.sim.addGui().defaultEnabled = true wpi.sim.addDriverstation() -// deployArtifact.configureApplication(application) -// wpi.java.configureApplication(application) +application.mainClass = ROBOT_MAIN_CLASS +deployArtifact.configureApplication(application) +wpi.java.configureApplication(application) wpi.java.configureTestTasks(test) // Configure string concat to always inline compile From 2fdb49591b42a472e660ce26390300e89869fe85 Mon Sep 17 00:00:00 2001 From: "Lawrence (Drew) Whisenant" <7390131+drewwhis@users.noreply.github.com> Date: Tue, 15 Sep 2026 20:21:33 -0500 Subject: [PATCH 3/4] add lib --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index 2d9417c..1299f1a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,5 @@ plugins { + id "java-library" id 'maven-publish' id "java" id "application" From 774a8580baa6121396d6cd17b6f436c68a5ac93b Mon Sep 17 00:00:00 2001 From: "Lawrence (Drew) Whisenant" <7390131+drewwhis@users.noreply.github.com> Date: Tue, 15 Sep 2026 20:31:27 -0500 Subject: [PATCH 4/4] revert changes --- build.gradle | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build.gradle b/build.gradle index 1299f1a..bc9ce2a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,4 @@ plugins { - id "java-library" id 'maven-publish' id "java" id "application" @@ -18,8 +17,6 @@ if (project.hasProperty('projVersion')) { project.version = '0.0.0' } -def ROBOT_MAIN_CLASS = "first.Main" - // Define my targets (RoboRIO) and artifacts (deployable files) // This is added by GradleRIO's backing project DeployUtils. deploy { @@ -71,9 +68,6 @@ test { wpi.sim.addGui().defaultEnabled = true wpi.sim.addDriverstation() -application.mainClass = ROBOT_MAIN_CLASS -deployArtifact.configureApplication(application) -wpi.java.configureApplication(application) wpi.java.configureTestTasks(test) // Configure string concat to always inline compile