Skip to content

Commit

Permalink
Merge branch 'master' into v2025-1-0-0/gyros
Browse files Browse the repository at this point in the history
Signed-off-by: Brenden Freier <[email protected]>
  • Loading branch information
Baconing authored Oct 10, 2024
2 parents 7108bbc + 4c4c69a commit 336dd89
Show file tree
Hide file tree
Showing 14 changed files with 910 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/grade-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- published

jobs:
build:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Java
name: Test Java

on:
push:
Expand All @@ -14,7 +14,7 @@ on:
pull_request:

jobs:
build-java:
test-java:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -29,5 +29,5 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Build
run: ./gradlew build --scan
- name: Test
run: ./gradlew test
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": "2024",
"teamNumber": 5183
}
101 changes: 47 additions & 54 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'java'
id 'maven-publish'
id "edu.wpi.first.GradleRIO" version "2024.3.1"
}

group = 'net.frc5183.librobot'
Expand Down Expand Up @@ -34,74 +35,66 @@ publishing {
}
}

repositories {
mavenCentral()

// WPILib
maven {
url = "https://frcmaven.wpi.edu/artifactory/release"
}

// PathPlannerLib
maven {
url = "https://3015rangerrobotics.github.io/pathplannerlib/repo"
}

// CTRE Phoenix
maven {
url = "https://maven.ctr-electronics.com/release/"
}

// REV Robotics
maven {
url = "https://maven.revrobotics.com/"
deploy {
targets {
roborio(getTargetTypeClass('RoboRIO')) {
artifacts {
// First part is artifact name, 2nd is artifact type
// getTargetTypeClass is a shortcut to get the class type using a string

frcJava(getArtifactTypeClass('FRCJavaArtifact')) {
}

// Static files artifact
frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) {
files = project.fileTree('src/main/deploy')
directory = '/home/lvuser/deploy'
}
}
}
}
}

// Kauai Labs NavX
maven {
url = "https://dev.studica.com/maven/release/2024/"
}
def deployArtifact = deploy.targets.roborio.artifacts.frcJava

// YAGSL
maven {
url = "https://broncbotz3481.github.io/YAGSL-Lib/yagsl/repos"
}
repositories {
mavenCentral()
}

dependencies {
// Jetbrains Annotations
compileOnly "org.jetbrains:annotations:25.0.0"

compileOnly "edu.wpi.first.wpilibj:wpilibj-java:2024.3.2"
compileOnly "edu.wpi.first.wpiutil:wpiutil-java:2024.3.2"
compileOnly "edu.wpi.first.wpilibj:commands:2024.3.2"
compileOnly "edu.wpi.first.wpimath:wpimath-java:2024.3.2"
compileOnly "edu.wpi.first.wpiunits:wpiunits-java:2024.3.2"
compileOnly "edu.wpi.first.wpilibNewCommands:wpilibNewCommands-java:2024.3.2"
compileOnly wpi.java.deps.wpilib()
compileOnly wpi.java.vendor.java()

// PathPlannerLib
// todo: maven repository is broken
// compileOnly "com.pathplanner.lib:PathPlannerLib-java:2024.2.6"
nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop)
nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop)
simulationDebug wpi.sim.enableDebug()

// CTRE Phoenix (v6)
compileOnly "com.ctre.phoenix6:wpiapi-java:24.1.0"
// CTRE Phoenix (v5)
compileOnly "com.ctre.phoenix:api-java:5.33.0"
compileOnly "com.ctre.phoenix:wpiapi-java:5.33.0"
nativeRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.desktop)
nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop)
simulationRelease wpi.sim.enableRelease()

// REV Robotics
compileOnly "com.revrobotics.frc:REVLib-java:2024.2.0"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'

// NavX
compileOnly "com.kauailabs.navx.frc:navx-frc-java:2024.1.0"

// YAGSL
compileOnly "swervelib:YAGSL-java:2024.5.0.0"

testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation wpi.java.deps.wpilib()
testImplementation wpi.java.vendor.java()
}

test {
useJUnitPlatform()
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
}

jar {
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
from sourceSets.main.allSource
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}

// Configure jar and deploy tasks
deployArtifact.jarTask = jar
wpi.java.configureExecutableTasks(jar)
wpi.java.configureTestTasks(test)
29 changes: 28 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,29 @@
rootProject.name = 'librobot'
import org.gradle.internal.os.OperatingSystem

pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
String frcYear = '2024'
File frcHome
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)
} else {
def userFolder = System.getProperty("user.home")
def homeRoot = new File(userFolder, "wpilib")
frcHome = new File(homeRoot, frcYear)
}
def frcHomeMaven = new File(frcHome, 'maven')
maven {
name 'frcHome'
url frcHomeMaven
}
}
}

rootProject.name = 'librobot'
40 changes: 40 additions & 0 deletions vendordeps/NavX.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"fileName": "NavX.json",
"name": "NavX",
"version": "2024.1.0",
"uuid": "cb311d09-36e9-4143-a032-55bb2b94443b",
"frcYear": "2024",
"mavenUrls": [
"https://dev.studica.com/maven/release/2024/"
],
"jsonUrl": "https://dev.studica.com/releases/2024/NavX.json",
"javaDependencies": [
{
"groupId": "com.kauailabs.navx.frc",
"artifactId": "navx-frc-java",
"version": "2024.1.0"
}
],
"jniDependencies": [],
"cppDependencies": [
{
"groupId": "com.kauailabs.navx.frc",
"artifactId": "navx-frc-cpp",
"version": "2024.1.0",
"headerClassifier": "headers",
"sourcesClassifier": "sources",
"sharedLibrary": false,
"libName": "navx_frc",
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"linuxathena",
"linuxraspbian",
"linuxarm32",
"linuxarm64",
"linuxx86-64",
"osxuniversal",
"windowsx86-64"
]
}
]
}
38 changes: 38 additions & 0 deletions vendordeps/PathplannerLib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"fileName": "PathplannerLib.json",
"name": "PathplannerLib",
"version": "2024.2.8",
"uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786",
"frcYear": "2024",
"mavenUrls": [
"https://3015rangerrobotics.github.io/pathplannerlib/repo"
],
"jsonUrl": "https://3015rangerrobotics.github.io/pathplannerlib/PathplannerLib.json",
"javaDependencies": [
{
"groupId": "com.pathplanner.lib",
"artifactId": "PathplannerLib-java",
"version": "2024.2.8"
}
],
"jniDependencies": [],
"cppDependencies": [
{
"groupId": "com.pathplanner.lib",
"artifactId": "PathplannerLib-cpp",
"version": "2024.2.8",
"libName": "PathplannerLib",
"headerClassifier": "headers",
"sharedLibrary": false,
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"windowsx86-64",
"linuxx86-64",
"osxuniversal",
"linuxathena",
"linuxarm32",
"linuxarm64"
]
}
]
}
Loading

0 comments on commit 336dd89

Please sign in to comment.