Skip to content

Commit c7e2579

Browse files
committed
fix all build issues
1 parent ead4772 commit c7e2579

41 files changed

Lines changed: 745 additions & 561 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# team4099 added stuff
2+
/src/main/kotlin/com/team4099/robot2025/BuildConstants.kt
3+
4+
**/*.hprof
5+
16
# This gitignore has been specially created by the WPILib team.
27
# If you remove items from this file, intellisense might break.
38

WPILib-License.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without
55
modification, are permitted provided that the following conditions are met:
6-
* Redistributions of source code must retain the above copyright
7-
notice, this list of conditions and the following disclaimer.
8-
* Redistributions in binary form must reproduce the above copyright
9-
notice, this list of conditions and the following disclaimer in the
10-
documentation and/or other materials provided with the distribution.
11-
* Neither the name of FIRST, WPILib, nor the names of other WPILib
12-
contributors may be used to endorse or promote products derived from
13-
this software without specific prior written permission.
6+
* Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
* Redistributions in binary form must reproduce the above copyright
9+
notice, this list of conditions and the following disclaimer in the
10+
documentation and/or other materials provided with the distribution.
11+
* Neither the name of FIRST, WPILib, nor the names of other WPILib
12+
contributors may be used to endorse or promote products derived from
13+
this software without specific prior written permission.
1414

1515
THIS SOFTWARE IS PROVIDED BY FIRST AND OTHER WPILIB CONTRIBUTORS "AS IS" AND
1616
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED

build.gradle

Lines changed: 43 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
plugins {
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.
1919
deploy {
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

5454
def deployArtifact = deploy.targets.roborio.artifacts.frcJava
@@ -68,8 +68,8 @@ def includeDesktopSupport = true
6868

6969
// Configuration for AdvantageKit
7070
task(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
}
110110
test {
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.
122122
jar {
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

131131
spotless {
@@ -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

170152
wrapper {
@@ -179,7 +161,7 @@ wpi.java.configureTestTasks(test)
179161

180162
// Configure string concat to always inline compile
181163
tasks.withType(JavaCompile) {
182-
options.compilerArgs.add '-XDstringConcat=inline'
164+
options.compilerArgs.add '-XDstringConcat=inline'
183165
}
184166

185167
compileKotlin {
@@ -246,4 +228,4 @@ task(eventDeploy) {
246228
}
247229
}
248230
}
249-
createVersionFile.dependsOn(eventDeploy)
231+
createVersionFile.dependsOn(eventDeploy)

settings.gradle

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
import org.gradle.internal.os.OperatingSystem
22

33
pluginManagement {
4-
repositories {
5-
mavenLocal()
6-
gradlePluginPortal()
7-
String frcYear = '2026'
8-
File frcHome
9-
if (OperatingSystem.current().isWindows()) {
10-
String publicFolder = System.getenv('PUBLIC')
11-
if (publicFolder == null) {
12-
publicFolder = "C:\\Users\\Public"
13-
}
14-
def homeRoot = new File(publicFolder, "wpilib")
15-
frcHome = new File(homeRoot, frcYear)
16-
} else {
17-
def userFolder = System.getProperty("user.home")
18-
def homeRoot = new File(userFolder, "wpilib")
19-
frcHome = new File(homeRoot, frcYear)
20-
}
21-
def frcHomeMaven = new File(frcHome, 'maven')
22-
maven {
23-
name = 'frcHome'
24-
url = frcHomeMaven
25-
}
26-
}
4+
repositories {
5+
mavenLocal()
6+
gradlePluginPortal()
7+
String frcYear = '2026'
8+
File frcHome
9+
if (OperatingSystem.current().isWindows()) {
10+
String publicFolder = System.getenv('PUBLIC')
11+
if (publicFolder == null) {
12+
publicFolder = "C:\\Users\\Public"
13+
}
14+
def homeRoot = new File(publicFolder, "wpilib")
15+
frcHome = new File(homeRoot, frcYear)
16+
} else {
17+
def userFolder = System.getProperty("user.home")
18+
def homeRoot = new File(userFolder, "wpilib")
19+
frcHome = new File(homeRoot, frcYear)
20+
}
21+
def frcHomeMaven = new File(frcHome, 'maven')
22+
maven {
23+
name = 'frcHome'
24+
url = frcHomeMaven
25+
}
26+
}
2727
}
2828

2929
Properties props = System.getProperties();
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
package com.team4099.lib.hal
22

33
import edu.wpi.first.wpilibj.RobotController
4-
import org.littletonrobotics.junction.Logger
54
import org.team4099.lib.units.base.Time
65
import org.team4099.lib.units.base.seconds
76
import org.team4099.lib.units.micro
87

98
object Clock {
109
val fpgaTime: Time
1110
get() = RobotController.getFPGATime().micro.seconds
12-
13-
1411
}

src/main/kotlin/com/team4099/lib/logging/LoggedTunableNumber.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,10 @@ class LoggedTunableNumber(dashboardKey: String) {
3737
this.defaultValue = defaultValue
3838
if (Constants.Tuning.TUNING_MODE) {
3939
Logger.registerDashboardInput(LoggedNetworkNumber(key))
40-
}
41-
//dashboardNumber = LoggedDashboardNumber(key, defaultValue)
4240
}
41+
// dashboardNumber = LoggedDashboardNumber(key, defaultValue)
4342
}
44-
43+
}
4544

4645
/**
4746
* Get the current value, from dashboard if available and in tuning mode.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package com.team4099.lib.vision
22

33
import com.team4099.robot2025.config.constants.VisionConstants
4-
import org.team4099.lib.geometry.Translation2d
4+
import org.team4099.lib.geometry.Translation3d
55
import org.team4099.lib.units.base.Time
66

77
data class TimestampedObjectVisionUpdate(
88
val timestamp: Time,
99
val targetClass: VisionConstants.OBJECT_CLASS,
10-
val robotTObject: Translation2d
10+
val robotTObject: Translation3d
1111
)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.team4099.lib.vision
22

3-
import org.team4099.lib.geometry.Transform2d
3+
import org.team4099.lib.geometry.Transform3d
44
import org.team4099.lib.units.base.Time
55

66
data class TimestampedTrigVisionUpdate(
77
val timestamp: Time,
88
val targetTagID: Int,
9-
val robotTReefTag: Transform2d,
9+
val robotTTargetTag: Transform3d,
1010
)

src/main/kotlin/com/team4099/robot2025/BuildConstants.kt

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/main/kotlin/com/team4099/robot2025/Robot.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ object Robot : LoggedRobot() {
149149
.withWidget(BuiltInWidgets.kTextView)
150150
.entry
151151

152-
CommandScheduler.getInstance().schedule( FollowPathCommand.warmupCommand())
152+
CommandScheduler.getInstance().schedule(FollowPathCommand.warmupCommand())
153153

154154
Logger.recordOutput("RobotSimulation/simulateVision", Constants.Universal.SIMULATE_VISION)
155155

@@ -160,7 +160,7 @@ object Robot : LoggedRobot() {
160160

161161
override fun autonomousInit() {
162162
val autonCommandWithWait = runOnce({ RobotContainer.zeroSensors() }).andThen(autonomousCommand)
163-
CommandScheduler.getInstance().schedule( autonCommandWithWait)
163+
CommandScheduler.getInstance().schedule(autonCommandWithWait)
164164
}
165165

166166
override fun disabledPeriodic() {

0 commit comments

Comments
 (0)