From f68ab3edd1cff3e0d4dd21a4c0c00cda684b8f07 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Sat, 15 Jun 2019 11:05:45 +0100 Subject: [PATCH] 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. --- build.gradle | 49 ++++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/build.gradle b/build.gradle index 793175ac9..c5947bf18 100644 --- a/build.gradle +++ b/build.gradle @@ -78,12 +78,14 @@ dependencies { 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 @@ jar { 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 @@ license { } } +gradle.projectsEvaluated { + tasks.withType(LicenseFormat) { + outputs.upToDateWhen { false } + } +} + + task licenseAPI(type: LicenseCheck); task licenseFormatAPI(type: LicenseFormat); [licenseAPI, licenseFormatAPI].forEach { @@ -267,7 +291,7 @@ task licenseFormatAPI(type: LicenseFormat); } } -/* 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 }