Skip to content

Commit e76e9a3

Browse files
patched with 2025RobotCode gradle and venderdeps
1 parent 9dfa53a commit e76e9a3

8 files changed

Lines changed: 228 additions & 134 deletions

File tree

build.gradle

Lines changed: 60 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id "java"
3-
id "edu.wpi.first.GradleRIO" version "2024.3.2"
3+
id "edu.wpi.first.GradleRIO" version "2025.2.1"
44
id "com.peterabeles.gversion" version "1.10"
55
id "com.diffplug.spotless" version "6.12.0"
66
}
@@ -29,12 +29,26 @@ deploy {
2929
// getTargetTypeClass is a shortcut to get the class type using a string
3030

3131
frcJava(getArtifactTypeClass('FRCJavaArtifact')) {
32+
jvmArgs.add("-XX:+UnlockExperimentalVMOptions")
33+
jvmArgs.add("-XX:GCTimeRatio=5")
34+
jvmArgs.add("-XX:+UseSerialGC")
35+
jvmArgs.add("-XX:MaxGCPauseMillis=50")
36+
37+
// The options below may improve performance, but should only be enabled on the RIO 2
38+
//
39+
// final MAX_JAVA_HEAP_SIZE_MB = 100;
40+
// jvmArgs.add("-Xmx" + MAX_JAVA_HEAP_SIZE_MB + "M")
41+
// jvmArgs.add("-Xms" + MAX_JAVA_HEAP_SIZE_MB + "M")
42+
// jvmArgs.add("-XX:+AlwaysPreTouch")
3243
}
3344

3445
// Static files artifact
3546
frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) {
3647
files = project.fileTree('src/main/deploy')
3748
directory = '/home/lvuser/deploy'
49+
// Change to true to delete files on roboRIO that no
50+
// longer exist in deploy directory on roboRIO
51+
deleteOldFiles = false
3852
}
3953
}
4054
}
@@ -50,30 +64,15 @@ wpi.java.debugJni = false
5064
def includeDesktopSupport = true
5165

5266
// Configuration for AdvantageKit
53-
repositories {
54-
maven {
55-
url = uri("https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit")
56-
credentials {
57-
username = "Mechanical-Advantage-Bot"
58-
password = "\u0067\u0068\u0070\u005f\u006e\u0056\u0051\u006a\u0055\u004f\u004c\u0061\u0079\u0066\u006e\u0078\u006e\u0037\u0051\u0049\u0054\u0042\u0032\u004c\u004a\u006d\u0055\u0070\u0073\u0031\u006d\u0037\u004c\u005a\u0030\u0076\u0062\u0070\u0063\u0051"
59-
}
60-
}
61-
mavenLocal()
62-
}
63-
64-
configurations.all {
65-
exclude group: "edu.wpi.first.wpilibj"
66-
}
67-
68-
task(checkAkitInstall, dependsOn: "classes", type: JavaExec) {
69-
mainClass = "org.littletonrobotics.junction.CheckInstall"
67+
task(replayWatch, type: JavaExec) {
68+
mainClass = "org.littletonrobotics.junction.ReplayWatch"
7069
classpath = sourceSets.main.runtimeClasspath
7170
}
72-
compileJava.finalizedBy checkAkitInstall
7371

7472
// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
7573
// Also defines JUnit 4.
7674
dependencies {
75+
annotationProcessor wpi.java.deps.wpilibAnnotations()
7776
implementation wpi.java.deps.wpilib()
7877
implementation wpi.java.vendor.java()
7978

@@ -91,14 +90,11 @@ dependencies {
9190
nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop)
9291
simulationRelease wpi.sim.enableRelease()
9392

94-
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
95-
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2'
96-
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
97-
98-
implementation "gov.nist.math:jama:1.0.3"
93+
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
94+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
9995

10096
def akitJson = new groovy.json.JsonSlurper().parseText(new File(projectDir.getAbsolutePath() + "/vendordeps/AdvantageKit.json").text)
101-
annotationProcessor "org.littletonrobotics.akit.junction:junction-autolog:$akitJson.version"
97+
annotationProcessor "org.littletonrobotics.akit:akit-autolog:$akitJson.version"
10298
}
10399

104100
test {
@@ -107,7 +103,12 @@ test {
107103
}
108104

109105
// Simulation configuration (e.g. environment variables).
110-
wpi.sim.addGui()
106+
//
107+
// The sim GUI is *disabled* by default to support running
108+
// AdvantageKit log replay from the command line. Set the
109+
// value to "true" to enable the sim GUI by default (this
110+
// is the standard WPILib behavior).
111+
wpi.sim.addGui().defaultEnabled = false
111112
wpi.sim.addDriverstation()
112113

113114
// Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar')
@@ -141,6 +142,39 @@ gversion {
141142
indent = " "
142143
}
143144

145+
// Create commit with working changes on event branches
146+
task(eventDeploy) {
147+
doLast {
148+
if (project.gradle.startParameter.taskNames.any({ it.toLowerCase().contains("deploy") })) {
149+
def branchPrefix = "event"
150+
def branch = 'git branch --show-current'.execute().text.trim()
151+
def commitMessage = "Update at '${new Date().toString()}'"
152+
153+
if (branch.startsWith(branchPrefix)) {
154+
exec {
155+
workingDir(projectDir)
156+
executable 'git'
157+
args 'add', '-A'
158+
}
159+
exec {
160+
workingDir(projectDir)
161+
executable 'git'
162+
args 'commit', '-m', commitMessage
163+
ignoreExitValue = true
164+
}
165+
166+
println "Committed to branch: '$branch'"
167+
println "Commit message: '$commitMessage'"
168+
} else {
169+
println "Not on an event branch, skipping commit"
170+
}
171+
} else {
172+
println "Not running deploy task, skipping commit"
173+
}
174+
}
175+
}
176+
createVersionFile.dependsOn(eventDeploy)
177+
144178
// Spotless formatting
145179
project.compileJava.dependsOn(spotlessApply)
146180
spotless {

src/main/java/frc/robot/BuildConstants.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ public final class BuildConstants {
55
public static final String MAVEN_GROUP = "";
66
public static final String MAVEN_NAME = "2024RobotCode";
77
public static final String VERSION = "unspecified";
8-
public static final int GIT_REVISION = 357;
9-
public static final String GIT_SHA = "3ef842811300f6ae93f92b9acc1813edc4af7f2f";
10-
public static final String GIT_DATE = "2024-10-19 17:38:18 EDT";
11-
public static final String GIT_BRANCH = "bloomfield";
12-
public static final String BUILD_DATE = "2024-10-19 18:17:32 EDT";
13-
public static final long BUILD_UNIX_TIME = 1729376252676L;
8+
public static final int GIT_REVISION = 358;
9+
public static final String GIT_SHA = "9dfa53aa84b5d502fa0383ae05141e56a77b6c3a";
10+
public static final String GIT_DATE = "2024-10-20 11:22:43 EDT";
11+
public static final String GIT_BRANCH = "main";
12+
public static final String BUILD_DATE = "2025-08-20 14:44:31 EDT";
13+
public static final long BUILD_UNIX_TIME = 1755715471334L;
1414
public static final int DIRTY = 1;
1515

1616
private BuildConstants() {}

vendordeps/AdvantageKit.json

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,33 @@
11
{
22
"fileName": "AdvantageKit.json",
33
"name": "AdvantageKit",
4-
"version": "3.2.0",
4+
"version": "4.1.0",
55
"uuid": "d820cc26-74e3-11ec-90d6-0242ac120003",
6-
"frcYear": "2024",
7-
"mavenUrls": [],
6+
"frcYear": "2025",
7+
"mavenUrls": [
8+
"https://frcmaven.wpi.edu/artifactory/littletonrobotics-mvn-release/"
9+
],
810
"jsonUrl": "https://github.com/Mechanical-Advantage/AdvantageKit/releases/latest/download/AdvantageKit.json",
911
"javaDependencies": [
1012
{
11-
"groupId": "org.littletonrobotics.akit.junction",
12-
"artifactId": "wpilib-shim",
13-
"version": "3.2.0"
14-
},
15-
{
16-
"groupId": "org.littletonrobotics.akit.junction",
17-
"artifactId": "junction-core",
18-
"version": "3.2.0"
19-
},
20-
{
21-
"groupId": "org.littletonrobotics.akit.conduit",
22-
"artifactId": "conduit-api",
23-
"version": "3.2.0"
13+
"groupId": "org.littletonrobotics.akit",
14+
"artifactId": "akit-java",
15+
"version": "4.1.0"
2416
}
2517
],
2618
"jniDependencies": [
2719
{
28-
"groupId": "org.littletonrobotics.akit.conduit",
29-
"artifactId": "conduit-wpilibio",
30-
"version": "3.2.0",
20+
"groupId": "org.littletonrobotics.akit",
21+
"artifactId": "akit-wpilibio",
22+
"version": "4.1.0",
3123
"skipInvalidPlatforms": false,
3224
"isJar": false,
3325
"validPlatforms": [
3426
"linuxathena",
35-
"windowsx86-64",
3627
"linuxx86-64",
37-
"osxuniversal"
28+
"linuxarm64",
29+
"osxuniversal",
30+
"windowsx86-64"
3831
]
3932
}
4033
],
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"fileName": "PathplannerLib.json",
2+
"fileName": "PathplannerLib-2025.2.3.json",
33
"name": "PathplannerLib",
4-
"version": "2024.2.8",
4+
"version": "2025.2.3",
55
"uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786",
6-
"frcYear": "2024",
6+
"frcYear": "2025",
77
"mavenUrls": [
88
"https://3015rangerrobotics.github.io/pathplannerlib/repo"
99
],
@@ -12,15 +12,15 @@
1212
{
1313
"groupId": "com.pathplanner.lib",
1414
"artifactId": "PathplannerLib-java",
15-
"version": "2024.2.8"
15+
"version": "2025.2.3"
1616
}
1717
],
1818
"jniDependencies": [],
1919
"cppDependencies": [
2020
{
2121
"groupId": "com.pathplanner.lib",
2222
"artifactId": "PathplannerLib-cpp",
23-
"version": "2024.2.8",
23+
"version": "2025.2.3",
2424
"libName": "PathplannerLib",
2525
"headerClassifier": "headers",
2626
"sharedLibrary": false,

0 commit comments

Comments
 (0)