-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
78 lines (68 loc) · 2.36 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
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* Learn how to create Gradle builds at https://guides.gradle.org/creating-new-gradle-builds/
*/
// buildscript has to go at the top of the file, it configures gradle itself
buildscript {
repositories {
mavenLocal()
}
}
// We are a java-library because we build a jar file, but
// we also require the GradleRio plugin for robot stuff
plugins {
id "java-library"
id "edu.wpi.first.GradleRIO" version "2019.0.0-alpha-3"
}
// define the robot class for GradleRIO
def ROBOT_CLASS = "frc.robot.Robot"
// Define my targets (RoboRIO) and artifacts (deployable files)
// This is added by GradleRIO's backing project EmbeddedTools.
deploy {
targets {
target("roborio", edu.wpi.first.gradlerio.frc.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 = getTeamNumber()
}
}
artifacts {
artifact('frcJava', edu.wpi.first.gradlerio.frc.FRCJavaArtifact) {
targets << "roborio"
// Debug can be overridden by command line, for use with VSCode
debug = getDebugOrDefault(false)
}
}
}
// add the simulator before our dependencies
apply from: 'https://raw.githubusercontent.com/cpostbitbuckets/FRCTutorial/master/buildSrc/simulator.gradle'
dependencies {
compile wpilib()
compile ctre()
compile navx()
}
// 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_CLASS)
}
// Add a local and remote repository to fetch dependencies from
repositories {
mavenLocal()
jcenter()
}
// Force Java 8 Compatibility mode for deployed code, in case the develoment
// system is using Java 10.
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
wrapper {
gradleVersion = '4.9'
}