Skip to content

Commit cbea532

Browse files
committed
update gradle version, dependency versions
1 parent 958ee7d commit cbea532

File tree

5 files changed

+124
-121
lines changed

5 files changed

+124
-121
lines changed

build.gradle

+79-39
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id "java"
33
id "edu.wpi.first.GradleRIO" version "2022.4.1"
4+
id "com.diffplug.spotless" version "5.10.2"
45
}
56

67
allprojects {
@@ -9,74 +10,107 @@ allprojects {
910
}
1011
}
1112

13+
// Set this to the latest version of StuyLib.
14+
// You can check here: https://github.com/StuyPulse/StuyLib/releases.
15+
final String STUYLIB_VERSION = 'v2022.4.0'
16+
17+
def ROBOT_MAIN_CLASS = "com.stuypulse.robot.Main"
18+
1219
sourceCompatibility = JavaVersion.VERSION_11
1320
targetCompatibility = JavaVersion.VERSION_11
1421

15-
def ROBOT_MAIN_CLASS = "com.stuypulse.robot.Main"
16-
final String STUYLIB_VERSION = 'v2022.3.0'
1722

1823
// Define my targets (RoboRIO) and artifacts (deployable files)
19-
// This is added by GradleRIO's backing project EmbeddedTools.
24+
// This is added by GradleRIO's backing project DeployUtils.
2025
deploy {
2126
targets {
22-
roboRIO("roborio") {
27+
// roborio("roborio") {
28+
roborio(getTargetTypeClass('RoboRIO')) {
2329
// Team number is loaded either from the .wpilib/wpilib_preferences.json
2430
// or from command line. If not found an exception will be thrown.
2531
// You can use getTeamOrDefault(team) instead of getTeamNumber if you
2632
// want to store a team number in this file.
27-
team = frc.getTeamNumber()
28-
}
29-
}
30-
artifacts {
31-
frcJavaArtifact('frcJava') {
32-
targets << "roborio"
33-
// Debug can be overridden by command line, for use with VSCode
34-
debug = frc.getDebugOrDefault(false)
35-
}
36-
// Built in artifact to deploy arbitrary files to the roboRIO.
37-
fileTreeArtifact('frcStaticFileDeploy') {
38-
// The directory below is the local directory to deploy
39-
files = fileTree(dir: 'src/main/deploy')
40-
// Deploy to RoboRIO target, into /home/lvuser/deploy
41-
targets << "roborio"
42-
directory = '/home/lvuser/deploy'
33+
team = project.frc.getTeamNumber()
34+
debug = project.frc.getDebugOrDefault(false)
35+
36+
artifacts {
37+
// First part is artifact name, 2nd is artifact type
38+
// getTargetTypeClass is a shortcut to get the class type using a string
39+
40+
frcJava(getArtifactTypeClass('FRCJavaArtifact')) {
41+
}
42+
43+
// Static files artifact
44+
frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) {
45+
files = project.fileTree('src/main/deploy')
46+
directory = '/home/lvuser/deploy'
47+
}
48+
}
4349
}
4450
}
4551
}
4652

53+
def deployArtifact = deploy.targets.roborio.artifacts.frcJava
54+
55+
// Set to true to use debug for JNI.
56+
wpi.java.debugJni = false
57+
4758
// Set this to true to enable desktop support.
48-
def includeDesktopSupport = true
59+
def includeDesktopSupport = false
4960

5061
// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
5162
// Also defines JUnit 4.
5263
dependencies {
53-
implementation wpi.deps.wpilib()
54-
nativeZip wpi.deps.wpilibJni(wpi.platforms.roborio)
55-
nativeDesktopZip wpi.deps.wpilibJni(wpi.platforms.desktop)
64+
implementation wpi.java.deps.wpilib()
65+
implementation wpi.java.vendor.java()
5666

67+
roborioDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.roborio)
68+
roborioDebug wpi.java.vendor.jniDebug(wpi.platforms.roborio)
5769

58-
implementation wpi.deps.vendor.java()
59-
nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio)
60-
nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop)
70+
roborioRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio)
71+
roborioRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio)
6172

62-
testImplementation 'junit:junit:4.12'
73+
nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop)
74+
nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop)
75+
simulationDebug wpi.sim.enableDebug()
6376

64-
// Enable simulation gui support. Must check the box in vscode to enable support
65-
// upon debugging
66-
simulation wpi.deps.sim.gui(wpi.platforms.desktop, false)
67-
simulation wpi.deps.sim.driverstation(wpi.platforms.desktop, false)
77+
nativeRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.desktop)
78+
nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop)
79+
simulationRelease wpi.sim.enableRelease()
6880

69-
// Websocket extensions require additional configuration.
70-
// simulation wpi.deps.sim.ws_server(wpi.platforms.desktop, false)
71-
// simulation wpi.deps.sim.ws_client(wpi.platforms.desktop, false)
81+
testImplementation 'junit:junit:4.12'
7282

73-
compile "com.github.StuyPulse:StuyLib:${STUYLIB_VERSION}";
83+
implementation "com.github.StuyPulse:StuyLib:${STUYLIB_VERSION}";
7484
}
7585

7686
// Simulation configuration (e.g. environment variables).
77-
sim {
78-
// Sets the websocket client remote host.
79-
// envVar "HALSIMWS_HOST", "10.0.0.2"
87+
wpi.sim.addGui().defaultEnabled = false
88+
wpi.sim.addDriverstation()
89+
90+
spotless {
91+
enforceCheck = false
92+
java {
93+
targetExclude("src/main/java/com/stuypulse/robot/commands/autons/*.java")
94+
licenseHeaderFile "LICENSE"
95+
96+
googleJavaFormat().aosp()
97+
98+
trimTrailingWhitespace()
99+
endWithNewline()
100+
101+
importOrder(
102+
'com.stuypulse.stuylib',
103+
'com.stuypulse.constants',
104+
'com.stuypulse.subsystems',
105+
'com.stuypulse.commands',
106+
'com.stuypulse.commands.auton',
107+
'com.stuypulse.util',
108+
'com.stuypulse',
109+
'edu.wpi',
110+
'com.revrobotics'
111+
)
112+
removeUnusedImports()
113+
}
80114
}
81115

82116
// Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar')
@@ -85,4 +119,10 @@ sim {
85119
jar {
86120
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
87121
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
122+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
88123
}
124+
125+
// Configure jar and deploy tasks
126+
deployArtifact.jarTask = jar
127+
wpi.java.configureExecutableTasks(jar)
128+
wpi.java.configureTestTasks(test)
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=permwrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
5-
zipStorePath=permwrapper/dists
5+
zipStorePath=permwrapper/dists
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,46 @@
11
{
2-
"cppDependencies": [
2+
"fileName": "REVLib.json",
3+
"name": "REVLib",
4+
"version": "2022.1.1",
5+
"uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb",
6+
"mavenUrls": [
7+
"https://maven.revrobotics.com/"
8+
],
9+
"jsonUrl": "https://software-metadata.revrobotics.com/REVLib.json",
10+
"javaDependencies": [
311
{
4-
"artifactId": "SparkMax-cpp",
5-
"binaryPlatforms": [
12+
"groupId": "com.revrobotics.frc",
13+
"artifactId": "REVLib-java",
14+
"version": "2022.1.1"
15+
}
16+
],
17+
"jniDependencies": [
18+
{
19+
"groupId": "com.revrobotics.frc",
20+
"artifactId": "REVLib-driver",
21+
"version": "2022.1.1",
22+
"skipInvalidPlatforms": true,
23+
"isJar": false,
24+
"validPlatforms": [
625
"windowsx86-64",
726
"windowsx86",
827
"linuxaarch64bionic",
928
"linuxx86-64",
1029
"linuxathena",
1130
"linuxraspbian",
1231
"osxx86-64"
13-
],
32+
]
33+
}
34+
],
35+
"cppDependencies": [
36+
{
1437
"groupId": "com.revrobotics.frc",
38+
"artifactId": "REVLib-cpp",
39+
"version": "2022.1.1",
40+
"libName": "REVLib",
1541
"headerClassifier": "headers",
16-
"libName": "SparkMax",
1742
"sharedLibrary": false,
1843
"skipInvalidPlatforms": true,
19-
"version": "1.5.4"
20-
},
21-
{
22-
"artifactId": "SparkMax-driver",
2344
"binaryPlatforms": [
2445
"windowsx86-64",
2546
"windowsx86",
@@ -28,46 +49,25 @@
2849
"linuxathena",
2950
"linuxraspbian",
3051
"osxx86-64"
31-
],
52+
]
53+
},
54+
{
3255
"groupId": "com.revrobotics.frc",
56+
"artifactId": "REVLib-driver",
57+
"version": "2022.1.1",
58+
"libName": "REVLibDriver",
3359
"headerClassifier": "headers",
34-
"libName": "SparkMaxDriver",
3560
"sharedLibrary": false,
3661
"skipInvalidPlatforms": true,
37-
"version": "1.5.4"
38-
}
39-
],
40-
"fileName": "REVRobotics.json",
41-
"javaDependencies": [
42-
{
43-
"artifactId": "SparkMax-java",
44-
"groupId": "com.revrobotics.frc",
45-
"version": "1.5.4"
46-
}
47-
],
48-
"jniDependencies": [
49-
{
50-
"artifactId": "SparkMax-driver",
51-
"groupId": "com.revrobotics.frc",
52-
"isJar": false,
53-
"skipInvalidPlatforms": true,
54-
"validPlatforms": [
62+
"binaryPlatforms": [
5563
"windowsx86-64",
5664
"windowsx86",
5765
"linuxaarch64bionic",
5866
"linuxx86-64",
5967
"linuxathena",
6068
"linuxraspbian",
6169
"osxx86-64"
62-
],
63-
"version": "1.5.4"
70+
]
6471
}
65-
],
66-
"jsonUrl": "http://www.revrobotics.com/content/sw/max/sdk/REVRobotics.json",
67-
"mavenUrls": [
68-
"http://www.revrobotics.com/content/sw/max/sdk/maven/"
69-
],
70-
"name": "REVRobotics",
71-
"uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb",
72-
"version": "1.5.4"
72+
]
7373
}

vendordeps/WPILibNewCommands.json

-37
This file was deleted.

vendordeps/navx_frc.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
22
"fileName": "navx_frc.json",
33
"name": "KauaiLabs_navX_FRC",
4-
"version": "3.1.413",
4+
"version": "4.0.442",
55
"uuid": "cb311d09-36e9-4143-a032-55bb2b94443b",
66
"mavenUrls": [
77
"https://repo1.maven.org/maven2/"
88
],
9-
"jsonUrl": "https://www.kauailabs.com/dist/frc/2020/navx_frc.json",
9+
"jsonUrl": "https://www.kauailabs.com/dist/frc/2022/navx_frc.json",
1010
"javaDependencies": [
1111
{
1212
"groupId": "com.kauailabs.navx.frc",
1313
"artifactId": "navx-java",
14-
"version": "3.1.413"
14+
"version": "4.0.442"
1515
}
1616
],
1717
"jniDependencies": [],
1818
"cppDependencies": [
1919
{
2020
"groupId": "com.kauailabs.navx.frc",
2121
"artifactId": "navx-cpp",
22-
"version": "3.1.413",
22+
"version": "4.0.442",
2323
"headerClassifier": "headers",
2424
"sourcesClassifier": "sources",
2525
"sharedLibrary": false,

0 commit comments

Comments
 (0)