Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2026.2.1"
id "com.peterabeles.gversion" version "1.11.0"
}

java {
Expand Down Expand Up @@ -105,3 +106,12 @@ wpi.java.configureTestTasks(test)
tasks.withType(JavaCompile) {
options.compilerArgs.add '-XDstringConcat=inline'
}
project.compileJava.dependsOn(createVersionFile)
gversion {
srcDir = "src/main/java/"
classPackage = "frc.robot"
className = "BuildConstants"
dateFormat = "yyyy-MM-dd HH:mm:ss z"
timeZone = "America/Chicago"
indent = " "
}
19 changes: 19 additions & 0 deletions src/main/java/frc/robot/BuildConstants.java

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've gitignored this file in another pull request (#3) since it's a file autogenerated at build time. we should remove it from the git history, as it's essentially useless in the repo.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package frc.robot;

/**
* Automatically generated build version information. Do not modify.
*/
public final class BuildConstants {
public static final String MAVEN_GROUP = "";
public static final String MAVEN_NAME = "robot-base";
public static final String VERSION = "unspecified";
public static final int GIT_REVISION = 701;
public static final String GIT_SHA = "79d8d5e24169a9e141f6ee401ebfc31a1be7b4f0";
public static final String GIT_DATE = "2026-05-26 13:48:56 CDT";
public static final String GIT_BRANCH = "Main-branch-bug-fixes";
public static final String BUILD_DATE = "2026-06-04 18:31:36 CDT";
public static final long BUILD_UNIX_TIME = 1780615896475L;
public static final int DIRTY = 1;

private BuildConstants(){}
}
36 changes: 18 additions & 18 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,24 @@ public Robot() {
public void robotInit() {
m_robotContainer = new RobotContainer();
// Put git/code version metadata on networktables
NetworkTable versionTable = NetworkTableInstance.getDefault()
.getTable("Version");
versionTable.putValue(
"GIT_SHA",
NetworkTableValue.makeString(BuildConstants.GIT_SHA)
);
versionTable.putValue(
"BUILD_DATE",
NetworkTableValue.makeString(BuildConstants.BUILD_DATE)
);
versionTable.putValue(
"GIT_BRANCH",
NetworkTableValue.makeString(BuildConstants.GIT_BRANCH)
);
versionTable.putValue(
"DIRTY",
NetworkTableValue.makeBoolean(BuildConstants.DIRTY != 0)
);
// NetworkTable versionTable = NetworkTableInstance.getDefault()
// .getTable("Version");
// versionTable.putValue(
// "GIT_SHA",
// NetworkTableValue.makeString(BuildConstants.GIT_SHA)
// );
// versionTable.putValue(
// "BUILD_DATE",
// NetworkTableValue.makeString(BuildConstants.BUILD_DATE)
// );
// versionTable.putValue(
// "GIT_BRANCH",
// NetworkTableValue.makeString(BuildConstants.GIT_BRANCH)
// );
// versionTable.putValue(
// "DIRTY",
// NetworkTableValue.makeBoolean(BuildConstants.DIRTY != 0)
// );

WebServer.start(5800, Filesystem.getDeployDirectory().getPath());

Expand Down
5 changes: 2 additions & 3 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import frc.robot.Constants.MetaConstants;
import frc.robot.Constants.RobotConstants;
import frc.robot.commands.control.DriveCommand;
import frc.robot.commands.util.MatchtimeStatusCommand;

import frc.robot.commands.util.VoltageStatusCommand;
import frc.robot.Constants.DriveConstants;
import frc.robot.subsystems.limelight.LimelightSubsystem;
Expand Down Expand Up @@ -137,8 +137,7 @@ private static void configureCommands() {
Elastic.selectTab("Autonomous");
}),

new VoltageStatusCommand(),
new MatchtimeStatusCommand()
new VoltageStatusCommand()
)
);

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/commands/control/DriveCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import edu.wpi.first.wpilibj.XboxController;

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import frc.robot.subsystems.SwerveSubsystem;
import frc.robot.subsystems.drive.SwerveSubsystem;
import frc.robot.Constants.DriveConstants;
import frc.robot.Constants.MetaConstants;

Expand Down