2018-04-29 13:29:07 -07:00
|
|
|
apply plugin: 'maven-publish'
|
2019-11-12 17:14:04 -08:00
|
|
|
apply plugin: 'java-library'
|
2019-06-28 23:01:02 -04:00
|
|
|
apply plugin: 'jacoco'
|
2018-04-29 13:29:07 -07:00
|
|
|
|
|
|
|
|
def baseArtifactId = project.baseId
|
|
|
|
|
def artifactGroupId = project.groupId
|
2024-09-18 23:44:01 -04:00
|
|
|
def javaBaseName = "_GROUP_${project.groupId.replace('.', '_')}_ID_${project.baseId}-java_CLS"
|
2018-04-29 13:29:07 -07:00
|
|
|
|
|
|
|
|
def outputsFolder = file("$project.buildDir/outputs")
|
|
|
|
|
|
|
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
2023-05-12 21:27:31 -07:00
|
|
|
archiveClassifier = 'sources'
|
2018-04-29 13:29:07 -07:00
|
|
|
from sourceSets.main.allSource
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task javadocJar(type: Jar, dependsOn: javadoc) {
|
2023-05-12 21:27:31 -07:00
|
|
|
archiveClassifier = 'javadoc'
|
2018-04-29 13:29:07 -07:00
|
|
|
from javadoc.destinationDir
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task outputJar(type: Jar, dependsOn: classes) {
|
2019-11-12 17:14:04 -08:00
|
|
|
archiveBaseName = javaBaseName
|
|
|
|
|
destinationDirectory = outputsFolder
|
2018-04-29 13:29:07 -07:00
|
|
|
from sourceSets.main.output
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task outputSourcesJar(type: Jar, dependsOn: classes) {
|
2019-11-12 17:14:04 -08:00
|
|
|
archiveBaseName = javaBaseName
|
|
|
|
|
destinationDirectory = outputsFolder
|
2023-05-12 21:27:31 -07:00
|
|
|
archiveClassifier = 'sources'
|
2018-04-29 13:29:07 -07:00
|
|
|
from sourceSets.main.allSource
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task outputJavadocJar(type: Jar, dependsOn: javadoc) {
|
2019-11-12 17:14:04 -08:00
|
|
|
archiveBaseName = javaBaseName
|
|
|
|
|
destinationDirectory = outputsFolder
|
2023-05-12 21:27:31 -07:00
|
|
|
archiveClassifier = 'javadoc'
|
2018-04-29 13:29:07 -07:00
|
|
|
from javadoc.destinationDir
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
artifacts {
|
2025-09-22 10:58:14 -07:00
|
|
|
tasks.named("assemble") {
|
|
|
|
|
dependsOn(sourcesJar)
|
|
|
|
|
dependsOn(javadocJar)
|
|
|
|
|
dependsOn(outputJar)
|
|
|
|
|
dependsOn(outputSourcesJar)
|
|
|
|
|
dependsOn(outputJavadocJar)
|
|
|
|
|
}
|
2018-04-29 13:29:07 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addTaskToCopyAllOutputs(outputSourcesJar)
|
|
|
|
|
addTaskToCopyAllOutputs(outputJavadocJar)
|
|
|
|
|
addTaskToCopyAllOutputs(outputJar)
|
|
|
|
|
|
|
|
|
|
build.dependsOn outputSourcesJar
|
|
|
|
|
build.dependsOn outputJavadocJar
|
|
|
|
|
build.dependsOn outputJar
|
|
|
|
|
|
|
|
|
|
project(':').libraryBuild.dependsOn build
|
|
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
|
publications {
|
|
|
|
|
|
|
|
|
|
java(MavenPublication) {
|
|
|
|
|
artifact jar
|
|
|
|
|
artifact sourcesJar
|
|
|
|
|
artifact javadocJar
|
|
|
|
|
|
|
|
|
|
artifactId = "${baseArtifactId}-java"
|
2025-08-08 08:08:34 -07:00
|
|
|
groupId = artifactGroupId
|
|
|
|
|
version = wpilibVersioning.version.get()
|
2018-04-29 13:29:07 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
test {
|
2025-08-08 23:04:02 -07:00
|
|
|
jvmArgs '--enable-native-access=ALL-UNNAMED'
|
2018-05-29 02:07:28 -04:00
|
|
|
useJUnitPlatform()
|
2018-06-24 03:19:45 -04:00
|
|
|
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
|
2018-04-29 13:29:07 -07:00
|
|
|
testLogging {
|
|
|
|
|
events "failed"
|
2025-08-08 08:08:34 -07:00
|
|
|
exceptionFormat = "full"
|
2018-04-29 13:29:07 -07:00
|
|
|
}
|
2019-06-28 23:01:02 -04:00
|
|
|
finalizedBy jacocoTestReport
|
2018-04-29 13:29:07 -07:00
|
|
|
}
|
|
|
|
|
|
2024-11-30 18:04:00 +00:00
|
|
|
if (project.hasProperty('onlylinuxathena') || project.hasProperty('onlylinuxsystemcore') || project.hasProperty('onlylinuxarm32') || project.hasProperty('onlylinuxarm64') || project.hasProperty('onlywindowsarm64')) {
|
2018-04-29 13:29:07 -07:00
|
|
|
test.enabled = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
repositories {
|
2022-05-08 13:59:58 -07:00
|
|
|
maven {
|
|
|
|
|
url = 'https://frcmaven.wpi.edu/artifactory/ex-mvn'
|
|
|
|
|
}
|
2018-10-07 18:11:57 -07:00
|
|
|
//maven.url "https://oss.sonatype.org/content/repositories/snapshots/"
|
2018-04-29 13:29:07 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
|
dev
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-17 17:19:03 -07:00
|
|
|
configurations {
|
|
|
|
|
devImplementation.extendsFrom(implementation)
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-21 00:25:24 -08:00
|
|
|
tasks.withType(JavaCompile).configureEach {
|
2021-07-29 22:42:43 -07:00
|
|
|
options.compilerArgs = [
|
|
|
|
|
'--release',
|
2025-07-26 06:45:40 +08:00
|
|
|
'21',
|
2021-07-29 22:42:43 -07:00
|
|
|
'-encoding',
|
2022-05-24 13:56:48 -07:00
|
|
|
'UTF8',
|
|
|
|
|
"-Werror",
|
2022-06-07 03:06:43 +03:00
|
|
|
"-Xlint:all",
|
|
|
|
|
// ignore AutoCloseable warnings
|
|
|
|
|
"-Xlint:-try",
|
|
|
|
|
// ignore missing serialVersionUID warnings
|
|
|
|
|
"-Xlint:-serial",
|
2024-07-16 20:25:43 -04:00
|
|
|
// ignore unclaimed annotation warning from annotation processing
|
|
|
|
|
"-Xlint:-processing",
|
2021-07-29 22:42:43 -07:00
|
|
|
]
|
2018-04-29 13:29:07 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dependencies {
|
2026-02-20 18:31:33 -05:00
|
|
|
testImplementation libs.junit.api
|
|
|
|
|
testRuntimeOnly libs.junit.launcher
|
2018-05-29 02:07:28 -04:00
|
|
|
|
2019-11-12 17:14:04 -08:00
|
|
|
devImplementation sourceSets.main.output
|
2018-04-29 13:29:07 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task run(type: JavaExec) {
|
|
|
|
|
classpath = sourceSets.dev.runtimeClasspath
|
|
|
|
|
|
2021-09-19 17:59:14 -07:00
|
|
|
mainClass = project.devMain
|
2018-04-29 13:29:07 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
build.dependsOn devClasses
|
2019-06-28 23:01:02 -04:00
|
|
|
|
|
|
|
|
jacoco {
|
2025-08-08 23:04:02 -07:00
|
|
|
toolVersion = "0.8.13"
|
2019-06-28 23:01:02 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
jacocoTestReport {
|
|
|
|
|
reports {
|
2021-09-19 17:59:14 -07:00
|
|
|
xml.required = true
|
|
|
|
|
html.required = true
|
2019-06-28 23:01:02 -04:00
|
|
|
}
|
|
|
|
|
}
|