diff --git a/build.gradle b/build.gradle index 49f0910233..fb4145dcda 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ plugins { id 'signing' id 'jacoco' id 'com.palantir.git-version' version '0.11.0' - id 'com.github.johnrengelman.shadow' version '7.1.2' + id 'com.github.johnrengelman.shadow' version '8.1.1' id 'com.github.spotbugs' version "5.0.13" } @@ -62,11 +62,11 @@ group = 'com.github.samtools' defaultTasks 'jar' -tasks.withType(JavaCompile) { +tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' } -tasks.withType(Javadoc) { +tasks.withType(Javadoc).configureEach { options.addStringOption('encoding', 'UTF-8') options.addStringOption('Xdoclint:none', '-quiet') } @@ -81,7 +81,7 @@ jar { import org.gradle.internal.os.OperatingSystem; -tasks.withType(Test) { task -> +tasks.withType(Test).configureEach { task -> task.outputs.upToDateWhen { false } // tests will always rerun // Always run serially because there are some very badly behaved tests in HTSJDK that @@ -99,8 +99,8 @@ tasks.withType(Test) { task -> beforeTest { descriptor -> count++ - if( count % 200 == 0) { - logger.lifecycle("Finished "+ Integer.toString(count++) + " tests") + if (count % 200 == 0) { + logger.lifecycle("Finished " + Integer.toString(count++) + " tests") } } @@ -118,7 +118,7 @@ tasks.withType(Test) { task -> } -task testWithDefaultReference(type: Test) { +tasks.register('testWithDefaultReference', Test) { description = "Run tests with a default reference File" jvmArgs += '-Dsamjdk.reference_fasta=src/test/resources/htsjdk/samtools/cram/ce.fa' @@ -127,7 +127,7 @@ task testWithDefaultReference(type: Test) { } } -task testWithOptimisticVCF4_4(type: Test) { +tasks.register('testWithOptimisticVCF4_4', Test) { description = "Run tests with optimistic VCF 4.4 reading" jvmArgs += '-Dsamjdk.optimistic_vcf_4_4=true' @@ -149,7 +149,7 @@ test { } dependsOn testWithDefaultReference, testWithOptimisticVCF4_4 -task testFTP(type: Test) { +tasks.register('testFTP', Test) { description = "Runs the tests that require connection to a remote ftp server" useTestNG { includeGroups "ftp" @@ -157,7 +157,7 @@ task testFTP(type: Test) { } } -task testExternalApis(type: Test) { +tasks.register('testExternalApis', Test) { description = "Run the SRA, ENA, and HTTP tests (tests that interact with external APIs)" jvmArgs += '-Dsamjdk.sra_libraries_download=true' @@ -169,7 +169,7 @@ task testExternalApis(type: Test) { if(project == rootProject) { wrapper { - gradleVersion = '7.6' + gradleVersion = '8.5' } } @@ -249,8 +249,4 @@ signing { sign publishing.publications.htsjdk } -gradle.taskGraph.beforeTask { Task task -> - println "executing $task ..." -} - -task install(dependsOn:publishToMavenLocal) +tasks.register('install') { dependsOn publishToMavenLocal } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e5832f0..943f0cbfa7 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 070cb702f0..3499ded5c1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index a69d9cb6c2..65dcd68d65 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,10 +80,10 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' @@ -143,12 +143,16 @@ fi if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac