Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.*",
Expand All @@ -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
}
6 changes: 6 additions & 0 deletions .wpilib/wpilib_preferences.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"enableCppIntellisense": false,
"currentLanguage": "java",
"projectYear": "2027_alpha5",
"teamNumber": 10101
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 16 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand All @@ -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

Expand All @@ -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)
Expand All @@ -71,16 +72,17 @@ 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' }
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}

// 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
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion jitpack.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
jdk:
- openjdk17
- openjdk25
18 changes: 9 additions & 9 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/main/deploy/example.txt

This file was deleted.

7 changes: 4 additions & 3 deletions src/main/java/org/frc10101/womp/can/SparkMaxWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand All @@ -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);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/org/frc10101/womp/can/SparkMaxWrapperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
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
void illegalCanId() {
assertThrows(
IllegalArgumentException.class,
() -> {
new SparkMaxWrapper(0, MotorType.kBrushed);
new SparkMaxWrapper(0, 0, MotorType.kBrushed);
});
}

Expand All @@ -26,7 +26,7 @@ void missingMotorType() {
assertThrows(
IllegalArgumentException.class,
() -> {
new SparkMaxWrapper(1, null);
new SparkMaxWrapper(0, 1, null);
});
}
}
Loading