diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml index 47c4b9c..0a76f29 100644 --- a/.github/workflows/branch.yml +++ b/.github/workflows/branch.yml @@ -16,10 +16,10 @@ jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 # This grabs the WPILib docker container - container: wpilib/roborio-cross-ubuntu:2025-22.04 + container: wpilib/systemcore-cross-ubuntu:2027-24.04 # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1c45152..1430252 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,10 +16,10 @@ jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 # This grabs the WPILib docker container - container: wpilib/roborio-cross-ubuntu:2025-22.04 + container: wpilib/systemcore-cross-ubuntu:2027-24.04 # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 0e14cf5..b90608c 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,10 +13,10 @@ jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 # This grabs the WPILib docker container - container: wpilib/roborio-cross-ubuntu:2025-22.04 + container: wpilib/systemcore-cross-ubuntu:2027-24.04 # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/.vscode/settings.json b/.vscode/settings.json index 5e6ede8..3c5c2e6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -37,7 +37,7 @@ "org.mockito.Mockito.*", "org.mockito.ArgumentMatchers.*", "org.mockito.Answers.*", - "edu.wpi.first.units.Units.*" + "org.wpilib.units.Units.*" ], "java.completion.filteredTypes": [ "java.awt.*", @@ -53,9 +53,9 @@ "javax.swing.*", "javax.management.*", "javax.smartcardio.*", - "edu.wpi.first.math.proto.*", - "edu.wpi.first.math.**.proto.*", - "edu.wpi.first.math.**.struct.*", + "org.wpilib.math.proto.*", + "org.wpilib.math.**.proto.*", + "org.wpilib.math.**.struct.*", ], "java.dependency.enableDependencyCheckup": false } diff --git a/.wpilib/wpilib_preferences.json b/.wpilib/wpilib_preferences.json new file mode 100644 index 0000000..5e810ac --- /dev/null +++ b/.wpilib/wpilib_preferences.json @@ -0,0 +1,6 @@ +{ + "enableCppIntellisense": false, + "currentLanguage": "java", + "projectYear": "2027_alpha5", + "teamNumber": 10101 +} \ No newline at end of file diff --git a/README.md b/README.md index 5d2629a..f0de89d 100644 --- a/README.md +++ b/README.md @@ -14,4 +14,4 @@ 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 2026.0.5 +- REVLib 2027.0.0-alpha-6 \ No newline at end of file diff --git a/build.gradle b/build.gradle index 34eebf2..fa5b0a1 100644 --- a/build.gradle +++ b/build.gradle @@ -2,13 +2,14 @@ plugins { id "java-library" id 'maven-publish' id "java" - id "edu.wpi.first.GradleRIO" version "2026.2.1" - id 'com.diffplug.spotless' version '6.20.0' + id "org.wpilib.GradleRIO" version "2027.0.0-alpha-6" + id 'com.diffplug.spotless' version '8.10.1' + id "com.gradleup.shadow" version "9.3.0" } java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_25 + targetCompatibility = JavaVersion.VERSION_25 } if (project.hasProperty('projVersion')) { @@ -21,16 +22,16 @@ if (project.hasProperty('projVersion')) { // This is added by GradleRIO's backing project DeployUtils. deploy { targets { - roborio(getTargetTypeClass('RoboRIO')) { + systemcore(getTargetTypeClass('SystemCore')) { artifacts { - frcJava(getArtifactTypeClass('FRCJavaArtifact')) { + wpilibJava(getArtifactTypeClass('WPILibJavaArtifact')) { } } } } } -def deployArtifact = deploy.targets.roborio.artifacts.frcJava +def deployArtifact = deploy.targets.systemcore.artifacts.wpilibJava wpi.java.debugJni = false def includeDesktopSupport = true @@ -41,11 +42,11 @@ dependencies { implementation wpi.java.deps.wpilib() implementation wpi.java.vendor.java() - roborioDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.roborio) - roborioDebug wpi.java.vendor.jniDebug(wpi.platforms.roborio) + systemcoreDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.systemcore) + systemcoreDebug wpi.java.vendor.jniDebug(wpi.platforms.systemcore) - roborioRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio) - roborioRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio) + systemcoreRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.systemcore) + systemcoreRelease wpi.java.vendor.jniRelease(wpi.platforms.systemcore) nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop) nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop) @@ -71,7 +72,8 @@ 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. -jar { +shadowJar { + mergeServiceFiles() from('src') { into 'backup/src' } from('vendordeps') { into 'backup/vendordeps' } from('build.gradle') { into 'backup' } @@ -79,8 +81,8 @@ jar { } // Configure jar and deploy tasks -deployArtifact.jarTask = jar -wpi.java.configureExecutableTasks(jar) +deployArtifact.jarTask = shadowJar +wpi.java.configureExecutableTasks(shadowJar) wpi.java.configureTestTasks(test) // Configure string concat to always inline compile diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8e975a5..22ded4a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=permwrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME -zipStorePath=permwrapper/dists +zipStorePath=permwrapper/dists \ No newline at end of file diff --git a/jitpack.yml b/jitpack.yml index 1e41e00..c39ce5d 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,2 +1,2 @@ jdk: - - openjdk17 \ No newline at end of file + - openjdk25 \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 25f6f6e..e2626a8 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,27 +2,27 @@ import org.gradle.internal.os.OperatingSystem pluginManagement { repositories { - mavenLocal() - gradlePluginPortal() - String frcYear = '2026' - File frcHome + String wpilibYear = '2027_alpha5' + File wpilibHome if (OperatingSystem.current().isWindows()) { String publicFolder = System.getenv('PUBLIC') if (publicFolder == null) { publicFolder = "C:\\Users\\Public" } def homeRoot = new File(publicFolder, "wpilib") - frcHome = new File(homeRoot, frcYear) + wpilibHome = new File(homeRoot, wpilibYear) } else { def userFolder = System.getProperty("user.home") def homeRoot = new File(userFolder, "wpilib") - frcHome = new File(homeRoot, frcYear) + wpilibHome = new File(homeRoot, wpilibYear) } - def frcHomeMaven = new File(frcHome, 'maven') + def wpilibHomeMaven = new File(wpilibHome, 'maven') maven { - name = 'frcHome' - url = frcHomeMaven + name = 'wpilibHome' + url = wpilibHomeMaven } + mavenLocal() + gradlePluginPortal() } } diff --git a/src/main/deploy/example.txt b/src/main/deploy/example.txt deleted file mode 100644 index bb82515..0000000 --- a/src/main/deploy/example.txt +++ /dev/null @@ -1,3 +0,0 @@ -Files placed in this directory will be deployed to the RoboRIO into the -'deploy' directory in the home folder. Use the 'Filesystem.getDeployDirectory' wpilib function -to get a proper path relative to the deploy directory. \ No newline at end of file diff --git a/src/main/java/org/frc10101/womp/can/SparkMaxWrapper.java b/src/main/java/org/frc10101/womp/can/SparkMaxWrapper.java index d2b2a48..08e9fd2 100644 --- a/src/main/java/org/frc10101/womp/can/SparkMaxWrapper.java +++ b/src/main/java/org/frc10101/womp/can/SparkMaxWrapper.java @@ -10,13 +10,14 @@ public class SparkMaxWrapper { /** * Creates a REV SPARK Max. * + * @param busId the ID of 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 canId, MotorType motorType) { + public SparkMaxWrapper(int busId, 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(canId, motorType); + _sparkMax = new SparkMax(busId, canId, motorType); } /** @@ -27,7 +28,7 @@ public SparkMaxWrapper(int canId, MotorType motorType) { public void setDutyCycle(double dutyCycle) { if (dutyCycle < -1) dutyCycle = -1; if (dutyCycle > 1) dutyCycle = 1; - _sparkMax.set(dutyCycle); + _sparkMax.setThrottle(dutyCycle); } /** diff --git a/src/test/java/org/frc10101/womp/can/SparkMaxWrapperTest.java b/src/test/java/org/frc10101/womp/can/SparkMaxWrapperTest.java index 9dc72dc..04fdf88 100644 --- a/src/test/java/org/frc10101/womp/can/SparkMaxWrapperTest.java +++ b/src/test/java/org/frc10101/womp/can/SparkMaxWrapperTest.java @@ -8,8 +8,8 @@ public class SparkMaxWrapperTest { @Test void create() { - new SparkMaxWrapper(1, MotorType.kBrushed); - new SparkMaxWrapper(2, MotorType.kBrushless); + new SparkMaxWrapper(0, 1, MotorType.kBrushed); + new SparkMaxWrapper(0, 2, MotorType.kBrushless); } @Test @@ -17,7 +17,7 @@ void illegalCanId() { assertThrows( IllegalArgumentException.class, () -> { - new SparkMaxWrapper(0, MotorType.kBrushed); + new SparkMaxWrapper(0, 0, MotorType.kBrushed); }); } @@ -26,7 +26,7 @@ void missingMotorType() { assertThrows( IllegalArgumentException.class, () -> { - new SparkMaxWrapper(1, null); + new SparkMaxWrapper(0, 1, null); }); } } diff --git a/vendordeps/REVLib.json b/vendordeps/REVLib.json index c6b1b9e..2861f9e 100644 --- a/vendordeps/REVLib.json +++ b/vendordeps/REVLib.json @@ -1,63 +1,60 @@ { "fileName": "REVLib.json", "name": "REVLib", - "version": "2026.0.5", - "frcYear": "2026", + "version": "2027.0.0-alpha-6", + "wpilibYear": "2027_alpha5", "uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb", "mavenUrls": [ "https://maven.revrobotics.com/" ], - "jsonUrl": "https://software-metadata.revrobotics.com/REVLib-2026.json", + "jsonUrl": "https://software-metadata.revrobotics.com/REVLib-2027.json", "javaDependencies": [ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-java", - "version": "2026.0.5" + "version": "2027.0.0-alpha-6" } ], "jniDependencies": [ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-driver", - "version": "2026.0.5", + "version": "2027.0.0-alpha-6", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ "windowsx86-64", "linuxarm64", "linuxx86-64", - "linuxathena", - "linuxarm32", + "linuxsystemcore", "osxuniversal" ] }, { "groupId": "com.revrobotics.frc", "artifactId": "RevLibBackendDriver", - "version": "2026.0.5", + "version": "2027.0.0-alpha-6", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ "windowsx86-64", "linuxarm64", "linuxx86-64", - "linuxathena", - "linuxarm32", + "linuxsystemcore", "osxuniversal" ] }, { "groupId": "com.revrobotics.frc", "artifactId": "RevLibWpiBackendDriver", - "version": "2026.0.5", + "version": "2027.0.0-alpha-6", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ "windowsx86-64", "linuxarm64", "linuxx86-64", - "linuxathena", - "linuxarm32", + "linuxsystemcore", "osxuniversal" ] } @@ -66,7 +63,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-cpp", - "version": "2026.0.5", + "version": "2027.0.0-alpha-6", "libName": "REVLib", "headerClassifier": "headers", "sharedLibrary": false, @@ -75,15 +72,14 @@ "windowsx86-64", "linuxarm64", "linuxx86-64", - "linuxathena", - "linuxarm32", + "linuxsystemcore", "osxuniversal" ] }, { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-driver", - "version": "2026.0.5", + "version": "2027.0.0-alpha-6", "libName": "REVLibDriver", "headerClassifier": "headers", "sharedLibrary": false, @@ -92,15 +88,14 @@ "windowsx86-64", "linuxarm64", "linuxx86-64", - "linuxathena", - "linuxarm32", + "linuxsystemcore", "osxuniversal" ] }, { "groupId": "com.revrobotics.frc", "artifactId": "RevLibBackendDriver", - "version": "2026.0.5", + "version": "2027.0.0-alpha-6", "libName": "BackendDriver", "sharedLibrary": true, "skipInvalidPlatforms": true, @@ -108,15 +103,14 @@ "windowsx86-64", "linuxarm64", "linuxx86-64", - "linuxathena", - "linuxarm32", + "linuxsystemcore", "osxuniversal" ] }, { "groupId": "com.revrobotics.frc", "artifactId": "RevLibWpiBackendDriver", - "version": "2026.0.5", + "version": "2027.0.0-alpha-6", "libName": "REVLibWpi", "sharedLibrary": true, "skipInvalidPlatforms": true, @@ -124,8 +118,7 @@ "windowsx86-64", "linuxarm64", "linuxx86-64", - "linuxathena", - "linuxarm32", + "linuxsystemcore", "osxuniversal" ] }