|
1 | 1 | plugins {
|
2 | 2 | id "java"
|
3 |
| - id "edu.wpi.first.GradleRIO" version "2019.0.0-alpha-3" |
| 3 | + id "edu.wpi.first.GradleRIO" version "2019.3.2" |
4 | 4 | }
|
5 | 5 |
|
6 |
| -def ROBOT_CLASS = "frc.robot.Robot" |
| 6 | +def ROBOT_MAIN_CLASS = "frc.robot.Main" |
7 | 7 |
|
8 | 8 | // Define my targets (RoboRIO) and artifacts (deployable files)
|
9 | 9 | // This is added by GradleRIO's backing project EmbeddedTools.
|
10 | 10 | deploy {
|
11 | 11 | targets {
|
12 |
| - target("roborio", edu.wpi.first.gradlerio.frc.RoboRIO) { |
| 12 | + roboRIO("roborio") { |
13 | 13 | // Team number is loaded either from the .wpilib/wpilib_preferences.json
|
14 | 14 | // or from command line. If not found an exception will be thrown.
|
15 | 15 | // You can use getTeamOrDefault(team) instead of getTeamNumber if you
|
16 | 16 | // want to store a team number in this file.
|
17 |
| - team = getTeamNumber() |
| 17 | + team = frc.getTeamNumber() |
18 | 18 | }
|
19 | 19 | }
|
20 | 20 | artifacts {
|
21 |
| - artifact('frcJava', edu.wpi.first.gradlerio.frc.FRCJavaArtifact) { |
| 21 | + frcJavaArtifact('frcJava') { |
22 | 22 | targets << "roborio"
|
23 | 23 | // Debug can be overridden by command line, for use with VSCode
|
24 |
| - debug = getDebugOrDefault(false) |
| 24 | + debug = frc.getDebugOrDefault(false) |
| 25 | + } |
| 26 | + // Built in artifact to deploy arbitrary files to the roboRIO. |
| 27 | + fileTreeArtifact('frcStaticFileDeploy') { |
| 28 | + // The directory below is the local directory to deploy |
| 29 | + files = fileTree(dir: 'src/main/deploy') |
| 30 | + // Deploy to RoboRIO target, into /home/lvuser/deploy |
| 31 | + targets << "roborio" |
| 32 | + directory = '/home/lvuser/deploy' |
25 | 33 | }
|
26 | 34 | }
|
27 | 35 | }
|
28 | 36 |
|
29 |
| -// Defining my dependencies. In this case, WPILib (+ friends), CTRE Toolsuite (Talon SRX) |
30 |
| -// and NavX. |
| 37 | +// Set this to true to enable desktop support. |
| 38 | +def includeDesktopSupport = false |
| 39 | + |
| 40 | +// Maven central needed for JUnit |
| 41 | +repositories { |
| 42 | + mavenCentral() |
| 43 | +} |
| 44 | + |
| 45 | +// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. |
| 46 | +// Also defines JUnit 4. |
31 | 47 | dependencies {
|
32 |
| - compile wpilib() |
33 |
| - compile ctre() |
34 |
| - compile navx() |
| 48 | + compile wpi.deps.wpilib() |
| 49 | + compile wpi.deps.vendor.java() |
| 50 | + nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio) |
| 51 | + nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop) |
| 52 | + testCompile 'junit:junit:4.12' |
| 53 | + compile group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1' |
| 54 | + compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.8.1' |
| 55 | + compile group: 'org.apache.commons', name: 'commons-csv', version: '1.6' |
35 | 56 | }
|
36 | 57 |
|
37 | 58 | // Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar')
|
38 | 59 | // in order to make them all available at runtime. Also adding the manifest so WPILib
|
39 | 60 | // knows where to look for our Robot Class.
|
40 | 61 | jar {
|
41 |
| - from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } |
42 |
| - manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_CLASS) |
43 |
| -} |
44 |
| - |
45 |
| -// Force Java 8 Compatibility mode for deployed code, in case the develoment |
46 |
| -// system is using Java 10. |
47 |
| -compileJava { |
48 |
| - sourceCompatibility = 1.8 |
49 |
| - targetCompatibility = 1.8 |
50 |
| -} |
51 |
| - |
52 |
| -wrapper { |
53 |
| - gradleVersion = '4.9' |
| 62 | + from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } |
| 63 | + manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS) |
54 | 64 | }
|
0 commit comments