11plugins {
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
5064def 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 = " \u 0067\u 0068\u 0070\u 005f\u 006e\u 0056\u 0051\u 006a\u 0055\u 004f\u 004c\u 0061\u 0079\u 0066\u 006e\u 0078\u 006e\u 0037\u 0051\u 0049\u 0054\u 0042\u 0032\u 004c\u 004a\u 006d\u 0055\u 0070\u 0073\u 0031\u 006d\u 0037\u 004c\u 005a\u 0030\u 0076\u 0062\u 0070\u 0063\u 0051"
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.
7674dependencies {
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
104100test {
@@ -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
111112wpi. 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
145179project. compileJava. dependsOn(spotlessApply)
146180spotless {
0 commit comments