11plugins {
2- id " java"
3- id " org.jetbrains.kotlin.jvm" version " 1.6.0"
4- id " edu.wpi.first.GradleRIO" version " 2026.1 .1"
5- id " com.diffplug.spotless" version " 6.3.0"
2+ id " java"
3+ id " org.jetbrains.kotlin.jvm" version " 1.6.0"
4+ id " edu.wpi.first.GradleRIO" version " 2026.2 .1"
5+ id " com.diffplug.spotless" version " 6.3.0"
66 id " com.peterabeles.gversion" version " 1.10"
77 id " org.jetbrains.kotlinx.kover" version " 0.4.2"
88}
@@ -17,38 +17,38 @@ def ROBOT_MAIN_CLASS = "com.team4099.robot2026.Main"
1717// Define my targets (RoboRIO) and artifacts (deployable files)
1818// This is added by GradleRIO's backing project DeployUtils.
1919deploy {
20- targets {
21- roborio(getTargetTypeClass(' RoboRIO' )) {
22- // Team number is loaded either from the .wpilib/wpilib_preferences.json
23- // or from command line. If not found an exception will be thrown.
24- // You can use getTeamOrDefault(team) instead of getTeamNumber if you
25- // want to store a team number in this file.
26- team = TEAM
27- debug = project. frc. getDebugOrDefault(false )
28-
29- artifacts {
30- // First part is artifact name, 2nd is artifact type
31- // getTargetTypeClass is a shortcut to get the class type using a string
32-
33- frcJava(getArtifactTypeClass(' FRCJavaArtifact' )) {
34- jvmArgs. add(" -Dcom.sun.management.jmxremote=true" )
20+ targets {
21+ roborio(getTargetTypeClass(' RoboRIO' )) {
22+ // Team number is loaded either from the .wpilib/wpilib_preferences.json
23+ // or from command line. If not found an exception will be thrown.
24+ // You can use getTeamOrDefault(team) instead of getTeamNumber if you
25+ // want to store a team number in this file.
26+ team = TEAM
27+ debug = project. frc. getDebugOrDefault(false )
28+
29+ artifacts {
30+ // First part is artifact name, 2nd is artifact type
31+ // getTargetTypeClass is a shortcut to get the class type using a string
32+
33+ frcJava(getArtifactTypeClass(' FRCJavaArtifact' )) {
34+ jvmArgs. add(" -Dcom.sun.management.jmxremote=true" )
3535 jvmArgs. add(" -Dcom.sun.management.jmxremote.port=1198" )
3636 jvmArgs. add(" -Dcom.sun.management.jmxremote.local.only=false" )
3737 jvmArgs. add(" -Dcom.sun.management.jmxremote.ssl=false" )
3838 jvmArgs. add(" -Dcom.sun.management.jmxremote.authenticate=false" )
3939 jvmArgs. add(" -Djava.rmi.server.hostname=10.40.99.2" )
40- }
41-
42- // Static files artifact
43- frcStaticFileDeploy(getArtifactTypeClass(' FileTreeArtifact' )) {
44- files = project. fileTree(' src/main/deploy' )
45- directory = ' /home/lvuser/deploy'
46- deleteOldFiles = false // Change to true to delete files on roboRIO that no
47- // longer exist in deploy directory of this project
48- }
49- }
50- }
51- }
40+ }
41+
42+ // Static files artifact
43+ frcStaticFileDeploy(getArtifactTypeClass(' FileTreeArtifact' )) {
44+ files = project. fileTree(' src/main/deploy' )
45+ directory = ' /home/lvuser/deploy'
46+ deleteOldFiles = false // Change to true to delete files on roboRIO that no
47+ // longer exist in deploy directory of this project
48+ }
49+ }
50+ }
51+ }
5252}
5353
5454def deployArtifact = deploy. targets. roborio. artifacts. frcJava
@@ -68,8 +68,8 @@ def includeDesktopSupport = true
6868
6969// Configuration for AdvantageKit
7070task(replayWatch, type : JavaExec ) {
71- mainClass = " org.littletonrobotics.junction.ReplayWatch"
72- classpath = sourceSets. main. runtimeClasspath
71+ mainClass = " org.littletonrobotics.junction.ReplayWatch"
72+ classpath = sourceSets. main. runtimeClasspath
7373}
7474
7575// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
@@ -108,8 +108,8 @@ dependencies {
108108 annotationProcessor " org.littletonrobotics.akit:akit-autolog:$akitJson . version "
109109}
110110test {
111- useJUnitPlatform()
112- systemProperty ' junit.jupiter.extensions.autodetection.enabled' , ' true'
111+ useJUnitPlatform()
112+ systemProperty ' junit.jupiter.extensions.autodetection.enabled' , ' true'
113113}
114114
115115// Simulation configuration (e.g. environment variables).
@@ -120,12 +120,12 @@ wpi.sim.addDriverstation()
120120// in order to make them all available at runtime. Also adding the manifest so WPILib
121121// knows where to look for our Robot Class.
122122jar {
123- from { configurations. runtimeClasspath. collect { it. isDirectory() ? it : zipTree(it) } }
124- from(' src' ) { into ' backup/src' }
125- from(' vendordeps' ) { into ' backup/vendordeps' }
126- from(' build.gradle' ) { into ' backup' }
127- manifest edu.wpi.first.gradlerio.GradleRIOPlugin . javaManifest(ROBOT_MAIN_CLASS )
128- duplicatesStrategy = DuplicatesStrategy . INCLUDE
123+ from { configurations. runtimeClasspath. collect { it. isDirectory() ? it : zipTree(it) } }
124+ from(' src' ) { into ' backup/src' }
125+ from(' vendordeps' ) { into ' backup/vendordeps' }
126+ from(' build.gradle' ) { into ' backup' }
127+ manifest edu.wpi.first.gradlerio.GradleRIOPlugin . javaManifest(ROBOT_MAIN_CLASS )
128+ duplicatesStrategy = DuplicatesStrategy . INCLUDE
129129}
130130
131131spotless {
@@ -147,24 +147,6 @@ spotless {
147147 ktfmt()
148148 ktlint(). userData([' max_line_length' : ' 120' , ' insert_final_newline' : ' true' , ' indent_size' : ' 2' , ' continuation_indent_size' : ' 2' ])
149149 }
150-
151- groovyGradle {
152- target fileTree(" ." ) {
153- include " **/*.gradle"
154- exclude " **/build/**" , " **/build-*/**"
155- }
156- greclipse()
157- indentWithSpaces(4 )
158- trimTrailingWhitespace()
159- endWithNewline()
160- }
161- json {
162- target fileTree(" ." ) {
163- include " **/*.json"
164- exclude " **/build/**" , " **/build-*/**"
165- }
166- gson(). indentWithSpaces(2 )
167- }
168150}
169151
170152wrapper {
@@ -179,7 +161,7 @@ wpi.java.configureTestTasks(test)
179161
180162// Configure string concat to always inline compile
181163tasks. withType(JavaCompile ) {
182- options. compilerArgs. add ' -XDstringConcat=inline'
164+ options. compilerArgs. add ' -XDstringConcat=inline'
183165}
184166
185167compileKotlin {
@@ -246,4 +228,4 @@ task(eventDeploy) {
246228 }
247229 }
248230}
249- createVersionFile. dependsOn(eventDeploy)
231+ createVersionFile. dependsOn(eventDeploy)
0 commit comments