-
Notifications
You must be signed in to change notification settings - Fork 21
/
build.gradle
99 lines (83 loc) · 2.67 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
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 = "edu.wpi.first"
version = "2025.7.1"
if (project.hasProperty('publishVersion')) {
version = project.publishVersion
}
}
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
mavenLocal()
}
dependencies {
api project(':ToolchainPlugin')
implementation 'org.ajoberstar.grgit:grgit-core:5.0.0'
implementation 'com.google.code.gson:gson:2.8.6'
api 'edu.wpi.first:gradle-cpp-vscode:2.1.0'
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()
}
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 = 'edu.wpi.first.NativeUtils'
displayName = 'NativeUtils'
implementationClass = 'edu.wpi.first.nativeutils.NativeUtils'
description = 'This plugin provides native build utilities for FRC projects.'
tags = ['groovy', 'native', 'utils', 'maven', 'frc', '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*?[\\\"|\\']edu\\.wpi\\.first\\.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 \"edu.wpi.first.NativeUtils\" version \"${version}\"")
buildGradleFile.text = text
}
}
}
}
}
jar.finalizedBy PatchExamples
wrapper {
gradleVersion = '8.11'
distributionType = Wrapper.DistributionType.BIN
}