-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgradle5k.gradle
111 lines (89 loc) · 3.56 KB
/
gradle5k.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
/**
* Gradle5K is a small gradle script that should be distrobuted with every release of Lib5K.
*
* The goal of this script is to automatically handle dependency management for any client
* library without the need for large config files
*/
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
apply plugin: "java"
apply plugin: "edu.wpi.first.GradleRIO"
/* --- Lib5K Maintainers: Set maven repos here --- */
def maven_repos = [
jitpack: "https://jitpack.io",
maven_org: "https://repo1.maven.org/maven2/",
//ctre: "https://devsite.ctr-electronics.com/maven/release/",
//rev_color: "http://www.revrobotics.com/content/sw/color-sensor-v3/sdk/maven/",
rev: "https://www.revrobotics.com/content/sw/max/sdk/maven/",
wpi: "https://frcmaven.wpi.edu/artifactory/release/",
]
/* --- These are all publicly exposed --- */
repositories {
// Provided by Gradle
mavenCentral()
mavenLocal()
jcenter()
// Provided by us
maven_repos.each { k,v ->
maven {
name k
url v
}
}
}
dependencies{
// Math tools
implementation 'org.apache.commons:commons-math3:3.6.1'
implementation 'com.ctre.phoenix:api-java:5.19.4'
implementation 'com.kauailabs.navx.frc:navx-java:4.0.442'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:29.0-jre'
// Use JUnit test framework
testImplementation 'junit:junit:4.13'
// @ewpratten's MathUtils library
implementation 'com.github.ewpratten:ewmath:master-SNAPSHOT'
// Java language extensions
implementation "org.apache.commons:commons-lang3:3.11"
// Xchart
implementation group: 'org.knowm.xchart', name: 'xchart', version: '3.6.5'
// Google JSON support
implementation 'com.google.code.gson:gson:2.8.6'
implementation wpi.java.deps.wpilib()
implementation wpi.java.vendor.java()
// WPILib command framework
implementation("edu.wpi.first.wpilibNewCommands:wpilibNewCommands-java:2022.2.1")
}
// Fancy tests output
tasks.withType(Test) {
testLogging {
// set options for log level LIFECYCLE
events TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_OUT
exceptionFormat TestExceptionFormat.FULL
showExceptions true
showCauses true
showStackTraces true
// set options for log level DEBUG and INFO
debug {
events TestLogEvent.STARTED,
TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_ERROR,
TestLogEvent.STANDARD_OUT
exceptionFormat TestExceptionFormat.FULL
}
info.events = debug.events
info.exceptionFormat = debug.exceptionFormat
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
}