@@ -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 */
259265task 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
0 commit comments