Skip to content

Commit

Permalink
Update to gradle 8.5 (#1697)
Browse files Browse the repository at this point in the history
* update shadow plugin to 8.1.1
* 8.5 is necessary for running against java 21
  • Loading branch information
lbergelson authored Dec 18, 2023
1 parent 1ca889d commit 2d13eb7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
28 changes: 12 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down Expand Up @@ -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')
}
Expand All @@ -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
Expand All @@ -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")
}
}

Expand All @@ -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'

Expand All @@ -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'

Expand All @@ -149,15 +149,15 @@ 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"
excludeGroups "slow", "broken"
}
}

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'

Expand All @@ -169,7 +169,7 @@ task testExternalApis(type: Test) {

if(project == rootProject) {
wrapper {
gradleVersion = '7.6'
gradleVersion = '8.5'
}
}

Expand Down Expand Up @@ -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 }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
12 changes: 8 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -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/.
Expand All @@ -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"'
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2d13eb7

Please sign in to comment.