-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.gradle
More file actions
executable file
·123 lines (101 loc) · 3.67 KB
/
build.gradle
File metadata and controls
executable file
·123 lines (101 loc) · 3.67 KB
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
import groovy.json.JsonSlurper
plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2026.2.1"
id "org.jetbrains.kotlin.jvm" version "2.2.0"
id "org.jetbrains.kotlin.kapt" version "2.2.0"
id "idea"
id "maven-publish"
id "java-library"
}
// Disable all simulation and deploy tasks since meanlib is a library
gradle.afterProject { proj ->
if (proj.name == "meanlib") {
proj.tasks.configureEach { task ->
if (task.name.toLowerCase().contains("simulate") ||
task.name.toLowerCase().contains("deploy")) {
task.enabled = false
}
}
}
}
group = "org.team2471.lib"
version = "2026"
repositories {
mavenCentral()
maven { url "https://frcmaven.wpi.edu/artifactory/release/" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://maven.ctr-electronics.com/release/" }
maven { url "https://maven.revrobotics.com/" }
maven { url "https://maven.photonvision.org/repository/internal" }
maven { url "https://frcmaven.wpi.edu/artifactory/littletonrobotics-mvn-release/" }
maven { url "https://lib.choreo.autos/dep" }
maven { url "https://shenzhen-robotics-alliance.github.io/maple-sim/vendordep/repos/releases" }
}
kotlin {
jvmToolchain(17)
}
// Automatically download library documentation from libraries
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
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()
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation "org.jetbrains.kotlin:kotlin-reflect"
implementation "org.apache.commons:commons-math3:3.6.1"
testImplementation "org.junit.jupiter:junit-jupiter:5.10.1"
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
def akitFile = file("$projectDir/vendordeps/AdvantageKit.json")
kapt "org.littletonrobotics.akit:akit-autolog:${new JsonSlurper().parseText(akitFile.text).version}"
}
tasks.test {
useJUnitPlatform()
systemProperty "junit.jupiter.extensions.autodetection.enabled", "true"
testLogging {
events "passed", "skipped", "failed"
}
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs += "-XDstringConcat=inline"
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = "17"
}
}
wpi.java.configureTestTasks(tasks.test)
// Prevent GradleRIO from trying to configure executable tasks
wpi.java.configureExecutableTasks(null)
tasks.register("printVendordeps") {
doLast {
def vd = file("$projectDir/vendordeps")
if (!vd.exists()) {
println "No vendordeps folder found"
} else {
vd.listFiles().each {
if (it.name.endsWith(".json")) {
println "Vendordep: ${it.name}"
try {
def json = new JsonSlurper().parseText(it.text)
println " name: ${json.name}, version: ${json.version}"
} catch (ignored) {
println " (bad JSON)"
}
}
}
}
}
}