-
Notifications
You must be signed in to change notification settings - Fork 70
/
build.gradle
118 lines (96 loc) · 2.97 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
plugins {
id "com.gradle.plugin-publish" version "1.2.1"
id 'java-gradle-plugin'
id 'idea'
id 'maven-publish'
id 'java'
id 'groovy'
}
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
mavenLocal()
}
dependencies {
api 'com.google.code.gson:gson:2.8.6'
api 'edu.wpi.first:native-utils:2025.6.0'
api 'de.undercouch:gradle-download-task:4.1.2'
testImplementation('org.spockframework:spock-core:2.0-M4-groovy-3.0') {
exclude group: 'org.codehaus.groovy'
}
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testImplementation gradleTestKit()
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
base {
archivesName = "GradleRIO"
}
java {
sourceCompatibility = 17
targetCompatibility = 17
}
allprojects {
group = "edu.wpi.first"
if (project.hasProperty('publishVersion')) {
version = project.publishVersion
}
tasks.withType(Javadoc) {
options.addBooleanOption('Xdoclint:all,-missing', true)
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
gradlePlugin {
website = 'https://github.com/wpilibsuite/GradleRIO'
vcsUrl = 'https://github.com/wpilibsuite/GradleRIO'
plugins {
gradleRio {
id = 'edu.wpi.first.GradleRIO'
displayName = 'GradleRIO'
implementationClass = 'edu.wpi.first.gradlerio.GradleRIOPlugin'
description = 'Managing FRC projects, the Gradle way (2019+)'
tags = ['frc', 'wpilib', 'gradlerio']
}
}
}
apply from: 'versionupdates.gradle'
def examplesFolder = file("$rootDir/testing")
tasks.register('PatchExamples') {
doLast {
String regex = "(id\\s*?[\\\"|\\']edu\\.wpi\\.first\\.GradleRIO[\\\"|\\'].*?version\\s*?[\\\"|\\'])(.+?)([\\\"|\\'])";
examplesFolder.eachFile { File file ->
if (file.isDirectory() && file.name != '_archived') {
def buildGradleFile = new File(file, 'build.gradle')
if (buildGradleFile.exists() && buildGradleFile.isFile()) {
def text = buildGradleFile.text
text = text.replaceAll(regex, "id \"edu.wpi.first.GradleRIO\" version \"${version}\"")
buildGradleFile.text = text
}
}
}
}
}
task zipExamples(dependsOn: PatchExamples)
examplesFolder.eachFile { File file ->
if (file.isDirectory() && file.name != '_archived') {
task "zipExample${file.name}"(type: Zip) {
from(file) {
archiveFileName = "${file.name}.zip"
exclude 'build/'
exclude '.gradle/'
}
zipExamples.dependsOn it
it.dependsOn PatchExamples
}
}
}
jar.finalizedBy zipExamples
wrapper {
gradleVersion = '8.11'
distributionType = Wrapper.DistributionType.BIN
}