From 7530f39dfbb0c52e62372d7707283557f97e3721 Mon Sep 17 00:00:00 2001 From: "Dr. Ernie Prabhakar" <19791+drernie@users.noreply.github.com> Date: Tue, 26 Nov 2024 14:04:44 -0800 Subject: [PATCH 1/7] avoid stringifying value --- .../nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy | 4 ++-- wf/ids.csv | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 wf/ids.csv diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy index 60ea4f7d..6510001b 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy @@ -80,8 +80,8 @@ class QuiltPackage { static String toJson(Map dict) { List entries = dict.collect { key, value -> String prefix = JsonOutput.toJson(key) - String suffix = "toJson.error: ${value}" - log.debug("QuiltPackage.toJson: ${prefix} [${suffix.length()}]") + log.debug("toJson.${key}: ${value.size()}") + String suffix = "toJson.error[${value.size()}]" try { suffix = JsonOutput.toJson(value) } diff --git a/wf/ids.csv b/wf/ids.csv new file mode 100644 index 00000000..39f12f74 --- /dev/null +++ b/wf/ids.csv @@ -0,0 +1 @@ +SRR9984183 \ No newline at end of file From 4dacfbd68eb237096befc247e2f36922e57bf862 Mon Sep 17 00:00:00 2001 From: "Dr. Ernie Prabhakar" <19791+drernie@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:27:36 -0800 Subject: [PATCH 2/7] revert value.size --- .../nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy index 6510001b..fa9b1789 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy @@ -80,8 +80,8 @@ class QuiltPackage { static String toJson(Map dict) { List entries = dict.collect { key, value -> String prefix = JsonOutput.toJson(key) - log.debug("toJson.${key}: ${value.size()}") - String suffix = "toJson.error[${value.size()}]" + log.debug("toJson.${key}: ${value}") + String suffix = "toJson.error[${value}]" try { suffix = JsonOutput.toJson(value) } From 59376c4392a6e2e063856fe993f9e2832fc2883d Mon Sep 17 00:00:00 2001 From: "Dr. Ernie Prabhakar" <19791+drernie@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:04:15 -0800 Subject: [PATCH 3/7] Fix READONLY_URL --- .../src/test/nextflow/quilt/jep/QuiltPackageTest.groovy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/jep/QuiltPackageTest.groovy b/plugins/nf-quilt/src/test/nextflow/quilt/jep/QuiltPackageTest.groovy index e3199ec9..86a38368 100644 --- a/plugins/nf-quilt/src/test/nextflow/quilt/jep/QuiltPackageTest.groovy +++ b/plugins/nf-quilt/src/test/nextflow/quilt/jep/QuiltPackageTest.groovy @@ -40,7 +40,8 @@ class QuiltPackageTest extends QuiltSpecification { private final static String PACKAGE_URL = 'quilt+s3://quilt-example#package=examples%2fsmart-report@d68a7e9' private final static String TEST_URL = PACKAGE_URL + '&path=README.md' - private final static String READONLY_URL = 'quilt+s3://allencell#package=test%2ftmp&path=foo%2fbar.txt' + private final static String RO_FILE='&path=aics_mnist.ipynb' + private final static String READONLY_URL = "quilt+s3://allencell#package=aics/aics_mnist" + RO_FILE private QuiltPathFactory factory private QuiltPath qpath @@ -195,7 +196,7 @@ class QuiltPackageTest extends QuiltSpecification { def qout = factory.parseUri(READONLY_URL) def opkg = qout.pkg() opkg.install() - def outPath = Paths.get(opkg.packageDest().toString(), 'foo/bar.txt') + def outPath = Paths.get(opkg.packageDest().toString(), RO_FILE) Files.writeString(outPath, "Time: ${timestamp}") expect: Files.exists(outPath) From d318efb88f182f9263335257e0a74ba33b309cef Mon Sep 17 00:00:00 2001 From: "Dr. Ernie Prabhakar" <19791+drernie@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:31:15 -0800 Subject: [PATCH 4/7] reproduce fetchngs error --- Makefile | 8 ++++++++ VERSION | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cac87772..18eb40f5 100644 --- a/Makefile +++ b/Makefile @@ -3,11 +3,13 @@ PROJECT ?= nf-quilt WRITE_BUCKET ?= udp-spec FRAGMENT ?= &path=. NF_DIR ?= ../nextflow +NF_GIT ?= $(NF_DIR)/nextflow NF_BIN ?= ./launch.sh PID ?= $$$$ PIPELINE ?= sarek QUERY ?= ?Name=$(USER)&Owner=Kevin+Moore&Date=2023-03-07&Type=CRISPR&Notebook+URL=http%3A%2F%2Fexample.com VERSION ?= $(shell grep 'Plugin-Version' plugins/$(PROJECT)/src/resources/META-INF/MANIFEST.MF | awk '{ print $$2 }') +NXF_VER ?= $(shell cat VERSION) TEST_URI ?= quilt+s3://$(WRITE_BUCKET)$(QUERY)\#package=nf-quilt/dest-$(VERSION)$(FRAGMENT) PIPE_OUT ?= quilt+s3://$(WRITE_BUCKET)\#package=$(PROJECT)/$(PIPELINE) S3_BASE = s3://$(WRITE_BUCKET)/$(PROJECT) @@ -107,6 +109,12 @@ $(PIPELINE): $(NF_BIN) install $(NF_BIN) pull nf-core/$(PIPELINE) $(NF_BIN) run nf-core/$(PIPELINE) -profile test,docker -plugins $(PROJECT)@$(VERSION) --outdir "$(PIPE_OUT)" +fetchngs: $(NF_GIT) + NXF_VER=$(NXF_VER) $(NF_GIT) run nf-core/fetchngs -profile test,docker --input wf/ids.csv --outdir "s3://$(WRITE_BUCKET)/nf-quilt/fetchngs" + +nf-git-ver: $(NF_GIT) + NXF_VER=$(NXF_VER) $(NF_GIT) -v + # # Show dependencies # diff --git a/VERSION b/VERSION index 27459e72..95795064 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -23.04.3 +24.10.2 From 646f056eb8fa8f7b63bf3bc29aaad7402f587bbd Mon Sep 17 00:00:00 2001 From: "Dr. Ernie Prabhakar" <19791+drernie@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:59:19 -0800 Subject: [PATCH 5/7] run fetchngs locally --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 18eb40f5..aab5a542 100644 --- a/Makefile +++ b/Makefile @@ -110,7 +110,7 @@ $(PIPELINE): $(NF_BIN) install $(NF_BIN) run nf-core/$(PIPELINE) -profile test,docker -plugins $(PROJECT)@$(VERSION) --outdir "$(PIPE_OUT)" fetchngs: $(NF_GIT) - NXF_VER=$(NXF_VER) $(NF_GIT) run nf-core/fetchngs -profile test,docker --input wf/ids.csv --outdir "s3://$(WRITE_BUCKET)/nf-quilt/fetchngs" + NXF_VER=$(NXF_VER) $(NF_BIN) run quiltdata/fetchngs -r master -profile test,docker --input wf/ids.csv --outdir "s3://$(WRITE_BUCKET)/nf-quilt/fetchngs" nf-git-ver: $(NF_GIT) NXF_VER=$(NXF_VER) $(NF_GIT) -v From da62adf7117e9b2575d260195166627174eb09b2 Mon Sep 17 00:00:00 2001 From: "Dr. Ernie Prabhakar" <19791+drernie@users.noreply.github.com> Date: Fri, 20 Dec 2024 10:58:10 -0800 Subject: [PATCH 6/7] remove Comparable --- plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltPath.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltPath.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltPath.groovy index 31b09e56..55dc45df 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltPath.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltPath.groovy @@ -41,7 +41,7 @@ import groovy.util.logging.Slf4j @Slf4j @CompileStatic -final class QuiltPath implements Path, Comparable { +final class QuiltPath implements Path { private final QuiltFileSystem filesystem private final QuiltParser parsed From 9ee6f9a14ba515e3ba1e0b62376ddb21ab5d0af4 Mon Sep 17 00:00:00 2001 From: "Dr. Ernie Prabhakar" Date: Sat, 21 Dec 2024 15:53:15 -0800 Subject: [PATCH 7/7] Fix versions (#278) Co-authored-by: Dr. Ernie Prabhakar <19791+drernie@users.noreply.github.com> --- .gitignore | 2 +- Makefile | 8 +- VERSION | 2 +- build.gradle | 79 ++++++++++--------- buildSrc/build.gradle | 14 ++++ ...flow.groovy-application-conventions.gradle | 11 +++ ....nextflow.groovy-common-conventions.gradle | 53 +++++++++++++ ...nextflow.groovy-library-conventions.gradle | 11 +++ gradle.properties | 4 + groovysh-task.gradle | 8 +- plugins/build.gradle | 37 +++++---- plugins/nf-quilt/build.gradle | 64 +++++++-------- .../nextflow/quilt/QuiltSpecification.groovy | 2 +- 13 files changed, 204 insertions(+), 91 deletions(-) create mode 100644 buildSrc/build.gradle create mode 100644 buildSrc/src/main/groovy/io.nextflow.groovy-application-conventions.gradle create mode 100644 buildSrc/src/main/groovy/io.nextflow.groovy-common-conventions.gradle create mode 100644 buildSrc/src/main/groovy/io.nextflow.groovy-library-conventions.gradle create mode 100644 gradle.properties diff --git a/.gitignore b/.gitignore index ea9f81ed..eb4237cd 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ .gradle .idea .nextflow* -gradle.properties +# gradle.properties # Ignore Gradle build output directory /build/ diff --git a/Makefile b/Makefile index aab5a542..8329a83b 100644 --- a/Makefile +++ b/Makefile @@ -32,9 +32,15 @@ check-env: clean: ./gradlew clean rm -rf null results work - rm -rf */*/build plugins/nf-quilt/bin + rm -rf build */build */*/build plugins/nf-quilt/bin rm -f .nextflow.log* .launch*classpath +clean-all: clean + rm -rf .gradle buildSrc/.gradle + +rebuild: + ./gradlew clean build --refresh-dependencies + compile: ./gradlew compileGroovy exportClasspath @echo "DONE `date`" diff --git a/VERSION b/VERSION index 95795064..7d7a0702 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -24.10.2 +23.10.0 diff --git a/build.gradle b/build.gradle index 6a5bea0e..e2f6da64 100644 --- a/build.gradle +++ b/build.gradle @@ -33,9 +33,14 @@ if (groovyVer) { maven { url repo } } - configurations.all { + configurations.configureEach { resolutionStrategy.eachDependency { DependencyResolveDetails details -> - if (details.requested.group == 'org.codehaus.groovy') { + force 'cglib:cglib-nodep:3.3.0' + force 'org.objenesis:objenesis:3.4' + + // (Optional) If transitive Groovy dependencies cause conflicts + force 'org.codehaus.groovy:groovy:3.0.19' + if ((details.requested.group == 'org.codehaus.groovy') && details.requested.version != groovyVer) { if (groovyVer.contains(':')) { details.useTarget(groovyVer) } @@ -49,12 +54,8 @@ if (groovyVer) { } } -def projects(String...args) { - args.collect { project(it) } -} group = 'io.nextflow' -version = rootProject.file('VERSION').text.trim() allprojects { apply plugin: 'java' @@ -65,17 +66,17 @@ allprojects { java { toolchain { - languageVersion = JavaLanguageVersion.of(17) + languageVersion = JavaLanguageVersion.of(javaLangVersion) } } compileJava { - options.release = 11 + options.release = jdkVersion.toInteger() } - tasks.withType(GroovyCompile) { - sourceCompatibility = '1.8' - targetCompatibility = '1.8' + tasks.withType(GroovyCompile).configureEach { + sourceCompatibility = jdkVersion + targetCompatibility = jdkVersion } idea { @@ -98,8 +99,8 @@ allprojects { dependencies { // see https://docs.gradle.org/4.1/userguide/dependency_management.html#sec:module_replacement - implementation 'com.github.groovy-wslite:groovy-wslite:1.1.3' - implementation 'org.codehaus.groovy:groovy-all:3.0.23' + // implementation 'com.github.groovy-wslite:groovy-wslite:1.1.3' + implementation "org.codehaus.groovy:groovy-all:$groovyVersion" implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.2' implementation 'com.upplication:s3fs:2.2.2' @@ -108,8 +109,8 @@ allprojects { } // Documentation required libraries groovyDoc 'org.fusesource.jansi:jansi:2.4.1' - groovyDoc 'org.codehaus.groovy:groovy-groovydoc:3.0.23' - groovyDoc 'org.codehaus.groovy:groovy-ant:3.0.23' + groovyDoc "org.codehaus.groovy:groovy-groovydoc:$groovyVersion" + groovyDoc "org.codehaus.groovy:groovy-ant:$groovyVersion" } test { @@ -127,42 +128,44 @@ allprojects { // Disable strict javadoc checks // See http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html if (JavaVersion.current().isJava8Compatible()) { - tasks.withType(Javadoc) { + tasks.withType(Javadoc).configureEach { options.addStringOption('Xdoclint:none', '-quiet') } } - tasks.withType(Jar) { + tasks.withType(Jar).configureEach { duplicatesStrategy = DuplicatesStrategy.INCLUDE } // patched as described here // http://forums.gradle.org/gradle/topics/gradle_task_groovydoc_failing_with_noclassdeffounderror - tasks.withType(Groovydoc) { + tasks.withType(Groovydoc).configureEach { groovyClasspath = project.configurations.groovyDoc includes = ['nextflow/**'] } // Required to run tests on Java 9 and higher in compatibility mode if (JavaVersion.current() >= JavaVersion.VERSION_1_9) { - tasks.withType(Test) { - jvmArgs([ - '--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.nio.file.spi=ALL-UNNAMED', - '--add-opens=java.base/java.net=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', - ]) + tasks.withType(Test).tap { + configureEach { + jvmArgs([ + '--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.nio.file.spi=ALL-UNNAMED', + '--add-opens=java.base/java.net=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', + ]) + } } } } @@ -195,8 +198,8 @@ task exportClasspath { dependsOn allprojects.jar doLast { def all = getRuntimeConfigs() - def libs = all.collect { File file -> file.canonicalPath; } - ['nextflow', 'nf-commons', 'nf-httfs'].each { libs << file("modules/$it/build/libs/${it}-${version}.jar").canonicalPath } + def libs = all.collect { File file -> file.canonicalPath } + ['nextflow', 'nf-commons', 'nf-httfs'].each { libs << file("modules/$it/build/libs/${it}-${nextflowVersion}.jar").canonicalPath } file('.launch.classpath').text = libs.unique().join(':') } } diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle new file mode 100644 index 00000000..66a0569c --- /dev/null +++ b/buildSrc/build.gradle @@ -0,0 +1,14 @@ +/* + * This file was generated by the Gradle 'init' task. + */ + +plugins { + // Support convention plugins written in Groovy. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build. + id 'groovy-gradle-plugin' +} + +repositories { + // Use the plugin portal to apply community plugins in convention plugins. + gradlePluginPortal() +} + diff --git a/buildSrc/src/main/groovy/io.nextflow.groovy-application-conventions.gradle b/buildSrc/src/main/groovy/io.nextflow.groovy-application-conventions.gradle new file mode 100644 index 00000000..ecc029b2 --- /dev/null +++ b/buildSrc/src/main/groovy/io.nextflow.groovy-application-conventions.gradle @@ -0,0 +1,11 @@ +/* + * This file was generated by the Gradle 'init' task. + */ + +plugins { + // Apply the common convention plugin for shared build configuration between library and application projects. + id 'io.nextflow.groovy-common-conventions' + + // Apply the application plugin to add support for building a CLI application in Java. + id 'application' +} diff --git a/buildSrc/src/main/groovy/io.nextflow.groovy-common-conventions.gradle b/buildSrc/src/main/groovy/io.nextflow.groovy-common-conventions.gradle new file mode 100644 index 00000000..4a077d92 --- /dev/null +++ b/buildSrc/src/main/groovy/io.nextflow.groovy-common-conventions.gradle @@ -0,0 +1,53 @@ +/* + * This file was generated by the Gradle 'init' task. + */ + +plugins { + // Apply the groovy Plugin to add support for Groovy. + id 'groovy' +} + +repositories { + // Use Maven Central for resolving dependencies. + mavenCentral() +} + +ext { + jdkVersion = '11' + javaLangVersion = 19 +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(javaLangVersion) // from nf-schema + } +} + +compileJava { + options.release.set(jdkVersion.toInteger()) +} + +tasks.withType(GroovyCompile) { + sourceCompatibility = jdkVersion + targetCompatibility = jdkVersion +} + +tasks.withType(Test) { + jvmArgs ([ + '--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.nio.file.spi=ALL-UNNAMED', + '--add-opens=java.base/java.net=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', + ]) +} diff --git a/buildSrc/src/main/groovy/io.nextflow.groovy-library-conventions.gradle b/buildSrc/src/main/groovy/io.nextflow.groovy-library-conventions.gradle new file mode 100644 index 00000000..0183e2cc --- /dev/null +++ b/buildSrc/src/main/groovy/io.nextflow.groovy-library-conventions.gradle @@ -0,0 +1,11 @@ +/* + * This file was generated by the Gradle 'init' task. + */ + +plugins { + // Apply the common convention plugin for shared build configuration between library and application projects. + id 'io.nextflow.groovy-common-conventions' + // Apply the java-library plugin for API and implementation separation. + id 'java-library' +} + diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..e25f3a34 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,4 @@ +nextflowVersion = 23.10.0 +groovyVersion = 3.0.19 +jdkVersion = 11 +javaLangVersion = 19 diff --git a/groovysh-task.gradle b/groovysh-task.gradle index 033c020a..7eee80ce 100644 --- a/groovysh-task.gradle +++ b/groovysh-task.gradle @@ -3,10 +3,10 @@ gradle.projectsLoaded { afterEvaluate { project -> if (!project.repositories.any { it.name == 'MavenRepo' }) { project.repositories { - // To be able to load org.apache.groovy:groovy-groovysh and dependencies + // To be able to load org.codehaus.groovy:groovy-groovysh and dependencies mavenCentral { content { - includeGroup 'org.apache.groovy' + includeGroup 'org.codehaus.groovy' includeGroup 'jline' includeGroup 'com.github.javaparser' includeGroup 'org.ow2.asm' @@ -21,7 +21,7 @@ gradle.projectsLoaded { } project.dependencies { - groovyshdependencies 'org.apache.groovy:groovy-groovysh:4.0.24' + groovyshdependencies 'org.codehaus.groovy:groovy-groovysh:4.0.24' } project.tasks.register('groovysh') { @@ -35,7 +35,7 @@ gradle.projectsLoaded { def groovyshClass def groovyShell - groovyshClass = Class.forName('org.apache.groovy.groovysh.Groovysh', true, groovyshClassLoader) + groovyshClass = Class.forName('org.codehaus.groovy.groovysh.Groovysh', true, groovyshClassLoader) if (groovyshClass) { groovyShell = groovyshClass.newInstance() if (groovyShell) { diff --git a/plugins/build.gradle b/plugins/build.gradle index ea8f6e96..a2bae1d7 100644 --- a/plugins/build.gradle +++ b/plugins/build.gradle @@ -1,3 +1,11 @@ +import io.nextflow.gradle.tasks.GithubRepositoryPublisher +import io.nextflow.gradle.tasks.GithubUploader +import org.apache.commons.codec.digest.DigestUtils +import org.codehaus.groovy.runtime.GStringImpl + +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter + /* * Copyright 2021-2022, Seqera Labs * @@ -24,19 +32,19 @@ ext.github_organization = project.findProperty('github_organization') ?: 'nextfl ext.github_username = project.findProperty('github_username') ?: 'pditommaso' ext.github_access_token = project.findProperty('github_access_token') ?: System.getenv('GITHUB_TOKEN') ext.github_commit_email = project.findProperty('github_commit_email') ?: 'paolo.ditommaso@gmail.com' -ext.github_index_url = "https://github.com/${github_organization}/plugins/main/plugins.json" +ext.github_index_url = "https://github.com/${github_organization}/plugins/main/plugins.json" as GStringImpl jar.enabled = false -String computeSha512(File file) { +static String computeSha512(File file) { if (!file.exists()) { throw new GradleException("Missing file: $file -- cannot compute SHA-512") } - return org.apache.commons.codec.digest.DigestUtils.sha512Hex(file.bytes) + return DigestUtils.sha512Hex(file.bytes) } -String now() { - "${java.time.OffsetDateTime.now().format(java.time.format.DateTimeFormatter.ISO_DATE_TIME)}" +static String now() { + "${OffsetDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME)}" } List allPlugins() { @@ -71,14 +79,14 @@ subprojects { version = metaFromManifest('Plugin-Version', file('src/resources/META-INF/MANIFEST.MF')) - tasks.withType(Jar) { + tasks.withType(Jar).configureEach { duplicatesStrategy = DuplicatesStrategy.INCLUDE } /* * Creates plugin zip and json meta file in plugin `build/libs` directory */ - task makeZip(type: Jar) { + tasks.register('makeZip', Jar) { into('classes') { with jar } into('lib') { from configurations.runtimeClasspath } manifest.from file('src/resources/META-INF/MANIFEST.MF') @@ -106,7 +114,7 @@ subprojects { /* * Copy the plugin dependencies in the subproject `build/target/libs` directory */ - task copyPluginLibs(type: Sync) { + tasks.register('copyPluginLibs', Sync) { from configurations.runtimeClasspath into 'build/target/libs' duplicatesStrategy 'exclude' @@ -115,7 +123,8 @@ subprojects { /* * Copy the plugin in the project root build/plugins directory */ - task copyPluginZip(type: Copy, dependsOn: project.tasks.findByName('makeZip')) { + tasks.register('copyPluginZip', Copy) { + dependsOn project.tasks.findByName('makeZip') from makeZip into "$rootProject.buildDir/plugins" outputs.file("$rootProject.buildDir/plugins/${project.name}-${project.version}.zip") @@ -132,10 +141,10 @@ subprojects { */ project.parent.tasks.getByName('assemble').dependsOn << copyPluginZip - task uploadPlugin(type: io.nextflow.gradle.tasks.GithubUploader, dependsOn: makeZip) { + task uploadPlugin(type: GithubUploader, dependsOn: makeZip) { assets = providers.provider { ["$buildDir/libs/${project.name }-${project.version }.zip", - "$buildDir/libs/${project.name}-${project.version}-meta.json" ]} - release = providers.provider { project.version } + "$buildDir/libs/${project.name}-${project.version}-meta.json" ]} as Provider> + release = providers.provider { project.version } as Provider repo = providers.provider { project.name } owner = github_organization userName = github_username @@ -144,14 +153,14 @@ subprojects { } } -task upload(dependsOn: [subprojects.uploadPlugin]) { } +tasks.register('upload') { dependsOn[subprojects.uploadPlugin] } classes.dependsOn subprojects.copyPluginLibs /* * Merge and publish the plugins index file */ -task publishIndex(type: io.nextflow.gradle.tasks.GithubRepositoryPublisher) { +tasks.register('publishIndex', GithubRepositoryPublisher) { indexUrl = github_index_url repos = allPlugins() owner = github_organization diff --git a/plugins/nf-quilt/build.gradle b/plugins/nf-quilt/build.gradle index 42b95f9c..b348d25d 100644 --- a/plugins/nf-quilt/build.gradle +++ b/plugins/nf-quilt/build.gradle @@ -16,34 +16,30 @@ plugins { // Apply the groovy plugin to add support for Groovy - id 'groovy' + id 'io.nextflow.groovy-library-conventions' id 'idea' - id 'se.patrikerdes.use-latest-versions' version '0.2.18' - id 'com.github.ben-manes.versions' version '0.51.0' + // id 'com.github.ben-manes.versions' version '0.51.0' id 'jacoco' } -useLatestVersions { - // A blacklist of dependencies to update, in the format of group:name - updateBlacklist = [ - 'com.quiltdata:quiltcore', - 'org.codehaus.groovy:groovy', - 'org.codehaus.groovy:groovy-nio', - 'org.codehaus.groovy:groovy-test', - 'org.spockframework:spock-core', - 'org.spockframework:spock-junit4', - ] -} - group = 'io.nextflow' // DO NOT SET THE VERSION HERE // THE VERSION FOR PLUGINS IS DEFINED IN THE `/resources/META-INF/MANIFEST.NF` file java { toolchain { - languageVersion = JavaLanguageVersion.of(17) + languageVersion = JavaLanguageVersion.of(javaLangVersion) } } +compileJava { + options.release = jdkVersion.toInteger() +} + +tasks.withType(GroovyCompile) { + sourceCompatibility = jdkVersion + targetCompatibility = jdkVersion +} + idea { module.inheritOutputDirs = true } @@ -69,37 +65,41 @@ sourceSets { test.resources.srcDirs = ['src/testResources'] } -ext { - nextflowVersion = rootProject.file('VERSION').text.trim() -} - dependencies { // quiltcore implementation 'com.quiltdata:quiltcore:0.1.6' // This dependency is exported to consumers, that is to say found on their compile classpath. compileOnly "io.nextflow:nextflow:$nextflowVersion" + // compileOnly "io.nextflow:nf-commons:$nextflowVersion" compileOnly 'org.slf4j:slf4j-api:2.1.0-alpha1' compileOnly 'org.pf4j:pf4j:3.13.0' // add here plugins depepencies - compileOnly 'org.slf4j:slf4j-simple:2.1.0-alpha1' - compileOnly 'black.ninia:jep:4.2.2' - runtime 'black.ninia:jep:4.2.2' + // compileOnly 'org.slf4j:slf4j-simple:2.1.0-alpha1' + // compileOnly 'black.ninia:jep:4.2.2' + // runtime 'black.ninia:jep:4.2.2' runtimeOnly 'org.junit.platform:junit-platform-launcher:1.11.3' implementation 'commons-io:commons-io:2.17.0' - implementation 'black.ninia:jep:4.2.2' - testImplementation 'black.ninia:jep:4.2.2' + // implementation 'black.ninia:jep:4.2.2' + // testImplementation 'black.ninia:jep:4.2.2' //testImplementation(testFixtures('black.ninia:jep:4.0.3')) // test configuration - testImplementation 'org.codehaus.groovy:groovy:3.0.23' - testImplementation 'org.codehaus.groovy:groovy-nio:3.0.23' testImplementation "io.nextflow:nextflow:$nextflowVersion" - testImplementation('org.codehaus.groovy:groovy-test:3.0.23') { exclude group: 'org.codehaus.groovy' } + // testImplementation "io.nextflow:nf-commons:$nextflowVersion" + testImplementation "org.codehaus.groovy:groovy:$groovyVersion" + testImplementation "org.codehaus.groovy:groovy-nio:$groovyVersion" + testImplementation ("org.codehaus.groovy:groovy-test:$groovyVersion") { exclude group: 'org.codehaus.groovy' } testImplementation('cglib:cglib-nodep:3.3.0') testImplementation('org.objenesis:objenesis:3.4') - testImplementation('org.spockframework:spock-core:2.3-groovy-3.0') { exclude group: 'org.codehaus.groovy'; exclude group: 'net.bytebuddy' } - testImplementation('org.spockframework:spock-junit4:2.3-groovy-3.0') { exclude group: 'org.codehaus.groovy'; exclude group: 'net.bytebuddy' } + testImplementation("org.spockframework:spock-core:2.3-groovy-3.0") { + exclude group: 'org.codehaus.groovy' + exclude group: 'net.bytebuddy' + } + testImplementation("org.spockframework:spock-junit4:2.3-groovy-3.0") { + exclude group: 'org.codehaus.groovy' + exclude group: 'net.bytebuddy' + } testImplementation('com.google.jimfs:jimfs:1.3.0') testImplementation(testFixtures("io.nextflow:nextflow:$nextflowVersion")) @@ -107,7 +107,9 @@ dependencies { // see https://docs.gradle.org/4.1/userguide/dependency_management.html#sec:module_replacement modules { - module('commons-logging:commons-logging') { replacedBy('org.slf4j:jcl-over-slf4j') } + module('commons-logging:commons-logging') { + replacedBy('org.slf4j:jcl-over-slf4j') + } } } diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/QuiltSpecification.groovy b/plugins/nf-quilt/src/test/nextflow/quilt/QuiltSpecification.groovy index 6d531d49..db65c58d 100644 --- a/plugins/nf-quilt/src/test/nextflow/quilt/QuiltSpecification.groovy +++ b/plugins/nf-quilt/src/test/nextflow/quilt/QuiltSpecification.groovy @@ -55,7 +55,7 @@ class QuiltSpecification extends Specification { @Shared String pluginsMode - @Shared Integer timestamp + @Shared Long timestamp @Shared String writeBucket