Skip to content

Commit 1442587

Browse files
authored
Merge pull request #13 from Flash3388/development
Development
2 parents f7ee783 + e4e5d6f commit 1442587

33 files changed

Lines changed: 596 additions & 273 deletions

File tree

examples/robot/autonomous-sequence-timed/build.gradle

Lines changed: 55 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,78 @@ repositories {
1616
// This is added by GradleRIO's backing project EmbeddedTools.
1717
deploy {
1818
targets {
19-
roboRIO("roborio") {
19+
roborio(getTargetTypeClass('RoboRIO')) {
2020
// Team number is loaded either from the .wpilib/wpilib_preferences.json
2121
// or from command line. If not found an exception will be thrown.
2222
// You can use getTeamOrDefault(team) instead of getTeamNumber if you
2323
// want to store a team number in this file.
2424
team = 3388
25-
}
26-
}
27-
artifacts {
28-
frcJavaArtifact('frcJava') {
29-
targets << "roborio"
30-
// Debug can be overridden by command line, for use with VSCode
31-
debug = frc.getDebugOrDefault(false)
32-
}
33-
// Built in artifact to deploy arbitrary files to the roboRIO.
34-
fileTreeArtifact('frcStaticFileDeploy') {
35-
// The directory below is the local directory to deploy
36-
files = fileTree(dir: 'src/main/deploy')
37-
// Deploy to RoboRIO target, into /home/lvuser/deploy
38-
targets << "roborio"
39-
directory = '/home/lvuser/deploy'
25+
debug = false
26+
27+
artifacts {
28+
// First part is artifact name, 2nd is artifact type
29+
// getTargetTypeClass is a shortcut to get the class type using a string
30+
31+
frcJava(getArtifactTypeClass('FRCJavaArtifact')) {
32+
}
33+
34+
// Static files artifact
35+
frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) {
36+
files = project.fileTree('src/main/deploy')
37+
directory = '/home/lvuser/deploy'
38+
}
39+
}
4040
}
4141
}
4242
}
4343

44+
def deployArtifact = deploy.targets.roborio.artifacts.frcJava
45+
46+
wpi.java.debugJni = false
47+
4448
dependencies {
45-
compile wpi.deps.wpilib()
46-
compile wpi.deps.vendor.java()
49+
implementation flashlib()
50+
implementation project(':flashlib.frc.robot')
51+
52+
implementation wpi.java.deps.wpilib()
53+
implementation wpi.java.vendor.java()
4754

48-
compile flashlib()
49-
compile project(':flashlib.frc.robot')
55+
roborioDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.roborio)
56+
roborioDebug wpi.java.vendor.jniDebug(wpi.platforms.roborio)
5057

51-
nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio)
52-
nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop)
58+
roborioRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio)
59+
roborioRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio)
60+
61+
nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop)
62+
nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop)
63+
simulationDebug wpi.sim.enableDebug()
64+
65+
nativeRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.desktop)
66+
nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop)
67+
simulationRelease wpi.sim.enableRelease()
5368
}
5469

70+
// Simulation configuration (e.g. environment variables).
71+
72+
wpi.sim.addGui().defaultEnabled = true
73+
wpi.sim.addDriverstation()
74+
75+
//Sets the websocket client remote host.
76+
wpi.sim.envVar("HALSIMWS_HOST", "10.0.0.2")
77+
wpi.sim.addWebsocketsServer().defaultEnabled = true
78+
wpi.sim.addWebsocketsClient().defaultEnabled = true
79+
5580
// Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar')
5681
// in order to make them all available at runtime. Also adding the manifest so WPILib
5782
// knows where to look for our Robot Class.
5883
jar {
59-
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
84+
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
85+
6086
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
87+
88+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
6189
}
90+
91+
deployArtifact.jarTask = jar
92+
wpi.java.configureExecutableTasks(jar)
93+
wpi.java.configureTestTasks(test)

examples/robot/autonomous-sequence-timed/src/main/java/frc/team3388/robot/Robot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import com.flash3388.flashlib.robot.systems.drive.TankDriveSystem;
99
import com.flash3388.flashlib.robot.systems.drive.actions.TankDriveAction;
1010
import com.flash3388.flashlib.time.Time;
11-
import edu.wpi.first.wpilibj.PWMTalonSRX;
11+
import edu.wpi.first.wpilibj.motorcontrol.PWMTalonSRX;
1212

1313
public class Robot extends DelegatingRobotControl implements IterativeFrcRobot {
1414

examples/robot/multisystem/build.gradle

Lines changed: 55 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,78 @@ repositories {
1616
// This is added by GradleRIO's backing project EmbeddedTools.
1717
deploy {
1818
targets {
19-
roboRIO("roborio") {
19+
roborio(getTargetTypeClass('RoboRIO')) {
2020
// Team number is loaded either from the .wpilib/wpilib_preferences.json
2121
// or from command line. If not found an exception will be thrown.
2222
// You can use getTeamOrDefault(team) instead of getTeamNumber if you
2323
// want to store a team number in this file.
2424
team = 3388
25-
}
26-
}
27-
artifacts {
28-
frcJavaArtifact('frcJava') {
29-
targets << "roborio"
30-
// Debug can be overridden by command line, for use with VSCode
31-
debug = frc.getDebugOrDefault(false)
32-
}
33-
// Built in artifact to deploy arbitrary files to the roboRIO.
34-
fileTreeArtifact('frcStaticFileDeploy') {
35-
// The directory below is the local directory to deploy
36-
files = fileTree(dir: 'src/main/deploy')
37-
// Deploy to RoboRIO target, into /home/lvuser/deploy
38-
targets << "roborio"
39-
directory = '/home/lvuser/deploy'
25+
debug = false
26+
27+
artifacts {
28+
// First part is artifact name, 2nd is artifact type
29+
// getTargetTypeClass is a shortcut to get the class type using a string
30+
31+
frcJava(getArtifactTypeClass('FRCJavaArtifact')) {
32+
}
33+
34+
// Static files artifact
35+
frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) {
36+
files = project.fileTree('src/main/deploy')
37+
directory = '/home/lvuser/deploy'
38+
}
39+
}
4040
}
4141
}
4242
}
4343

44+
def deployArtifact = deploy.targets.roborio.artifacts.frcJava
45+
46+
wpi.java.debugJni = false
47+
4448
dependencies {
45-
compile wpi.deps.wpilib()
46-
compile wpi.deps.vendor.java()
49+
implementation flashlib()
50+
implementation project(':flashlib.frc.robot')
51+
52+
implementation wpi.java.deps.wpilib()
53+
implementation wpi.java.vendor.java()
4754

48-
compile flashlib()
49-
compile project(':flashlib.frc.robot')
55+
roborioDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.roborio)
56+
roborioDebug wpi.java.vendor.jniDebug(wpi.platforms.roborio)
5057

51-
nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio)
52-
nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop)
58+
roborioRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio)
59+
roborioRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio)
60+
61+
nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop)
62+
nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop)
63+
simulationDebug wpi.sim.enableDebug()
64+
65+
nativeRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.desktop)
66+
nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop)
67+
simulationRelease wpi.sim.enableRelease()
5368
}
5469

70+
// Simulation configuration (e.g. environment variables).
71+
72+
wpi.sim.addGui().defaultEnabled = true
73+
wpi.sim.addDriverstation()
74+
75+
//Sets the websocket client remote host.
76+
wpi.sim.envVar("HALSIMWS_HOST", "10.0.0.2")
77+
wpi.sim.addWebsocketsServer().defaultEnabled = true
78+
wpi.sim.addWebsocketsClient().defaultEnabled = true
79+
5580
// Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar')
5681
// in order to make them all available at runtime. Also adding the manifest so WPILib
5782
// knows where to look for our Robot Class.
5883
jar {
59-
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
84+
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
85+
6086
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
87+
88+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
6189
}
90+
91+
deployArtifact.jarTask = jar
92+
wpi.java.configureExecutableTasks(jar)
93+
wpi.java.configureTestTasks(test)

examples/robot/multisystem/src/main/java/frc/team3388/robot/Robot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import com.flash3388.flashlib.robot.systems.drive.TankDriveSystem;
1313
import com.flash3388.flashlib.robot.systems.drive.actions.TankDriveAction;
1414
import com.flash3388.flashlib.time.Time;
15-
import edu.wpi.first.wpilibj.PWMTalonSRX;
15+
import edu.wpi.first.wpilibj.motorcontrol.PWMTalonSRX;
1616

1717
public class Robot extends DelegatingRobotControl implements IterativeFrcRobot {
1818

examples/robot/omnidrive-system/build.gradle

Lines changed: 55 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,78 @@ repositories {
1616
// This is added by GradleRIO's backing project EmbeddedTools.
1717
deploy {
1818
targets {
19-
roboRIO("roborio") {
19+
roborio(getTargetTypeClass('RoboRIO')) {
2020
// Team number is loaded either from the .wpilib/wpilib_preferences.json
2121
// or from command line. If not found an exception will be thrown.
2222
// You can use getTeamOrDefault(team) instead of getTeamNumber if you
2323
// want to store a team number in this file.
2424
team = 3388
25-
}
26-
}
27-
artifacts {
28-
frcJavaArtifact('frcJava') {
29-
targets << "roborio"
30-
// Debug can be overridden by command line, for use with VSCode
31-
debug = frc.getDebugOrDefault(false)
32-
}
33-
// Built in artifact to deploy arbitrary files to the roboRIO.
34-
fileTreeArtifact('frcStaticFileDeploy') {
35-
// The directory below is the local directory to deploy
36-
files = fileTree(dir: 'src/main/deploy')
37-
// Deploy to RoboRIO target, into /home/lvuser/deploy
38-
targets << "roborio"
39-
directory = '/home/lvuser/deploy'
25+
debug = false
26+
27+
artifacts {
28+
// First part is artifact name, 2nd is artifact type
29+
// getTargetTypeClass is a shortcut to get the class type using a string
30+
31+
frcJava(getArtifactTypeClass('FRCJavaArtifact')) {
32+
}
33+
34+
// Static files artifact
35+
frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) {
36+
files = project.fileTree('src/main/deploy')
37+
directory = '/home/lvuser/deploy'
38+
}
39+
}
4040
}
4141
}
4242
}
4343

44+
def deployArtifact = deploy.targets.roborio.artifacts.frcJava
45+
46+
wpi.java.debugJni = false
47+
4448
dependencies {
45-
compile wpi.deps.wpilib()
46-
compile wpi.deps.vendor.java()
49+
implementation flashlib()
50+
implementation project(':flashlib.frc.robot')
51+
52+
implementation wpi.java.deps.wpilib()
53+
implementation wpi.java.vendor.java()
4754

48-
compile flashlib()
49-
compile project(':flashlib.frc.robot')
55+
roborioDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.roborio)
56+
roborioDebug wpi.java.vendor.jniDebug(wpi.platforms.roborio)
5057

51-
nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio)
52-
nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop)
58+
roborioRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio)
59+
roborioRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio)
60+
61+
nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop)
62+
nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop)
63+
simulationDebug wpi.sim.enableDebug()
64+
65+
nativeRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.desktop)
66+
nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop)
67+
simulationRelease wpi.sim.enableRelease()
5368
}
5469

70+
// Simulation configuration (e.g. environment variables).
71+
72+
wpi.sim.addGui().defaultEnabled = true
73+
wpi.sim.addDriverstation()
74+
75+
//Sets the websocket client remote host.
76+
wpi.sim.envVar("HALSIMWS_HOST", "10.0.0.2")
77+
wpi.sim.addWebsocketsServer().defaultEnabled = true
78+
wpi.sim.addWebsocketsClient().defaultEnabled = true
79+
5580
// Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar')
5681
// in order to make them all available at runtime. Also adding the manifest so WPILib
5782
// knows where to look for our Robot Class.
5883
jar {
59-
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
84+
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
85+
6086
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
87+
88+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
6189
}
90+
91+
deployArtifact.jarTask = jar
92+
wpi.java.configureExecutableTasks(jar)
93+
wpi.java.configureTestTasks(test)

examples/robot/omnidrive-system/src/main/java/frc/team3388/robot/Robot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import com.flash3388.flashlib.robot.systems.drive.OmniDriveSystem;
1111
import com.flash3388.flashlib.robot.systems.drive.actions.OmniDriveAction;
1212
import com.flash3388.flashlib.scheduling.actions.Actions;
13-
import edu.wpi.first.wpilibj.PWMTalonSRX;
13+
import edu.wpi.first.wpilibj.motorcontrol.PWMTalonSRX;
1414

1515
public class Robot extends DelegatingRobotControl implements IterativeFrcRobot {
1616

0 commit comments

Comments
 (0)