Skip to content

Commit e2bb2f0

Browse files
pditommasoclaude
andauthored
Update Gradle build system to version 9.1.0 [ci fast] (#6418)
Signed-off-by: Paolo Di Tommaso <[email protected]> Co-authored-by: Claude <[email protected]>
1 parent 249eb1a commit e2bb2f0

File tree

8 files changed

+48
-17
lines changed

8 files changed

+48
-17
lines changed

build.gradle

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ allprojects {
100100
module("commons-logging:commons-logging") { replacedBy("org.slf4j:jcl-over-slf4j") }
101101
}
102102

103+
// JUnit Platform launcher required for Gradle 9.1+ when using useJUnitPlatform()
104+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
105+
103106
// Documentation required libraries
104107
groovyDoc 'org.fusesource.jansi:jansi:2.4.0'
105108
groovyDoc "org.apache.groovy:groovy-groovydoc:4.0.28"
@@ -250,20 +253,43 @@ def getRuntimeConfigs() {
250253
// note: migrating to gradle 7 does not work any more
251254
//result = result + cfg.getOutgoing().getArtifacts().getFiles()
252255
}
253-
return result
256+
return result?.files ?: []
254257
}
255258

256259
/*
257260
* Save the runtime classpath
261+
* NOTE: This task uses a provider to delay execution, but still triggers configuration
262+
* resolution when the provider is evaluated. While not ideal for Gradle 9.1's strict
263+
* configuration resolution requirements, this approach works in practice for our use case.
258264
*/
259265
task exportClasspath {
260266
dependsOn allprojects.jar
267+
268+
// Use provider to delay configuration resolution until task execution
269+
def configurationFiles = provider {
270+
def libs = []
271+
272+
// Resolve configurations during provider evaluation (not ideal but functional)
273+
['nextflow','nf-commons','nf-httpfs','nf-lang','nf-lineage'].each { moduleName ->
274+
def moduleProject = project(":$moduleName")
275+
def cfg = moduleProject.configurations.getByName('runtimeClasspath')
276+
libs.addAll(cfg.files.collect { it.canonicalPath })
277+
}
278+
279+
// Add module jars
280+
['nextflow','nf-commons','nf-httpfs','nf-lang','nf-lineage'].each {
281+
libs << file("modules/$it/build/libs/${it}-${version}.jar").canonicalPath
282+
}
283+
284+
return libs.unique()
285+
}
286+
287+
inputs.files(configurationFiles)
288+
outputs.file('.launch.classpath')
289+
261290
doLast {
262-
def home = System.getProperty('user.home')
263-
def all = getRuntimeConfigs()
264-
def libs = all.collect { File file -> /*println file.canonicalPath.replace(home, '$HOME');*/ file.canonicalPath; }
265-
['nextflow','nf-commons','nf-httpfs','nf-lang','nf-lineage'].each {libs << file("modules/$it/build/libs/${it}-${version}.jar").canonicalPath }
266-
file('.launch.classpath').text = libs.unique().join(':')
291+
def libs = configurationFiles.get()
292+
file('.launch.classpath').text = libs.join(':')
267293
}
268294
}
269295

gradle/wrapper/gradle-wrapper.jar

311 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -84,7 +86,7 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
8890

8991
# Use the maximum available, or set MAX_FD != -1 to use that value.
9092
MAX_FD=maximum
@@ -112,7 +114,7 @@ case "$( uname )" in #(
112114
NONSTOP* ) nonstop=true ;;
113115
esac
114116

115-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
117+
CLASSPATH="\\\"\\\""
116118

117119

118120
# Determine the Java command to use to start the JVM.
@@ -203,15 +205,15 @@ fi
203205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204206

205207
# Collect all arguments for the java command:
206-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207209
# and any embedded shellness will be escaped.
208210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209211
# treated as '${Hostname}' itself on the command line.
210212

211213
set -- \
212214
"-Dorg.gradle.appname=$APP_BASE_NAME" \
213215
-classpath "$CLASSPATH" \
214-
org.gradle.wrapper.GradleWrapperMain \
216+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
215217
"$@"
216218

217219
# Stop when "xargs" is not available.

gradlew.bat

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################
@@ -68,11 +70,11 @@ goto fail
6870
:execute
6971
@rem Setup the command line
7072

71-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73+
set CLASSPATH=
7274

7375

7476
@rem Execute Gradle
75-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
77+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
7678

7779
:end
7880
@rem End local scope for the variables with windows NT shell

modules/nextflow/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id "com.gradleup.shadow" version "8.3.5"
2+
id "com.gradleup.shadow" version "8.3.8"
33
}
44
apply plugin: 'groovy'
55
apply plugin: 'application'
@@ -87,11 +87,12 @@ shadowJar {
8787
configurations = [project.configurations.runtimeClasspath, project.configurations.lineageImplementation]
8888
archiveClassifier='one'
8989
manifest {
90-
attributes 'Main-Class': "$mainClassName"
90+
attributes 'Main-Class': application.mainClass.get()
9191
}
9292
mergeServiceFiles()
9393
mergeGroovyExtensionModules()
9494
transform(com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer) {
9595
resource = 'META-INF/extensions.idx'
9696
}
9797
}
98+

packing.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies {
2626
}
2727

2828

29-
ext.mainClassName = 'nextflow.cli.Launcher'
29+
// ext.mainClassName removed - now using application.mainClass in Shadow plugin
3030
ext.homeDir = System.properties['user.home']
3131
ext.nextflowDir = "$homeDir/.nextflow/framework/$version"
3232
ext.releaseDir = "$buildDir/releases"

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ plugins {
2222
// required to download the toolchain (jdk) from a remote repository
2323
// https://github.com/gradle/foojay-toolchains
2424
// https://docs.gradle.org/current/userguide/toolchains.html#sub:download_repositories
25-
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
25+
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
2626
}
2727

2828
rootProject.name = 'nextflow-prj'

0 commit comments

Comments
 (0)