-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathbuild.gradle
More file actions
100 lines (84 loc) · 2.75 KB
/
build.gradle
File metadata and controls
100 lines (84 loc) · 2.75 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
plugins {
id "com.gradle.plugin-publish" version "1.2.1"
id 'java-gradle-plugin'
id 'maven-publish'
id 'groovy'
id 'java'
}
java {
sourceCompatibility = 17
targetCompatibility = 17
}
allprojects {
group = "org.wpilib"
version = "2027.7.1"
if (project.hasProperty('publishVersion')) {
version = project.publishVersion
}
}
repositories {
maven {
url = "https://plugins.gradle.org/m2/"
}
mavenLocal()
}
dependencies {
api project(':ToolchainPlugin')
implementation("org.eclipse.jgit:org.eclipse.jgit:7.4.0.202509020913-r")
implementation 'com.google.code.gson:gson:2.8.6'
api 'org.wpilib:gradle-cpp-vscode:2027.0.0'
testImplementation('org.spockframework:spock-core:2.4-M6-groovy-4.0') {
exclude group: 'org.codehaus.groovy'
}
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation gradleTestKit()
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
gradlePlugin {
website = 'https://github.com/wpilibsuite/native-utils'
vcsUrl = 'https://github.com/wpilibsuite/native-utils'
plugins {
NativeUtils {
id = 'org.wpilib.NativeUtils'
displayName = 'NativeUtils'
implementationClass = 'org.wpilib.nativeutils.NativeUtils'
description = 'This plugin provides native build utilities for FIRST projects.'
tags = ['groovy', 'native', 'utils', 'maven', 'frc', 'ftc', 'first', 'wpilib']
}
}
}
tasks.withType(Javadoc) {
options.addBooleanOption('Xdoclint:all,-missing', true)
}
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:unchecked'
options.deprecation = true
}
def examplesFolder = file("$rootDir/testing")
tasks.register('PatchExamples') {
doLast {
String regex = "(id\\s*?[\\\"|\\']org\\.wpilib\\.NativeUtils[\\\"|\\'].*?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 \"org.wpilib.NativeUtils\" version \"${version}\"")
buildGradleFile.text = text
}
}
}
}
}
jar.finalizedBy PatchExamples
wrapper {
gradleVersion = '9.2.0'
distributionType = Wrapper.DistributionType.BIN
}