-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
129 lines (104 loc) · 4.75 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
plugins {
id "java"
id "idea"
id "edu.wpi.first.GradleRIO" version "2019.4.1"
}
group 'com.team2073'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
}
def COMMON_VERSION = '0.4.0-SNAPSHOT'
def ROBOT_MAIN_CLASS = "com.team2073.robot.Main"
// Pass arguments via command line to active different modes
// Ex: ./gradlew deploy -Psim
// Sets simulation mode using the simulation robot class defined below
// Ex: ./gradlew deploy -PtestBoard
// Sets simulation mode using the test board robot class defined below
// Property keys
def PROP_KEY_REMOTE_DEBUG_MODE = "remoteDebug"
def PROP_KEY_TEAM_NUMBER = "teamNumber"
// Configurale properties
def TEAM_NUMBER = 2073
def DEBUG_MODE = false
def IP_ADDRESS
println "Team 2073 custom arguments available:"
println "\t-P" + PROP_KEY_REMOTE_DEBUG_MODE
println "\t-P" + PROP_KEY_TEAM_NUMBER + "=####"
ext {
if (project.hasProperty(PROP_KEY_REMOTE_DEBUG_MODE)) {
println "Remote debug mode enabled"
DEBUG_MODE = true
}
if (project.hasProperty(PROP_KEY_TEAM_NUMBER)) {
println "============================================================================"
println "Overriding default team # of [" + TEAM_NUMBER + "] with [" + teamNumber + "]."
println "============================================================================"
TEAM_NUMBER = teamNumber.toInteger()
}
IP_ADDRESS = "10." + TEAM_NUMBER.toString().substring(0, 2) + "." + TEAM_NUMBER.toString().substring(2, 4) + ".2"
println "Setting IP address to: " + IP_ADDRESS
}
// Define my targets (RoboRIO) and artifacts (deployable files)
// This is added by GradleRIO's backing project EmbeddedTools.
deploy {
targets {
roboRIO("roborio") {
team = TEAM_NUMBER
}
}
artifacts {
frcJavaArtifact('frcJava') {
targets << "roborio"
jvmArgs << '-Xmx10m' // Set more JVM Arguments. Optional.
debug = DEBUG_MODE // Enable to enable java debugging on the RoboRIO. Default: false
debugPort = 8348 // Set the debugging port. Default: 8348
/*
arguments << 'myCustomArgs' // The command-line arguments to launch your jar with. Optional.
robotCommand = './myOtherProgram' // Set the contents of robotCommand. Optional, usually created depending on above values.
*/
// Other values can be edited through EmbeddedTools.
// See https://github.com/JacisNonsense/EmbeddedTools#spec
}
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'
}
}
dependencies {
compile group: 'org.json', name: 'json', version: '20180813'
compile group: 'com.team2073', name: 'common-util', version: COMMON_VERSION
compile group: 'com.team2073', name: 'common-wpi-util', version: COMMON_VERSION
compile group: 'com.team2073', name: 'common-guice', version: COMMON_VERSION
compile group: 'com.google.inject', name: 'guice', version: '4.1.0'
compile group: 'com.google.inject.extensions', name: 'guice-assistedinject', version: '4.1.0'
compile group: 'com.google.inject.extensions', name: 'guice-throwingproviders', version: '4.1.0'
compile group: 'com.mycila.guice.extensions', name: 'mycila-guice-jsr250', version: '4.0.rc1'
compile group: 'org.mockito', name: 'mockito-core', version: '2.15.0'
compile group: 'com.google.inject', name: 'guice', version: '3.0'
testCompile 'junit:junit:4.12'
testCompile("org.junit.jupiter:junit-jupiter-api:5.2.0")
testRuntime("org.junit.jupiter:junit-jupiter-engine:5.2.0")
testCompile group: 'com.team2073', name: 'common-wpi-simulation', version: COMMON_VERSION
testCompile group: 'com.team2073', name: 'common-wpi-simulation-stubs', version: COMMON_VERSION
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)
}
// 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)
}
wrapper {
gradleVersion = '5.0'
}
}