-
Notifications
You must be signed in to change notification settings - Fork 29
/
build.gradle
156 lines (132 loc) · 4.12 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
plugins {
id 'java'
id 'jacoco'
id 'application'
id 'maven-publish'
id "com.jfrog.artifactory" version "5.2.4"
id 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin' version '2024.0.0'
id 'edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin' version '2020.2'
id 'io.franzbecker.gradle-lombok' version '5.0.0'
id 'com.gradleup.shadow' version '8.3.3'
id "de.undercouch.download" version "5.6.0"
id 'org.aim42.htmlSanityCheck' version '2.0.0-rc2'
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
wpilibVersioning.buildServerMode = project.hasProperty('buildServer')
wpilibVersioning.releaseMode = project.hasProperty('releaseMode')
repositories {
mavenCentral()
}
if (project.hasProperty('releaseMode')) {
wpilibRepositories.addAllReleaseRepositories(project)
} else {
wpilibRepositories.addAllDevelopmentRepositories(project)
}
if (System.getenv()['RUN_AZURE_ARTIFACTORY_RELEASE'] != null) {
artifactory {
contextUrl = 'https://frcmaven.wpi.edu/artifactory' // base artifactory url
publish {
repository {
if (project.hasProperty('releaseMode')) {
repoKey = 'release'
} else {
repoKey = 'development'
}
username = System.getenv()['ARTIFACTORY_PUBLISH_USERNAME']
password = System.getenv()['ARTIFACTORY_PUBLISH_PASSWORD']
}
defaults {
publications ('maven')
}
}
clientConfig.info.setBuildName('RobotBuilder')
}
publish.dependsOn artifactoryPublish
}
application {
mainClass.set("robotbuilder.RobotBuilder")
}
wpilibVersioning.version.finalizeValue()
jacoco {
toolVersion = "0.8.12"
}
jacocoTestReport {
reports {
xml.required = true
html.required = true
}
}
def downloadNewCommands = tasks.register('downloadNewCommands', Download) {
src 'https://raw.githubusercontent.com/wpilibsuite/allwpilib/main/wpilibNewCommands/WPILibNewCommands.json'
dest 'build/resources/main/export/vendordeps/WPILibNewCommands.json'
overwrite true
}
check.dependsOn jacocoTestReport
check.dependsOn htmlSanityCheck
lombok {
version = "1.18.34"
sha256 = ""
}
compileJava {
options.encoding = "UTF-8"
dependsOn downloadNewCommands
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.apache.velocity:velocity-engine-core:2.4'
implementation 'org.yaml:snakeyaml:2.3'
implementation 'commons-io:commons-io:2.17.0'
implementation 'org.apache.commons:commons-lang3:3.17.0'
implementation 'org.slf4j:slf4j-api:2.0.16'
implementation 'org.slf4j:slf4j-jdk14:2.0.16'
implementation 'com.sun.activation:javax.activation:1.2.0'
testImplementation 'junit:junit:4.13.2'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
compileOnly 'org.projectlombok:lombok:1.18.34'
}
test {
testLogging {
events "failed"
exceptionFormat "full"
}
}
jar {
manifest {
attributes('Implementation-Title': 'RobotBuilder',
'Implementation-Version': wpilibVersioning.version.get(),
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'))
}
}
import org.aim42.htmlsanitycheck.check.*
htmlSanityCheck {
sourceDir = new File( "src/main/resources/help" )
// where to put results of sanityChecks...
checkingResultsDir = new File( "$buildDir/reports/htmlchecks" )
// fail build on errors?
failOnErrors = true
checkerClasses = [BrokenCrossReferencesChecker,
// BrokenHttpLinksChecker, //Disable link checker due to hanging on Vex links
DuplicateIdChecker,
ImageMapChecker,
MissingAltInImageTagsChecker,
MissingLocalResourcesChecker]
}
publishing {
publications {
maven(MavenPublication) {
artifact(shadowJar) {
classifier null
}
groupId 'edu.wpi.first.tools'
artifactId 'RobotBuilder'
version wpilibVersioning.version.get()
}
}
}