Minor tweaks to build script

Mostly just rearranging. Bump JUnit version in an attempt to fix test
outputs, but it appears this is a mix of gradle/gradle#5975 and
gradle/gradle#4438.
This commit is contained in:
SquidDev 2019-06-15 11:05:45 +01:00
parent 29dce26bf6
commit f68ab3edd1
1 changed files with 28 additions and 21 deletions

View File

@ -78,12 +78,14 @@
shade 'org.squiddev:Cobalt:0.5.0-SNAPSHOT'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.1.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.1.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.2'
deployerJars "org.apache.maven.wagon:wagon-ssh:3.0.0"
}
// Compile tasks
javadoc {
include "dan200/computercraft/api/**/*.java"
}
@ -102,6 +104,14 @@
from configurations.shade.collect { it.isDirectory() ? it : zipTree(it) }
}
[compileJava, compileTestJava].forEach {
it.configure {
options.compilerArgs << "-Xlint" << "-Xlint:-processing" << "-Werror"
}
}
import java.nio.charset.StandardCharsets
import java.nio.file.*
import java.util.zip.*
@ -233,7 +243,14 @@ task compressJson(dependsOn: extractAnnotationsJar) {
assemble.dependsOn compressJson
/* Check tasks */
// Check tasks
test {
useJUnitPlatform()
testLogging {
events "skipped", "failed"
}
}
license {
mapping("java", "SLASHSTAR_STYLE")
@ -257,6 +274,13 @@ task compressJson(dependsOn: extractAnnotationsJar) {
}
}
gradle.projectsEvaluated {
tasks.withType(LicenseFormat) {
outputs.upToDateWhen { false }
}
}
task licenseAPI(type: LicenseCheck);
task licenseFormatAPI(type: LicenseFormat);
[licenseAPI, licenseFormatAPI].forEach {
@ -267,7 +291,7 @@ task compressJson(dependsOn: extractAnnotationsJar) {
}
}
/* Upload tasks */
// Upload tasks
task checkRelease {
group "upload"
@ -399,22 +423,5 @@ task uploadAll(dependsOn: uploadTasks) {
description "Uploads to all repositories (Maven, Curse, GitHub release)"
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint" << "-Xlint:-processing" << "-Werror"
}
tasks.withType(LicenseFormat) {
outputs.upToDateWhen { false }
}
}
runClient.outputs.upToDateWhen { false }
runServer.outputs.upToDateWhen { false }