Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for CommandBase/Subsystem Base removal #542

Merged
merged 3 commits into from
Jul 30, 2023
Merged
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
3 changes: 2 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ stages:

variables:
DISPLAY: ':10'
MACOSX_DEPLOYMENT_TARGET: 11

steps:
- bash: |
Expand Down Expand Up @@ -59,7 +60,7 @@ stages:

- job: Mac
pool:
vmImage: 'macOS-11'
vmImage: 'macOS-12'
steps:
- script: |
mkdir build
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/robotbuilder/RobotBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
public class RobotBuilder {

public static final int VERSION_MAJOR = 5;
public static final int VERSION_MAJOR = 6;
public static final int VERSION_MINOR = 0;

public static final String VERSION = VERSION_MAJOR + "." + VERSION_MINOR;
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/export/cpp/ExportDescription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Instructions:
Defaults: "None"
Export: "RobotContainer"
Import: "\\#include \"subsystems/#class($Short_Name).h\""
ClassName: "frc2::SubsystemBase"
ClassName: "frc2::Subsystem"
PID Subsystem:
Defaults: "None"
Export: "RobotContainer"
Expand Down Expand Up @@ -343,7 +343,7 @@ Instructions:

Command:
Defaults: "Command,None"
ClassName: "frc2::CommandBase"
ClassName: "frc2::Command"
Sequential Command Group:
Defaults: "Command,None"
PID Command:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/export/cpp/RobotContainer-prototypes.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// The robot's subsystems
#foreach ($component in $components)
#if ("#type($component)" != ""
&& ("#type($component)" == "frc2::SubsystemBase"
&& ("#type($component)" == "frc2::Subsystem"
|| "#type($component)" == "frc2::PIDSubsystem"))
#class($component.getName()) #variable($component.getName());
#end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#foreach ($component in $components)
#if ("#type($component)" == "frc2::SubsystemBase" || "#type($component)" == "frc2::PIDSubsystem")
#if ("#type($component)" == "frc2::Subsystem" || "#type($component)" == "frc2::PIDSubsystem")
#foreach ($command in $commands)
#if($command.name == $component.getProperty("Default Command").value)
#set($params = $component.getProperty("Default command parameters").getValue())
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/export/cpp/SetpointCommand-includes.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

\#include "frc2/command/CommandBase.h"
\#include "frc2/command/Command.h"
\#include "frc2/command/CommandHelper.h"
\#include "subsystems/#class(${command.getProperty("Requires").getValue()}).h"
2 changes: 1 addition & 1 deletion src/main/resources/export/cpp/SetpointCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @author ExampleAuthor
*/
class #class($command.name): public frc2::CommandHelper<frc2::CommandBase, #class($command.name)> {
class #class($command.name): public frc2::CommandHelper<frc2::Command, #class($command.name)> {
public:
#@autogenerated_code("constructor", " ")
#parse("${exporter_path}SetpointCommand-constructor-header.h")
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/export/cpp/Subsystem-includes.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
\#include <frc2/command/SubsystemBase.h>
\#include <frc2/command/Subsystem.h>
${helper.getImports($subsystem, "RobotMap")}
2 changes: 1 addition & 1 deletion src/main/resources/export/cpp/Subsystem.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#set($subsystem = $helper.getByName($subsystem_name, $robot))
#macro( klass $cmd )#if( "#type($cmd)" == "" )SendableSubsystemBase#elsefrc::#type($cmd)#end#end
#macro( klass $cmd )#if( "#type($cmd)" == "" )Subsystem#elsefrc::#type($cmd)#end#end
#header()
// ROBOTBUILDER TYPE: Subsystem.

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/export/cpp/Subsystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @author ExampleAuthor
*/
class #class($subsystem.name): public frc2::SubsystemBase {
class #class($subsystem.name): public frc2::Subsystem {
private:
// It's desirable that everything possible is private except
// for methods that implement subsystem capabilities
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/export/cpp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ plugins {
id "edu.wpi.first.GradleRIO" version "${wpilib_version}"
}

wpi.maven.useLocal = false
wpi.maven.useDevelopment = true
wpi.versions.wpilibVersion = '2023.+'
wpi.versions.wpimathVersion = '2023.+'

// Define my targets (RoboRIO) and artifacts (deployable files)
// This is added by GradleRIO's backing project DeployTools.
deploy {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/export/cpp/command-includes.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

\#include <frc2/command/CommandHelper.h>
\#include <frc2/command/CommandBase.h>
\#include <frc2/command/Command.h>

#if (${command.getProperty("Requires").getValue()} != "None")
\#include "subsystems/#class(${command.getProperty("Requires").getValue()}).h"
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/export/java/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
package ${package}.commands;
#set($command = $helper.getByName($command_name, $robot))
#set($params = $command.getProperty("Parameters").getValue())
#macro( klass $cmd )#if( "#type($cmd)" == "" )CommandBase#else#type($cmd)#end#end
import edu.wpi.first.wpilibj2.command.CommandBase;
#macro( klass $cmd )#if( "#type($cmd)" == "" )Command#else#type($cmd)#end#end
import edu.wpi.first.wpilibj2.command.Command;
import java.util.function.DoubleSupplier;

#@autogenerated_code("imports", "")
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/export/java/ExportDescription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Instructions:
Import: "import ${package}.subsystems.*;"
Declaration: "private #class($Short_Name) #variable($Short_Name);"
Construction: "#variable($Short_Name) = new #class($Short_Name)();"
ClassName: "SubsystemBase"
ClassName: "Subsystem"
PID Subsystem:
Defaults: "None"
Export: "RobotContainer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#foreach ($component in $components)
#if ($helper.exportsTo("RobotContainer", $component)
&& "#type($component)" != ""
&& ("#type($component)" == "SubsystemBase"
&& ("#type($component)" == "Subsystem"
|| "#type($component)" == "PIDSubsystem"))
public final #class($component.getName()) m_#variable($component.getName()) = new #class($component.getName())();
#end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#foreach ($component in $components)
#if ($helper.exportsTo("RobotContainer", $component)
&& "#type($component)" != ""
&& ("#type($component)" == "SubsystemBase"
&& ("#type($component)" == "Subsystem"
|| "#type($component)" == "PIDSubsystem"))
#foreach ($command in $commands)
#if($command.name == $component.getProperty("Default Command").value)
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/export/java/SetpointCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#set($command = $helper.getByName($command_name, $robot))

import java.util.function.DoubleSupplier;
import edu.wpi.first.wpilibj2.command.CommandBase;
import edu.wpi.first.wpilibj2.command.Command;
import ${package}.Robot;
#@autogenerated_code("imports", "")
#parse("${exporter_path}Command-imports.java")
Expand All @@ -14,7 +14,7 @@
/**
*
*/
public class #class($command.name) extends CommandBase {
public class #class($command.name) extends Command {

#@autogenerated_code("variable_declarations", " ")
#parse("${exporter_path}Command-variable-declarations.java")
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/export/java/Subsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

package ${package}.subsystems;
#set($subsystem = $helper.getByName($subsystem_name, $robot))
#macro( klass $cmd )#if( "#type($cmd)" == "" ) SubsystemBase #else#type($cmd)#end#end
#macro( klass $cmd )#if( "#type($cmd)" == "" ) Subsystem #else#type($cmd)#end#end


import ${package}.commands.*;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import edu.wpi.first.wpilibj2.command.Subsystem;

#@autogenerated_code("imports", "")
#parse("${exporter_path}Subsystem-imports.java")
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/export/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ plugins {
id "edu.wpi.first.GradleRIO" version "${wpilib_version}"
}

wpi.maven.useLocal = false
wpi.maven.useDevelopment = true
wpi.versions.wpilibVersion = '2023.+'
wpi.versions.wpimathVersion = '2023.+'

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

Expand Down
Loading