@@ -16,46 +16,78 @@ repositories {
1616// This is added by GradleRIO's backing project EmbeddedTools.
1717deploy {
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+
4448dependencies {
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.
5883jar {
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)
0 commit comments