1+ import edu.wpi.first.gradlerio.deploy.roborio.RoboRIO
2+
13plugins {
24 id " java"
3- id " org.jetbrains.kotlin.jvm" version " 1.5.0 "
4- id " edu.wpi.first.GradleRIO" version " 2021.3 .1"
5+ id " org.jetbrains.kotlin.jvm" version " 1.6.10 "
6+ id " edu.wpi.first.GradleRIO" version " 2022.1 .1"
57}
68
7- version = " 21 .0.0"
9+ version = " 22 .0.0"
810
911sourceCompatibility = JavaVersion . VERSION_11
1012targetCompatibility = JavaVersion . VERSION_11
1113
1214def ROBOT_MAIN_CLASS = " org.strykeforce.thirdcoast.DummyMain"
1315
14- // Define my targets (RoboRIO) and artifacts (deployable files)
15- // This is added by GradleRIO's backing project EmbeddedTools.
1616deploy {
1717 targets {
18- roboRIO(" roborio" ) {
19- // Team number is loaded either from the .wpilib/wpilib_preferences.json
20- // or from command line. If not found an exception will be thrown.
21- // You can use getTeamOrDefault(team) instead of getTeamNumber if you
22- // want to store a team number in this file.
23- team = frc. getTeamNumber()
24- }
25- }
26- artifacts {
27- frcJavaArtifact(' frcJava' ) {
28- targets << " roborio"
29- // Debug can be overridden by command line, for use with VSCode
30- debug = frc. getDebugOrDefault(false )
31- }
32- // Built in artifact to deploy arbitrary files to the roboRIO.
33- fileTreeArtifact(' frcStaticFileDeploy' ) {
34- // The directory below is the local directory to deploy
35- files = fileTree(dir : ' src/main/deploy' )
36- // Deploy to RoboRIO target, into /home/lvuser/deploy
37- targets << " roborio"
38- directory = ' /home/lvuser/deploy'
18+ roborio(getTargetTypeClass(' RoboRIO' )) {
19+ team = project. frc. getTeamNumber()
20+ debug = project. frc. getDebugOrDefault(false )
21+ artifacts {
22+ frcJava(getArtifactTypeClass(' FRCJavaArtifact' )) {}
23+ frcStaticFileDeploy(getArtifactTypeClass(' FileTreeArtifact' )) {
24+ files = project. fileTree(' src/main/deploy' )
25+ directory = ' /home/lvuser/deploy'
26+ }
27+ }
3928 }
4029 }
4130}
4231
43- // Set this to true to enable desktop support.
32+ def deployArtifact = deploy. targets. roborio. artifacts. frcJava
33+
34+ wpi. java. debugJni = false
35+
4436def includeDesktopSupport = false
4537
4638repositories {
@@ -50,14 +42,22 @@ repositories {
5042// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
5143// Also defines JUnit 4.
5244dependencies {
53- implementation wpi. deps. wpilib()
54- nativeZip wpi. deps. wpilibJni(wpi. platforms. roborio)
55- nativeDesktopZip wpi. deps. wpilibJni(wpi. platforms. desktop)
45+ implementation wpi. java. deps. wpilib()
46+ implementation wpi. java. vendor. java()
5647
48+ roborioDebug wpi. java. deps. wpilibJniDebug(wpi. platforms. roborio)
49+ roborioDebug wpi. java. vendor. jniDebug(wpi. platforms. roborio)
5750
58- implementation wpi. deps. vendor. java()
59- nativeZip wpi. deps. vendor. jni(wpi. platforms. roborio)
60- nativeDesktopZip wpi. deps. vendor. jni(wpi. platforms. desktop)
51+ roborioRelease wpi. java. deps. wpilibJniRelease(wpi. platforms. roborio)
52+ roborioRelease wpi. java. vendor. jniRelease(wpi. platforms. roborio)
53+
54+ nativeDebug wpi. java. deps. wpilibJniDebug(wpi. platforms. desktop)
55+ nativeDebug wpi. java. vendor. jniDebug(wpi. platforms. desktop)
56+ simulationDebug wpi. sim. enableDebug()
57+
58+ nativeRelease wpi. java. deps. wpilibJniRelease(wpi. platforms. desktop)
59+ nativeRelease wpi. java. vendor. jniRelease(wpi. platforms. desktop)
60+ simulationRelease wpi. sim. enableRelease()
6161
6262 // We need to add the Kotlin stdlib in order to use most Kotlin language features.
6363// implementation "org.jetbrains.kotlin:kotlin-stdlib"
@@ -68,8 +68,8 @@ dependencies {
6868 implementation(" net.consensys.cava:cava-toml:0.5.0" )
6969
7070 // Logging
71- implementation(" io.github.microutils:kotlin-logging-jvm:2.0.6 " )
72- implementation(" ch.qos.logback:logback-classic:1.2.3 " )
71+ implementation(' io.github.microutils:kotlin-logging-jvm:2.1.21 ' )
72+ implementation(' ch.qos.logback:logback-classic:1.2.10 ' )
7373
7474 // Koin
7575 implementation(" org.koin:koin-core:1.0.2" )
@@ -81,10 +81,6 @@ dependencies {
8181 testImplementation(" org.junit.jupiter:junit-jupiter" )
8282 testImplementation(" org.assertj:assertj-core:3.19.0" )
8383 testImplementation(" com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0" )
84-
85- // Enable simulation gui support. Must check the box in vscode to enable support
86- // upon debugging
87- simulation wpi. deps. sim. gui(wpi. platforms. desktop, false )
8884}
8985
9086tasks. withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile ). configureEach {
@@ -97,16 +93,13 @@ test {
9793 useJUnitPlatform()
9894}
9995
100- // Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar')
101- // in order to make them all available at runtime. Also adding the manifest so WPILib
102- // knows where to look for our Robot Class.
10396jar {
10497 from { configurations. runtimeClasspath. collect { it. isDirectory() ? it : zipTree(it) } }
10598 manifest edu.wpi.first.gradlerio.GradleRIOPlugin . javaManifest(ROBOT_MAIN_CLASS )
106- manifest {
107- attributes(
108- ' Implementation-Title' : ' Third Coast Telemetry Utility (tct)' ,
109- ' Implementation-Version' : archiveVersion
110- )
111- }
99+ duplicatesStrategy = DuplicatesStrategy . INCLUDE
112100}
101+
102+ // Configure jar and deploy tasks
103+ deployArtifact. jarTask = jar
104+ wpi. java. configureExecutableTasks(jar)
105+ wpi. java. configureTestTasks(test)
0 commit comments