2018-04-29 13:29:07 -07:00
|
|
|
apply plugin: 'maven-publish'
|
|
|
|
|
apply plugin: 'java'
|
2018-10-07 18:11:57 -07:00
|
|
|
//apply plugin: 'net.ltgt.errorprone'
|
2018-04-29 13:29:07 -07:00
|
|
|
|
|
|
|
|
def pubVersion
|
|
|
|
|
if (project.hasProperty("publishVersion")) {
|
|
|
|
|
pubVersion = project.publishVersion
|
|
|
|
|
} else {
|
|
|
|
|
pubVersion = WPILibVersion.version
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def baseArtifactId = project.baseId
|
|
|
|
|
def artifactGroupId = project.groupId
|
|
|
|
|
def javaBaseName = "_GROUP_edu_wpi_first_${project.baseId}_ID_${project.baseId}-java_CLS"
|
|
|
|
|
|
|
|
|
|
def outputsFolder = file("$project.buildDir/outputs")
|
|
|
|
|
|
|
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
|
|
|
classifier = 'sources'
|
|
|
|
|
from sourceSets.main.allSource
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task javadocJar(type: Jar, dependsOn: javadoc) {
|
|
|
|
|
classifier = 'javadoc'
|
|
|
|
|
from javadoc.destinationDir
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task outputJar(type: Jar, dependsOn: classes) {
|
|
|
|
|
baseName javaBaseName
|
|
|
|
|
destinationDir outputsFolder
|
|
|
|
|
from sourceSets.main.output
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task outputSourcesJar(type: Jar, dependsOn: classes) {
|
|
|
|
|
baseName javaBaseName
|
|
|
|
|
destinationDir outputsFolder
|
|
|
|
|
classifier = 'sources'
|
|
|
|
|
from sourceSets.main.allSource
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task outputJavadocJar(type: Jar, dependsOn: javadoc) {
|
|
|
|
|
baseName javaBaseName
|
|
|
|
|
destinationDir outputsFolder
|
|
|
|
|
classifier = 'javadoc'
|
|
|
|
|
from javadoc.destinationDir
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
|
archives sourcesJar
|
|
|
|
|
archives javadocJar
|
|
|
|
|
archives outputJar
|
|
|
|
|
archives outputSourcesJar
|
|
|
|
|
archives outputJavadocJar
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
groupId artifactGroupId
|
|
|
|
|
version pubVersion
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
test {
|
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"
|
|
|
|
|
exceptionFormat "full"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-28 14:09:10 -07:00
|
|
|
if (project.hasProperty('onlylinuxathena') || project.hasProperty('onlylinuxraspbian')) {
|
2018-04-29 13:29:07 -07:00
|
|
|
test.enabled = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
|
mavenCentral()
|
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
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-21 00:25:24 -08:00
|
|
|
tasks.withType(JavaCompile).configureEach {
|
2019-05-19 16:59:45 -07:00
|
|
|
options.compilerArgs = ['--release', '11']
|
2018-04-29 13:29:07 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dependencies {
|
2018-05-29 02:07:28 -04:00
|
|
|
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.2.0'
|
2018-06-11 18:01:49 -04:00
|
|
|
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.2.0'
|
2018-05-29 02:07:28 -04:00
|
|
|
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.2.0'
|
|
|
|
|
|
2018-04-29 13:29:07 -07:00
|
|
|
devCompile sourceSets.main.output
|
2018-07-29 12:32:22 -04:00
|
|
|
|
2018-10-07 18:11:57 -07:00
|
|
|
//errorprone 'com.google.errorprone:error_prone_core:2.3.2-SNAPSHOT'
|
|
|
|
|
//errorproneJavac 'com.google.errorprone:error_prone_core:2.3.1'
|
2018-04-29 13:29:07 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
task run(type: JavaExec) {
|
|
|
|
|
classpath = sourceSets.dev.runtimeClasspath
|
|
|
|
|
|
|
|
|
|
main = project.devMain
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
build.dependsOn devClasses
|