-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
183 lines (164 loc) · 5.76 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
plugins {
id 'org.hidetake.ssh' version "2.9.0"
id 'java'
id 'eclipse'
id 'idea'
id "edu.wpi.first.GradleRIO" version "2019.3.2"
id "com.google.protobuf" version "0.8.8"
}
group 'org.usfirst.frc.team449.robot2019'
version '1.0'
def ROBOT_MAIN_CLASS = "org.usfirst.frc.team449.robot.Main"
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'https://jitpack.io' }
}
dependencies {
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.3'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.9.3'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.9.3'
compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.9.3'
//com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.0.pr3
compile group: 'com.fasterxml.jackson.module', name: 'jackson-module-parameter-names', version: '2.9.3'
compile 'org.jetbrains:annotations:15.0'
compile 'com.google.protobuf:protobuf-java:2.6.1'
compile 'io.grpc:grpc-stub:1.0.0-pre2'
compile 'io.grpc:grpc-protobuf:1.0.0-pre2'
// https://mvnrepository.com/artifact/org.zeromq/jeromq
compile group: 'org.zeromq', name: 'jeromq', version: '0.4.3'
compile wpi.deps.wpilib()
compile wpi.deps.vendor.java()
nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio)
nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop)
}
protobuf {
generatedFilesBaseDir = "$projectDir/gen"
protoc {
// The artifact spec for the Protobuf Compiler
artifact = 'com.google.protobuf:protoc:2.6.1'
}
plugins {
// Optional: an artifact spec for a protoc plugin, with "grpc" as
// the identifier, which can be referred to in the "plugins"
// container of the "generateProtoTasks" closure.
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.0.0-pre2'
}
}
generateProtoTasks {
ofSourceSet('main')*.plugins {
// Apply the "grpc" plugin whose spec is defined above, without
// options. Note the braces cannot be omitted, otherwise the
// plugin will not be added. This is because of the implicit way
// NamedDomainObjectContainer binds the methods.
grpc {}
}
}
}
/* Utils */
clean {
delete protobuf.generatedFilesBaseDir
}
idea {
module {
sourceDirs += file("${protobuf.generatedFilesBaseDir}/main/java")
}
}
/* ssh stuff */
remotes {
rio {
// host = 'roboRIO-449-frc.local' //Default, sometimes doesn't work
host = '172.22.11.2' //USB B cable
// host = '10.4.49.2' //Radio/ethernet IP
user = 'lvuser'
knownHosts = allowAnyHosts
}
jetson {
host = '10.4.49.7'
user = 'nvidia'
knownHosts = allowAnyHosts
password = 'nvidia'
}
}
task('copyResources') {
doLast {
ssh.run {
session(remotes.rio) {
execute 'mkdir ~/449_resources', ignoreError: true
execute 'mkdir ~/logs', ignoreError: true
put from: fileTree('src/main/resources'), into: './449_resources/'
execute ". /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r", ignoreError: true
}
}
}
}
task('startVision') {
doLast {
ssh.run {
session(remotes.jetson) {
execute './jetson_vision.sh', ignoreError: true
}
}
}
}
// Define my targets (RoboRIO) and artifacts (deployable files)
// This is added by GradleRIO's backing project EmbeddedTools.
deploy {
targets {
roboRIO("roborio") {
// Team number is loaded either from the .wpilib/wpilib_preferences.json
// or from command line. If not found an exception will be thrown.
// You can use getTeamOrDefault(team) instead of getTeamNumber if you
// want to store a team number in this file.
team = 449
}
}
artifacts {
frcJavaArtifact('frcJava') {
targets << "roborio"
// Debug can be overridden by command line, for use with VSCode
debug = frc.getDebugOrDefault(false)
}
// Built in artifact to deploy arbitrary files to the roboRIO.
fileTreeArtifact('frcStaticFileDeploy') {
// The directory below is the local directory to deploy
files = fileTree(dir: 'src/main/deploy')
// Deploy to RoboRIO target, into /home/lvuser/deploy
targets << "roborio"
directory = '/home/lvuser/deploy'
}
}
}
// Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar')
// in order to make them all available at runtime. Also adding the manifest so WPILib
// knows where to look for our Robot Class.
jar {
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
}
//task genJavadoc(type: Jar, dependsOn: javadoc) {
// classifier = 'javadoc'
// from javadoc.destinationDir
//}
//task deleteDocs(type: Delete){
// delete 'docs'
// followSymlinks = false
//}
//
//task copyDocs(type: Copy, dependsOn: [genJavadoc, deleteDocs]){
// from 'build/docs/javadoc'
// into 'docs'
//}
//artifacts {
// archives genJavadoc
//}
compileJava {
options.compilerArgs << '-parameters'
}
wrapper {
gradleVersion = '5.0'
}