Skip to content

Commit 24d0865

Browse files
authored
Merge branch 'master' into nextflow-auth
2 parents c5a3283 + dc8d474 commit 24d0865

File tree

13 files changed

+74
-25
lines changed

13 files changed

+74
-25
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

docs/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ New versions of Nextflow are released regularly. See {ref}`updating-nextflow-pag
1212

1313
## Requirements
1414

15-
Nextflow requires Bash 3.2 (or later) and [Java 17 (or later, up to 24)](http://www.oracle.com/technetwork/java/javase/downloads/index.html) to be installed. To see which version of Java you have, run the following command:
15+
Nextflow requires Bash 3.2 (or later) and [Java 17 (or later, up to 25)](http://www.oracle.com/technetwork/java/javase/downloads/index.html) to be installed. To see which version of Java you have, run the following command:
1616

1717
```{code-block} bash
1818
:class: copyable

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

launch.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ fi
6666
JAVA_VER=$(echo "$JAVA_VER" | awk '/version/ {gsub(/"/, "", $3); print $3}')
6767
major=${BASH_REMATCH[1]}
6868
minor=${BASH_REMATCH[2]}
69-
version_check="^(17|18|19|20|21|23|24)"
69+
version_check="^(17|18|19|20|21|23|24|25)"
7070
if [[ ! $JAVA_VER =~ $version_check ]]; then
7171
echo "Error: cannot find Java or it's a wrong version -- please make sure that Java 17 or higher is installed"
7272
exit 1
7373
fi
7474
JVM_ARGS+=" -Dfile.encoding=UTF-8 -XX:+TieredCompilation -XX:TieredStopAtLevel=1"
7575
JVM_ARGS+=" --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio.file.spi=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.nio.fs=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.https=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.ftp=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.file=ALL-UNNAMED --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --add-opens=java.base/jdk.internal.vm=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED"
76-
[[ "$JAVA_VER" =~ ^(24) ]]&& JVM_ARGS+=" --enable-native-access=ALL-UNNAMED --sun-misc-unsafe-memory-access=allow"
76+
[[ "$JAVA_VER" =~ ^(24|25) ]]&& JVM_ARGS+=" --enable-native-access=ALL-UNNAMED --sun-misc-unsafe-memory-access=allow"
7777
[[ $NXF_ENABLE_VIRTUAL_THREADS == 'true' ]] && [[ "$JAVA_VER" =~ ^(19|20) ]] && JVM_ARGS+=" --enable-preview"
7878
[[ "$JAVA_VER" =~ ^(21) ]] && [[ ! "$NXF_ENABLE_VIRTUAL_THREADS" ]] && NXF_ENABLE_VIRTUAL_THREADS=true
7979

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+

modules/nextflow/src/main/groovy/nextflow/script/ScriptMeta.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class ScriptMeta {
256256
final result = new HashSet(definitions.size() + imports.size())
257257
// local definitions
258258
for( def item : definitions.values() ) {
259-
if( item instanceof WorkflowDef && item.name != null )
259+
if( item instanceof WorkflowDef && item.name )
260260
result.add(item.name)
261261
}
262262
// processes from imports

modules/nextflow/src/test/groovy/nextflow/script/ScriptDslTest.groovy

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,4 +626,22 @@ class ScriptDslTest extends Dsl2Spec {
626626
e2.message == 'Missing process or function Channel.doesNotExist()'
627627
}
628628

629+
def 'should show proper error message for invalid entry name' () {
630+
when:
631+
// Use dsl_eval with an invalid entry name to trigger the error
632+
dsl_eval('invalidEntry', '''
633+
workflow validWorkflow {
634+
/println 'valid'/
635+
}
636+
637+
workflow {
638+
/println 'default'/
639+
}
640+
''')
641+
642+
then:
643+
def err = thrown(IllegalArgumentException)
644+
err.message.contains('Unknown workflow entry name: invalidEntry')
645+
}
646+
629647
}

0 commit comments

Comments
 (0)