forked from blair-robot-project/robot2017
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
140 lines (122 loc) · 3.24 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
plugins {
id 'org.hidetake.ssh' version "2.7.2"
id "java"
id "eclipse"
id "idea"
id "jaci.openrio.gradle.GradleRIO" version "2017.1.1"
id "com.google.protobuf" version "0.8.0"
}
group 'org.usfirst.frc.team449.robot2017'
version '1.0'
allprojects {
tasks.withType(Javadoc).all { enabled = false }
repositories {
maven {
url 'https://jitpack.io'
}
}
}
remotes {
rio {
host = 'roboRIO-449-frc.local'
user = 'lvuser'
knownHosts = allowAnyHosts
}
}
repositories {
mavenCentral()
maven {
name = "GradleRio"
url = "http://dev.imjac.in/maven"
}
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
compile 'com.google.protobuf:protobuf-java:3.0.0'
compile 'io.grpc:grpc-stub:1.0.0-pre2'
compile 'io.grpc:grpc-protobuf:1.0.0-pre2'
compile 'com.github.blair-robot-project:449-central-repo:v4.0.0-WPILib2017'
compile wpilib()
compile talonSrx()
compile fileTree(dir: "lib", include: "*.jar")
}
protobuf {
generatedFilesBaseDir = "$projectDir/gen"
protoc {
// The artifact spec for the Protobuf Compiler
artifact = 'com.google.protobuf:protoc:3.0.0'
}
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 { }
}
}
}
clean {
delete protobuf.generatedFilesBaseDir
}
idea {
module {
sourceDirs += file("${protobuf.generatedFilesBaseDir}/main/java")
}
}
task convertFiles{
doLast {
fileTree("./src/main/resources").matching { include "*" }.each { aFile ->
exec {
commandLine 'dos2unix'
args aFile.absolutePath
}
}
}
}
frc {
//deployers += [to: "/home/lvuser/map.cfg", from: './src/main/resources/map.cfg']
//deployers += [to: "/home/lvuser/profile.csv", from: './src/main/resources/profile.csv']
team = '449'
robotClass = "org.usfirst.frc.team449.robot.Robot"
}
wpi {
wpilibVersion = "+" // The WPILib version to use. For this version of GradleRIO, must be a 2017 version
ntcoreVersion = "+" // The NetworkTables Core version to use.
opencvVersion = "+" // The OpenCV version to use
cscoreVersion = "+" // The CSCore version to use
talonSrxVersion = "+" // The CTRE Toolsuite (Talon SRX) version to use.
}
def robotManifest = {
attributes 'Main-Class': 'edu.wpi.first.wpilibj.RobotBase'
attributes 'Robot-Class': frc.robotClass
}
jar {
from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
manifest robotManifest
}
task genJavadoc(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task('copyResources', dependsOn: convertFiles){
doLast {
ssh.run {
session(remotes.rio) {
execute 'mkdir ~/449_resources', ignoreError: true
put from: 'src/main/resources/*', into: './449_resources/'
}
}
}
}
artifacts {
archives genJavadoc
}