Skip to content

Commit 5d1bb04

Browse files
authored
Merge pull request #14 from strykeforce/frc_2020
Updated for 2020
2 parents 87b37e1 + f633ae8 commit 5d1bb04

File tree

14 files changed

+497
-196
lines changed

14 files changed

+497
-196
lines changed

.wpilib/wpilib_preferences.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"enableCppIntellisense": false,
3+
"currentLanguage": "java",
4+
"projectYear": "2020",
5+
"teamNumber": 2767
6+
}

build.gradle

Lines changed: 73 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,97 @@
11
plugins {
2+
id "java"
3+
id "org.jetbrains.kotlin.jvm" version "1.3.61"
4+
id "edu.wpi.first.GradleRIO" version "2020.1.2"
5+
}
26

3-
id "org.jetbrains.kotlin.jvm" version "1.3.40"
4-
id "idea"
7+
sourceCompatibility = JavaVersion.VERSION_11
8+
targetCompatibility = JavaVersion.VERSION_11
9+
10+
def ROBOT_MAIN_CLASS = "org.strykeforce.thirdcoast.DummyMain"
11+
12+
// Define my targets (RoboRIO) and artifacts (deployable files)
13+
// This is added by GradleRIO's backing project EmbeddedTools.
14+
deploy {
15+
targets {
16+
roboRIO("roborio") {
17+
// Team number is loaded either from the .wpilib/wpilib_preferences.json
18+
// or from command line. If not found an exception will be thrown.
19+
// You can use getTeamOrDefault(team) instead of getTeamNumber if you
20+
// want to store a team number in this file.
21+
team = frc.getTeamNumber()
22+
}
23+
}
24+
artifacts {
25+
frcJavaArtifact('frcJava') {
26+
targets << "roborio"
27+
// Debug can be overridden by command line, for use with VSCode
28+
debug = frc.getDebugOrDefault(false)
29+
}
30+
// Built in artifact to deploy arbitrary files to the roboRIO.
31+
fileTreeArtifact('frcStaticFileDeploy') {
32+
// The directory below is the local directory to deploy
33+
files = fileTree(dir: 'src/main/deploy')
34+
// Deploy to RoboRIO target, into /home/lvuser/deploy
35+
targets << "roborio"
36+
directory = '/home/lvuser/deploy'
37+
}
38+
}
539
}
640

7-
version = "19.4.1"
41+
// Set this to true to enable desktop support.
42+
def includeDesktopSupport = false
843

944
repositories {
1045
jcenter()
11-
maven { url = "http://devsite.ctr-electronics.com/maven/release/" }
1246
maven { url = "http://first.wpi.edu/FRC/roborio/maven/release" }
13-
mavenLocal()
1447
}
15-
48+
// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
49+
// Also defines JUnit 4.
1650
dependencies {
17-
// FRC libs
18-
compile "edu.wpi.first.wpilibj:wpilibj-java:${wpi_version}"
19-
compile "edu.wpi.first.ntcore:ntcore-java:${wpi_version}"
20-
compile "edu.wpi.first.cscore:cscore-java:${wpi_version}"
21-
compile "edu.wpi.first.thirdparty.frc2019.opencv:opencv-java:3.4.4-4"
51+
implementation wpi.deps.wpilib()
52+
nativeZip wpi.deps.wpilibJni(wpi.platforms.roborio)
53+
nativeDesktopZip wpi.deps.wpilibJni(wpi.platforms.desktop)
54+
2255

23-
// Vendor libs
24-
compile "com.ctre.phoenix:api-java:5.12.1"
25-
compile "com.ctre.phoenix:wpiapi-java:5.12.1"
56+
implementation wpi.deps.vendor.java()
57+
nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio)
58+
nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop)
2659

27-
// Kotlin
28-
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}"
60+
// We need to add the Kotlin stdlib in order to use most Kotlin language features.
61+
implementation "org.jetbrains.kotlin:kotlin-stdlib"
2962

3063
// App
31-
compile "org.jline:jline:3.9.0"
32-
compile 'net.consensys.cava:cava-toml:0.5.0'
33-
compile "org.strykeforce.thirdcoast:telemetry:${thirdcoast_version}"
34-
compile "org.strykeforce.thirdcoast:swerve:${thirdcoast_version}"
64+
implementation "org.jline:jline:3.9.0"
65+
implementation 'net.consensys.cava:cava-toml:0.5.0'
66+
67+
implementation "org.strykeforce.thirdcoast:telemetry:19.5.1"
68+
implementation "org.strykeforce.thirdcoast:swerve:19.5.1"
3569

3670
// Logging
37-
compile 'io.github.microutils:kotlin-logging:1.6.10'
38-
compile 'ch.qos.logback:logback-classic:1.2.3'
71+
implementation 'io.github.microutils:kotlin-logging:1.6.10'
72+
implementation 'ch.qos.logback:logback-classic:1.2.3'
3973

4074
// Koin
41-
compile "org.koin:koin-core:$koin_version"
42-
compile "org.koin:koin-logger-slf4j:${koin_version}"
43-
testCompile "org.koin:koin-test:${koin_version}"
75+
implementation "org.koin:koin-core:1.0.2"
76+
implementation "org.koin:koin-logger-slf4j:1.0.2"
77+
testImplementation "org.koin:koin-test:1.0.2"
4478

4579
// Testing
46-
testCompile "org.junit.jupiter:junit-jupiter-api:${junit_version}"
47-
testCompile "org.junit.jupiter:junit-jupiter-params:${junit_version}"
48-
testRuntime "org.junit.jupiter:junit-jupiter-engine:${junit_version}"
49-
testCompile "org.assertj:assertj-core:3.11.1"
50-
testCompile "com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0"
51-
52-
}
53-
54-
compileKotlin {
55-
kotlinOptions {
56-
jvmTarget = "1.8"
57-
freeCompilerArgs = ["-progressive"]
58-
}
59-
}
60-
61-
compileTestKotlin {
62-
kotlinOptions {
63-
jvmTarget = "1.8"
64-
freeCompilerArgs = ["-progressive"]
65-
}
66-
}
67-
68-
test {
69-
useJUnitPlatform()
70-
71-
testLogging {
72-
events "passed", "skipped", "failed"
73-
}
74-
75-
reports {
76-
html.enabled = true
77-
}
78-
}
79-
80-
def robotManifest = {
81-
attributes 'Main-Class': 'org.strykeforce.thirdcoast.MainKt',
82-
'Robot-Class': 'org.strykeforce.thirdcoast.Robot',
83-
'Specification-Title': 'Third Coast Telemetry',
84-
'Specification-Version': "${thirdcoast_version}",
85-
'Implementation-Title': 'Third Coast Telemetry Utility (tct)',
86-
'Implementation-Version': version
80+
testImplementation "org.junit.jupiter:junit-jupiter-api:5.5.2"
81+
testImplementation "org.junit.jupiter:junit-jupiter-params:5.5.2"
82+
testRuntime "org.junit.jupiter:junit-jupiter-engine:5.5.2"
83+
testImplementation "org.assertj:assertj-core:3.11.1"
84+
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0"
85+
86+
// Enable simulation gui support. Must check the box in vscode to enable support
87+
// upon debugging
88+
simulation wpi.deps.sim.gui(wpi.platforms.desktop, false)
8789
}
8890

91+
// Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar')
92+
// in order to make them all available at runtime. Also adding the manifest so WPILib
93+
// knows where to look for our Robot Class.
8994
jar {
90-
from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
91-
manifest robotManifest
92-
}
93-
94-
idea {
95-
module {
96-
downloadJavadoc = true
97-
downloadSources = true
98-
}
95+
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
96+
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
9997
}

gradle.properties

Lines changed: 0 additions & 6 deletions
This file was deleted.

gradle/wrapper/gradle-wrapper.jar

3.43 KB
Binary file not shown.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
2-
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip
2+
distributionPath=permwrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
5-
zipStorePath=wrapper/dists
5+
zipStorePath=permwrapper/dists

gradlew

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/usr/bin/env sh
22

3+
#
4+
# Copyright 2015 the original author or authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# https://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
319
##############################################################################
420
##
521
## Gradle start up script for UN*X
@@ -28,7 +44,7 @@ APP_NAME="Gradle"
2844
APP_BASE_NAME=`basename "$0"`
2945

3046
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS='"-Xmx64m"'
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
3248

3349
# Use the maximum available, or set MAX_FD != -1 to use that value.
3450
MAX_FD="maximum"
@@ -109,8 +125,8 @@ if $darwin; then
109125
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110126
fi
111127

112-
# For Cygwin, switch paths to Windows format before running java
113-
if $cygwin ; then
128+
# For Cygwin or MSYS, switch paths to Windows format before running java
129+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
114130
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115131
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116132
JAVACMD=`cygpath --unix "$JAVACMD"`
@@ -138,19 +154,19 @@ if $cygwin ; then
138154
else
139155
eval `echo args$i`="\"$arg\""
140156
fi
141-
i=$((i+1))
157+
i=`expr $i + 1`
142158
done
143159
case $i in
144-
(0) set -- ;;
145-
(1) set -- "$args0" ;;
146-
(2) set -- "$args0" "$args1" ;;
147-
(3) set -- "$args0" "$args1" "$args2" ;;
148-
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149-
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150-
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151-
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152-
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153-
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
160+
0) set -- ;;
161+
1) set -- "$args0" ;;
162+
2) set -- "$args0" "$args1" ;;
163+
3) set -- "$args0" "$args1" "$args2" ;;
164+
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165+
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166+
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167+
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168+
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169+
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154170
esac
155171
fi
156172

@@ -159,14 +175,9 @@ save () {
159175
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160176
echo " "
161177
}
162-
APP_ARGS=$(save "$@")
178+
APP_ARGS=`save "$@"`
163179

164180
# Collect all arguments for the java command, following the shell quoting and substitution rules
165181
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166182

167-
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168-
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169-
cd "$(dirname "$0")"
170-
fi
171-
172183
exec "$JAVACMD" "$@"

0 commit comments

Comments
 (0)