-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
210 lines (170 loc) · 6.57 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
import edu.wpi.first.gradlerio.deploy.roborio.RoboRIO
/*
* This build file was auto generated by running the Gradle 'init' task
* by 'John' at '1/7/18 10:12 PM' with Gradle 2.14.1
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at https://docs.gradle.org/2.14.1/userguide/tutorial_java_projects.html
*/
plugins {
id "edu.wpi.first.GradleRIO" version "2025.3.1"
id 'scala'
id 'checkstyle'
id 'jacoco'
id "net.linguica.maven-settings" version "0.5"
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
// In this section you declare where to find the dependencies of your project
repositories {
// Use 'mavenCentral' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenCentral()
maven {
url 'https://pkgs.dev.azure.com/Team488/2ef6eee3-1df0-441a-9af8-5edc5c3cb203/_packaging/XBot/maven/v1'
name 'XBot'
}
maven { url "https://mvnrepository.com/artifact/com.google.dagger/dagger" }
maven { url "https://mvnrepository.com/artifact/com.google.dagger/dagger-compiler" }
maven { url "https://mvnrepository.com/artifact/org.zeromq/jeromq" }
maven { url "https://3015rangerrobotics.github.io/pathplannerlib/repo"}
maven { url "https://storage.googleapis.com/grapple-frc-maven"}
maven { url uri ("../SeriouslyCommonLib/lib/")}
mavenLocal()
}
configurations {
nativeBundle
}
// In this section you declare the dependencies for your production and test code
dependencies {
annotationProcessor wpi.java.deps.wpilibAnnotations()
implementation wpi.java.deps.wpilib()
implementation wpi.java.vendor.java()
nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop)
nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop)
simulationDebug wpi.sim.enableDebug()
nativeRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.desktop)
nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop)
simulationRelease wpi.sim.enableRelease()
// The production code uses the SLF4J logging API at compile time
implementation 'org.slf4j:slf4j-api:1.7.21'
// In future, sync with WPILib, using junit 5
implementation 'junit:junit:4.13.1'
testImplementation 'junit:junit:4.13.1'
implementation 'com.google.dagger:dagger:2.44.2'
annotationProcessor 'com.google.dagger:dagger-compiler:2.44.2'
testAnnotationProcessor 'com.google.dagger:dagger-compiler:2.44.2'
implementation 'org.apache.logging.log4j:log4j-api:2.19.0'
implementation 'org.apache.logging.log4j:log4j-core:2.19.0'
implementation group: 'org.json', name:'json', version: '20230227'
implementation group: 'org.zeromq', name: 'jeromq', version: '0.5.3'
implementation 'org.scala-lang:scala-library:2.11.12'
testImplementation 'org.scalatest:scalatest_2.11:3.0.0'
def akitJson = new groovy.json.JsonSlurper().parseText(new File(projectDir.getAbsolutePath() + "/vendordeps/AdvantageKit.json").text)
annotationProcessor "org.littletonrobotics.akit:akit-autolog:$akitJson.version"
}
// Simulation configuration (e.g. environment variables).
//
// The sim GUI is *disabled* by default to support running
// AdvantageKit log replay from the command line. Set the
// value to "true" to enable the sim GUI by default (this
// is the standard WPILib behavior).
wpi.sim.addGui().defaultEnabled = false
wpi.sim.addDriverstation()
// Configuration for AdvantageKit
task(replayWatch, type: JavaExec) {
mainClass = "org.littletonrobotics.junction.ReplayWatch"
classpath = sourceSets.main.runtimeClasspath
}
sourceSets {
main {
resources {
srcDirs = ["src/main/resources"]
}
}
}
tasks.register('jarSources', Jar) {
from sourceSets.main.allSource
archiveClassifier = 'source'
}
test {
reports {
junitXml.required = true
}
}
// Configure string concat to always inline compile
tasks.withType(JavaCompile) {
options.compilerArgs.add '-XDstringConcat=inline'
}
tasks.withType(Test) {
testLogging.showStandardStreams = true
afterTest { desc, result ->
logger.quiet "Executed test ${desc.name} [${desc.className}] with result: ${result.resultType}"
}
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
println "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
}
}
}
checkstyle {
toolVersion = '10.6.0'
configFile = file('./xbotcheckstyle.xml')
}
task checkstyle(type: Checkstyle) {
source 'src/main/java'
configProperties.basedir = file('.')
// Empty classpath
classpath = files()
}
javadoc {
options.overview = "src/main/java/overview.html"
options.header = "<script type=\"module\">" +
"import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';" +
"mermaid.initialize({ startOnLoad: true });" +
"</script>";
options.addStringOption('Xdoclint:-missing', '-quiet')
options.addBooleanOption("-allow-script-in-comments",true)
options.links = [
"https://github.wpilib.org/allwpilib/docs/release/java/",
"https://api.ctr-electronics.com/phoenix6/release/java/",
"https://codedocs.revrobotics.com/java/",
"https://photonvision.github.io/photonvision/built-docs/javadoc/"
]
}
jacocoTestReport {
dependsOn test
reports {
xml.required = true
}
}
// always generate the coverage report after the tests run
test.finalizedBy { jacocoTestReport }
// Configure jar and deploy tasks
wpi.java.configureExecutableTasks(jar)
wpi.java.configureTestTasks(test)
// Configure string concat to always inline compile
tasks.withType(JavaCompile) {
options.compilerArgs.add '-XDstringConcat=inline'
}
apply plugin: 'maven-publish'
publishing {
publications {
myPublication(MavenPublication) {
groupId 'xbot.common'
artifactId 'SeriouslyCommonLib'
version System.getenv('BUILD_BUILDNUMBER') ?: '1.0.0'
artifact 'build/libs/SeriouslyCommonLib.jar'
}
}
repositories {
maven {
url 'https://pkgs.dev.azure.com/Team488/2ef6eee3-1df0-441a-9af8-5edc5c3cb203/_packaging/XBot/maven/v1'
name 'XBot'
authentication {
basic(BasicAuthentication)
}
}
}
}