diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 98b45e82..6074178e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -60,7 +60,7 @@ jobs: with: name: nf-quilt-test-reports-${{ matrix.os }}-${{ matrix.java_version }} path: | - D:\a\nf-quilt\nf-quilt\plugins\nf-quilt\build\reports\ + D:\a\nf-quilt\nf-quilt\build\reports\ overwrite: true - name: Archive production artifacts (Linux and MacOS) uses: actions/upload-artifact@v4 @@ -68,5 +68,5 @@ jobs: with: name: nf-quilt-test-reports-${{ matrix.os }}-${{ matrix.java_version }} path: | - ${{ github.workspace }}/plugins/nf-quilt/build/reports/ + ${{ github.workspace }}/build/reports/ overwrite: true diff --git a/Makefile b/Makefile index ddfb9d50..297c54f5 100644 --- a/Makefile +++ b/Makefile @@ -2,152 +2,105 @@ sinclude .env # create from example.env PROJECT ?= nf-quilt WRITE_BUCKET ?= write-bucket-not-set FRAGMENT ?= &path=. -NF_DIR ?= ../nextflow -NF_GIT ?= $(NF_DIR)/nextflow -NF_BIN ?= ./launch.sh -PID ?= $$$$ 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 }') +VERSION ?= $(shell grep "^version" build.gradle | head -1 | awk -F"'" '{ print $$2 }') NXF_VER ?= $(shell cat VERSION) TEST_URI ?= quilt+s3://$(WRITE_BUCKET)$(QUERY)\#package=nf-quilt/dest-$(VERSION)$(FRAGMENT) PIPELINE ?= sarek -PIPE_OUT ?= quilt+s3://$(WRITE_BUCKET)\#package=$(PROJECT)/$(PIPELINE) -NXF_PLUGINS_TEST_REPOSITORY ?= https://github.com/quiltdata/nf-quilt/releases/download/$(VERSION)/nf-quilt-$(VERSION)-meta.json +PIPE_OUT ?= quilt+s3://$(WRITE_BUCKET)\#package=$(PROJECT)/$(PIPELINE) S3_BASE = s3://$(WRITE_BUCKET)/$(PROJECT) -REPORT ?= ./plugins/$(PROJECT)/build/reports/tests/test/index.html +REPORT ?= ./build/reports/tests/test/index.html -verify: #compile +.PHONY: all assemble clean test test-all check rebuild install package release verify fast \ + check-env pkg-test dyn-test s3-overlay s3-test s3-in s3-out \ + pkg-fail path-input deps refresh + +all: assemble + +assemble: + ./gradlew assemble + +clean: + rm -rf .nextflow* + rm -rf work results null + rm -rf build + ./gradlew clean + +test: + ./gradlew test + +check: + ./gradlew check --warning-mode all + +verify: echo $(WRITE_BUCKET) ./gradlew test ${ONE} || open $(REPORT) fast: ./gradlew test ${ONE} --fail-fast || open $(REPORT) # example: make fast ONE="--tests QuiltProductTest" + check-env: echo $(VERSION) echo $(WRITE_BUCKET) echo "$(TEST_URI)" - echo "Use 'make WRITE_BUCKET=' to override" + echo "Use 'make WRITE_BUCKET=' to override" printenv MAKEFLAGS -clean: - ./gradlew clean - rm -rf null results work - 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`" - -nextflow: - if [ ! -d "$(NF_DIR)" ]; then git clone https://github.com/nextflow-io/nextflow.git "$(NF_DIR)"; fi - cd "$(NF_DIR)"; git checkout && make compile && git restore .; cd .. - -compile-all: nextflow compile - -check: - ./gradlew check --warning-mode all - -.PHONY: clean test test-all all pkg-test tower-test - -test: clean compile check verifyCoverage - -test-nextflow: clean nextflow-git compile check - -test-all: clean compile-all check coverage +test-all: clean test -coverage: - ./gradlew jacocoTestReport - open plugins/nf-quilt/build/reports/jacoco/test/html/index.html +install: assemble + ./gradlew installPlugin -verifyCoverage: - ./gradlew jacocoTestCoverageVerification +package: + ./gradlew packagePlugin -groovysh: - ./gradlew -q --no-daemon --console=plain --init-script groovysh-task.gradle groovysh +release: + ./gradlew releasePlugin # -# Create packages +# Create packages (real-S3 integration tests). +# These run the plugin via `nextflow` directly. Requires `nextflow` on PATH. # -pkg-test: compile #-all +pkg-test: install echo "$(TEST_URI)" - $(NF_BIN) run ./main.nf -profile standard -plugins $(PROJECT) --outdir "$(TEST_URI)" + nextflow run ./main.nf -profile standard -plugins $(PROJECT)@$(VERSION) --outdir "$(TEST_URI)" -dyn-test: compile #-all - $(NF_BIN) run wf/main.dynamic.nf -profile standard -plugins $(PROJECT) +dyn-test: install + nextflow run wf/main.dynamic.nf -profile standard -plugins $(PROJECT)@$(VERSION) -s3-overlay: compile - $(NF_BIN) run ./main.nf --plugins $(PROJECT) --outdir "$(S3_BASE)/s3-overlay" --input "$(S3_BASE)/s3-in" +s3-overlay: install + nextflow run ./main.nf --plugins $(PROJECT)@$(VERSION) --outdir "$(S3_BASE)/s3-overlay" --input "$(S3_BASE)/s3-in" -s3-test: compile - $(NF_BIN) run ./main.nf --outdir "$(S3_BASE)/s3-test" --input "$(S3_BASE)/s3-in" +s3-test: install + nextflow run ./main.nf -profile standard -plugins $(PROJECT)@$(VERSION) --outdir "$(S3_BASE)/s3-test" --input "$(S3_BASE)/s3-in" -s3-in: compile - $(NF_BIN) run ./main.nf -profile standard -plugins $(PROJECT) --outdir "$(TEST_URI)" --input "$(S3_BASE)/s3-in" +s3-in: install + nextflow run ./main.nf -profile standard -plugins $(PROJECT)@$(VERSION) --outdir "$(TEST_URI)" --input "$(S3_BASE)/s3-in" -s3-out: compile - $(NF_BIN) run ./main.nf -profile standard -plugins $(PROJECT) --outdir "$(S3_BASE)/s3-out" +s3-out: install + nextflow run ./main.nf -profile standard -plugins $(PROJECT)@$(VERSION) --outdir "$(S3_BASE)/s3-out" -pkg-fail: compile +pkg-fail: install echo "$(TEST_URI)" - $(NF_BIN) run wf/fail.nf -profile standard -plugins $(PROJECT) --outdir "$(TEST_URI)" + nextflow run wf/fail.nf -profile standard -plugins $(PROJECT)@$(VERSION) --outdir "$(TEST_URI)" -path-input: compile +path-input: install mkdir -p work date > work/COPY_THIS.md echo "$(TEST_URI)" - $(NF_BIN) run wf/main.path.nf -profile standard -plugins $(PROJECT) --outdir "./results" - -tower-test: $(NF_BIN) - $(NF_BIN) run "https://github.com/quiltdata/nf-quilt" -name local_einstein -with-tower -r main -latest --pub "$(TEST_URI)" - -# -# Production Testing -# - -nf-git-ver: $(NF_GIT) - NXF_VER=$(NXF_VER) $(NF_GIT) -v - - -$(PIPELINE): nf-git-ver - NXF_PLUGINS_TEST_REPOSITORY=$(NXF_PLUGINS_TEST_REPOSITORY) NXF_VER=$(NXF_VER) $(NF_GIT) run nf-core/$(PIPELINE) -r master -profile test,docker -plugins $(PROJECT)@$(VERSION) --outdir "$(PIPE_OUT)" - -fetchngs: nf-git-ver - NXF_PLUGINS_TEST_REPOSITORY=$(NXF_PLUGINS_TEST_REPOSITORY) NXF_VER=$(NXF_VER) $(NF_GIT) run nf-core/fetchngs -r master -profile test,docker -plugins $(PROJECT)@$(VERSION) --input ../nf-quilt/wf/ids.csv --outdir s3://$(WRITE_BUCKET)/nf-quilt/fetchngs + nextflow run wf/main.path.nf -profile standard -plugins $(PROJECT)@$(VERSION) --outdir "./results" # # Show dependencies # deps: - ./gradlew -q ${mm}dependencies - -update: - ./gradlew useLatestVersions - make check + ./gradlew -q dependencies refresh: ./gradlew --refresh-dependencies dependencies - -install: compile - ./gradlew copyPluginZip - rm -rf ${HOME}/.nextflow/plugins/$(PROJECT)-${VERSION} - cp -r build/plugins/$(PROJECT)-${VERSION} ${HOME}/.nextflow/plugins/ - -# -# Upload JAR artifacts to Maven Central -# - -publish: - echo "Ensure you have set 'github_organization=' in ~/.gradle/gradle.properties" - ls $(HOME)/.gradle/gradle.properties # create locally or globally if it does not exist - ./gradlew :plugins:$(PROJECT):upload - ./gradlew :plugins:publishIndex diff --git a/build.gradle b/build.gradle index f826d9bb..7056e9aa 100644 --- a/build.gradle +++ b/build.gradle @@ -1,207 +1,69 @@ /* - * Copyright 2020-2022, Seqera Labs - * Copyright 2013-2019, Centre for Genomic Regulation (CRG) + * Copyright 2024-2026, Quilt Data Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. */ plugins { - id 'io.codearte.nexus-staging' version '0.30.0' - id 'java' - id 'idea' - id 'se.patrikerdes.use-latest-versions' version '0.2.18' - id 'com.github.ben-manes.versions' version '0.52.0' -} - -// Add ability to test with upcoming versions of Groovy -def groovyVer = System.getenv('CI_GROOVY_VERSION') -if (groovyVer) { - def repo = groovyVer.startsWith('com.github.apache:') ? 'https://jitpack.io' : 'https://oss.jfrog.org/oss-snapshot-local/' - logger.lifecycle "Overriden Groovy dependency to use $groovyVer - repository: $repo" - allprojects { - repositories { - maven { url repo } - } - - configurations.configureEach { - resolutionStrategy.eachDependency { DependencyResolveDetails details -> - force 'cglib:cglib-nodep:3.3.0' - force 'org.objenesis:objenesis:3.4' - - // (Optional) If transitive Groovy dependencies cause conflicts - force "org.${groovySource}.groovy:groovy-all:$groovyVer" - if ((details.requested.group == "org.${groovySource}.groovy") && details.requested.version != groovyVer) { - if (groovyVer.contains(':')) { - details.useTarget(groovyVer) - } - else { - details.useVersion(groovyVer) - } - println ">> Overriding $details.requested with version: $groovyVer" - } - } - } - } + id 'io.nextflow.nextflow-plugin' version '1.0.0-beta.14' } - +// Plugin version: bump here to release a new version. +// Keep in sync with any references in CHANGELOG / README until the 1.0.0 release. +version = '0.9.2' group = 'io.nextflow' -allprojects { - apply plugin: 'java' - apply plugin: 'java-test-fixtures' - apply plugin: 'idea' - apply plugin: 'groovy' - apply plugin: 'java-library' - - java { - toolchain { - languageVersion = JavaLanguageVersion.of(javaLangVersion) - } - } - - compileJava { - options.release = jdkVersion.toInteger() - } - - tasks.withType(GroovyCompile).configureEach { - sourceCompatibility = jdkVersion - targetCompatibility = jdkVersion - } - - idea { - module.inheritOutputDirs = true - } - repositories { - mavenCentral() - maven { url = 'https://repo.eclipse.org/content/groups/releases' } - maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' } - } - configurations { - // see https://docs.gradle.org/4.1/userguide/dependency_management.html#sub:exclude_transitive_dependencies - all*.exclude group: 'org.codehaus.groovy', module: 'groovy-all' - all*.exclude group: 'org.codehaus.groovy', module: 'groovy-cli-picocli' - all*.exclude group: 'org.apache.groovy', module: 'groovy-all' - all*.exclude group: 'org.apache.groovy', module: 'groovy-cli-picocli' - // groovydoc libs - groovyDoc.extendsFrom runtime - } - - dependencies { - // see https://docs.gradle.org/4.1/userguide/dependency_management.html#sec:module_replacement - implementation "org.${groovySource}.groovy:groovy-all:$groovyVersion" - implementation 'com.fasterxml.jackson.core:jackson-databind:2.19.0' - implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.19.0' - implementation 'com.upplication:s3fs:2.2.2' - - modules { - module('commons-logging:commons-logging') { replacedBy('org.slf4j:jcl-over-slf4j') } - } - // Documentation required libraries - groovyDoc 'org.fusesource.jansi:jansi:2.4.2' - groovyDoc "org.${groovySource}.groovy:groovy-groovydoc:$groovyVersion" - groovyDoc "org.${groovySource}.groovy:groovy-ant:$groovyVersion" - } - - test { - useJUnitPlatform() - } - - // this is required due to this IDEA bug - // https://youtrack.jetbrains.com/issue/IDEA-129282 - sourceSets { - main { - output.resourcesDir = 'build/classes/main' - } - } - - // 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).configureEach { - options.addStringOption('Xdoclint:none', '-quiet') - } - } - - 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).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).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', - ]) - } - } - } +dependencies { + implementation 'com.quiltdata:quiltcore:0.1.7' + implementation 'com.fasterxml.jackson.core:jackson-databind:2.19.0' + implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.19.0' + implementation 'commons-io:commons-io:2.19.0' } -def getRuntimeConfigs() { - def names = subprojects - .findAll { prj -> prj.name in ['nextflow', 'nf-commons', 'nf-httpfs'] } - .collect { p -> p.name } - - FileCollection result = null - for ( def it : names ) { - def cfg = project(it).configurations.getByName('runtimeClasspath') - if ( result == null ) { - result = cfg - } - else { - result += cfg - } - // this include the module actual jar file - // note: migrating to gradle 7 does not work any more - //result = result + cfg.getOutgoing().getArtifacts().getFiles() - } - return result +// The io.nextflow.nextflow-plugin gradle plugin wires `test` to depend on +// `assemble` (which transitively runs `packagePlugin`). On Windows, +// `packagePlugin` fails with "character to be escaped is missing" because +// the upstream task uses `String.replaceAll(..., File.separator)` and `\` +// is an escape character in regex replacements +// (see https://github.com/nextflow-io/nextflow-plugin-gradle/issues/20). +// Until that upstream bug is fixed, we sever the test->assemble link so the +// test suite can run on Windows. `make assemble` / `make package` / +// `make release` still trigger packagePlugin on platforms where it works. +tasks.named('test') { task -> + task.setDependsOn(task.getDependsOn().findAll { it != tasks.assemble && it != 'assemble' }) + task.dependsOn 'jar' + useJUnitPlatform() + // Required to run Nextflow / Groovy reflection-heavy tests on JDK 9+. + 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', + ]) } -/* - * Save the runtime classpath - */ -task exportClasspath { - dependsOn allprojects.jar - doLast { - def nextflowVersion = rootProject.file('VERSION').text.trim() - - def all = getRuntimeConfigs() - 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(':') - } +nextflowPlugin { + nextflowVersion = '24.10.0' + provider = 'Quilt Data' + className = 'nextflow.quilt.QuiltPlugin' + extensionPoints = [ + 'nextflow.quilt.QuiltObserverFactory', + 'nextflow.quilt.nio.QuiltPathFactory', + 'nextflow.quilt.nio.QuiltPathSerializer' + ] } diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle deleted file mode 100644 index 66a0569c..00000000 --- a/buildSrc/build.gradle +++ /dev/null @@ -1,14 +0,0 @@ -/* - * 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 deleted file mode 100644 index ecc029b2..00000000 --- a/buildSrc/src/main/groovy/io.nextflow.groovy-application-conventions.gradle +++ /dev/null @@ -1,11 +0,0 @@ -/* - * 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 deleted file mode 100644 index bac925f4..00000000 --- a/buildSrc/src/main/groovy/io.nextflow.groovy-common-conventions.gradle +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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 = 21 -} - -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 deleted file mode 100644 index 0183e2cc..00000000 --- a/buildSrc/src/main/groovy/io.nextflow.groovy-library-conventions.gradle +++ /dev/null @@ -1,11 +0,0 @@ -/* - * 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-groovysh-init.gradle b/gradle-groovysh-init.gradle deleted file mode 100644 index fa47c759..00000000 --- a/gradle-groovysh-init.gradle +++ /dev/null @@ -1,49 +0,0 @@ -gradle.projectsLoaded { - rootProject { - afterEvaluate { project -> - if (!project.repositories.any { it.name == 'MavenRepo' }) { - project.repositories { - // To be able to load org.codehaus.groovy:groovy-groovysh - mavenCentral() - } - } - - project.configurations { - groovyshdependencies - } - - project.dependencies { - groovyshdependencies("org.${groovySource}.groovy:groovy-groovysh:${GroovySystem.version}") { - exclude group: "org.${groovySource}.groovy" - } - } - - project.tasks.register('groovysh') { - group 'debug' - description 'Runs an interactive shell in the context of the project.' - doLast { - URLClassLoader groovyObjectClassLoader = GroovyObject.classLoader - def groovyshClass - def groovyShell - - // Add dependency jars to classloader - configurations.groovyshdependencies.each { File file -> - groovyObjectClassLoader.addURL(file.toURL()) - } - Class.forName('jline.console.history.FileHistory', true, groovyObjectClassLoader) - groovyshClass = Class.forName("org.${groovySource}.groovy.tools.shell.Groovysh", true, groovyObjectClassLoader) - - if (groovyshClass) { - groovyShell = groovyshClass.newInstance() - } - if (groovyShell) { - groovyShell.interp.context.variables.put('gradle', gradle) - groovyShell.interp.context.variables.put('settings', gradle.settings) - groovyShell.interp.context.variables.put('project', project) - groovyShell.run('') - } - } - } - } -} -} diff --git a/gradle.properties b/gradle.properties index 3550e31c..6830d6ee 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,3 @@ -groovyVersion = 4.0.26 -groovyV = groovy-4.0 -groovySource = apache -jdkVersion = 11 -javaLangVersion = 21 +# Gradle configuration for nf-quilt. +# The Nextflow Gradle plugin (io.nextflow.nextflow-plugin) controls +# the JVM toolchain and Groovy/Java versions; no overrides required here. diff --git a/groovysh-task.gradle b/groovysh-task.gradle deleted file mode 100644 index 64873f26..00000000 --- a/groovysh-task.gradle +++ /dev/null @@ -1,54 +0,0 @@ -gradle.projectsLoaded { - rootProject { - afterEvaluate { project -> - if (!project.repositories.any { it.name == 'MavenRepo' }) { - project.repositories { - // To be able to load org.codehaus.groovy:groovy-groovysh and dependencies - mavenCentral { - content { - includeGroup "org.${groovySource}.groovy" - includeGroup 'jline' - includeGroup 'com.github.javaparser' - includeGroup 'org.ow2.asm' - includeGroup 'org.abego.treelayout' - includeGroup 'org.apache.ivy' - } - } - } - } - project.configurations { - groovyshdependencies - } - - project.dependencies { - groovyshdependencies "org.${groovySource}.groovy:groovy-groovysh:$groovyVer" { - exclude group: "org.${groovySource}.groovy" - } - } - - project.tasks.register('groovysh') { - group 'debug' - description 'Runs an interactive shell in the context of the project. Use :inspect command to inspect project, gradle, settings or other objects.' - doLast { - URLClassLoader groovyshClassLoader = new URLClassLoader() - configurations.groovyshdependencies.each { File file -> - groovyshClassLoader.addURL(file.toURI().toURL()) - } - - def groovyshClass - def groovyShell - groovyshClass = Class.forName("org.${groovySource}.groovy.groovysh.Groovysh", true, groovyshClassLoader) - if (groovyshClass) { - groovyShell = groovyshClass.newInstance() - if (groovyShell) { - groovyShell.interp.context.variables.put('gradle', gradle) - groovyShell.interp.context.variables.put('settings', gradle.settings) - groovyShell.interp.context.variables.put('project', project) - groovyShell.run('# Available objects: gradle, settings, project\n# Try :inspect project') - } - } - } - } - } -} -} diff --git a/launch.sh b/launch.sh deleted file mode 100755 index ebee5335..00000000 --- a/launch.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -export NXF_PLUGINS_DEV=$PWD/plugins -../nextflow/launch.sh "$@" diff --git a/plugins/build.gradle b/plugins/build.gradle deleted file mode 100644 index 84d7077d..00000000 --- a/plugins/build.gradle +++ /dev/null @@ -1,182 +0,0 @@ -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 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS - * of any kind, either express or implied. - * See the License for specific language governing permissions and limitations. - */ - -plugins { - id 'java' - id 'groovy' - id 'io.nextflow.nf-build-plugin' version '1.0.1' -} - -/* Project Constants */ -ext { - github_organization = project.findProperty('github_organization') ?: 'nextflow-io' - github_username = project.findProperty('github_username') ?: 'pditommaso' - github_access_token = project.findProperty('github_access_token') ?: System.getenv('GITHUB_TOKEN') - github_commit_email = project.findProperty('github_commit_email') ?: 'paolo.ditommaso@gmail.com' - github_index_url = "https://github.com/${github_organization}/plugins/main/plugins.json" as GStringImpl -} - -// Disable default JAR generation -jar.enabled = false - -/* Utility Functions */ -static String computeSha512(File file) { - if (!file.exists()) { - throw new GradleException("Missing file: $file -- cannot compute SHA-512") - } - return DigestUtils.sha512Hex(file.bytes) -} - -static String now() { - "${OffsetDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME)}" -} - -List allPlugins() { - def plugins = [] - new File(rootProject.rootDir, 'plugins').eachDir { - if (it.name.startsWith('nf-')) plugins.add(it.name) - } - return plugins -} - -String metaFromManifest(String meta, File file) { - def str = file.text - def regex = ~/(?m)^$meta:\s*([\w-\.<>=]+)$/ - def m = regex.matcher(str) - if (m.find()) { - def ver = m.group(1) - println "Set plugin '${file.parentFile.parentFile.parentFile.parentFile.name}' version=$ver" - return ver - } - throw new GradleException("Cannot find '$meta' for plugin: $file") -} - -def timestamp = now() - -/* Configure Subprojects */ -subprojects { - apply plugin: 'java' - apply plugin: 'groovy' - apply plugin: 'io.nextflow.nf-build-plugin' - - repositories { - mavenLocal() - mavenCentral() - } - - version = metaFromManifest('Plugin-Version', file('src/resources/META-INF/MANIFEST.MF')) - - tasks.withType(Jar).configureEach { - duplicatesStrategy = DuplicatesStrategy.INCLUDE - } - - /* Plugin Variables */ - String pluginVersion = project.version - String archiveName = "${project.name}-${pluginVersion}" - File zipFile = layout.buildDirectory.file("libs/${archiveName}.zip").get().asFile - File jsonFile = layout.buildDirectory.file("libs/${archiveName}-meta.json").get().asFile - File pluginsDir = layout.buildDirectory.dir("plugins").get().asFile - - /* Task to Create Plugin Zip and Metadata */ - tasks.register('makeZip', Jar) { - into('classes') { with jar } - into('lib') { from configurations.runtimeClasspath } - manifest.from file('src/resources/META-INF/MANIFEST.MF') - archiveExtension = 'zip' - preserveFileTimestamps = false - reproducibleFileOrder = true - - String downloadUrl = "https://github.com/${github_organization}/${project.name}/releases/download/${pluginVersion}/${archiveName}.zip" - doLast { - // Generate the metadata file - jsonFile.text = """\ -{ - "version": "${pluginVersion}", - "date": "${timestamp}", - "url": "${downloadUrl}", - "requires": "${metaFromManifest('Plugin-Requires', file('src/resources/META-INF/MANIFEST.MF'))}", - "sha512sum": "${computeSha512(zipFile)}" -} -""" - } - outputs.file(zipFile) - } - - /* Task to Copy Plugin Dependencies */ - tasks.register('copyPluginLibs', Sync) { - from configurations.runtimeClasspath - into 'build/target/libs' - duplicatesStrategy = DuplicatesStrategy.EXCLUDE - } - - /* Task to Copy Plugin ZIP to Plugins Directory */ - tasks.register('copyPluginZip', Copy) { - dependsOn project.tasks.named('makeZip') - from { tasks.named('makeZip').get().outputs.files.singleFile } - into pluginsDir.absolutePath - outputs.file(zipFile) - - def destDirPath = new File(pluginsDir, archiveName).absolutePath - doLast { - if (!zipFile.exists()) { - throw new GradleException("File ${zipFile} does not exist! Cannot unzip.") - } - ant.unzip( - src: zipFile.absolutePath, - dest: destDirPath - ) - } - } - - /* "Install" the Plugin */ - def providerList = [zipFile.absolutePath, jsonFile.absolutePath] - project.parent.tasks.named('assemble').configure { - dependsOn(copyPluginZip) - } - tasks.register('uploadPlugin', GithubUploader) { - dependsOn tasks.named('makeZip') // Lazy dependency - repo = providers.provider { project.name } - owner = github_organization - userName = github_username - authToken = github_access_token - skipExisting = true - release = providers.provider { project.version } as Provider - assets = providers.provider { providerList } as Provider> - } -} - -/* Upload Task */ -tasks.register('upload') { - dependsOn subprojects.uploadPlugin -} - -classes.dependsOn subprojects.copyPluginLibs - -/* Publish Plugins Index File */ -tasks.register('publishIndex', GithubRepositoryPublisher) { - indexUrl = github_index_url - repos = allPlugins() - owner = github_organization - githubUser = github_username - githubEmail = github_commit_email - githubToken = github_access_token -} diff --git a/plugins/nf-quilt/build.gradle b/plugins/nf-quilt/build.gradle deleted file mode 100644 index a350d91f..00000000 --- a/plugins/nf-quilt/build.gradle +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright 2021-2022, Seqera Labs - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS - * of any kind, either express or implied. - * See the License for the specific language governing permissions and limitations. - */ - -plugins { - // Apply the conventions and plugins required by the build - id 'io.nextflow.groovy-library-conventions' - id 'idea' - id 'jacoco' -} - -group = 'io.nextflow' - -// DO NOT SET THE VERSION HERE -// PLUGIN VERSION IS DEFINED IN THE `META-INF/MANIFEST.MF` FILE - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(javaLangVersion) - } -} - -compileJava { - options.release = jdkVersion.toInteger() -} - -tasks.withType(GroovyCompile).configureEach { - sourceCompatibility = jdkVersion - targetCompatibility = jdkVersion -} - -idea { - module.inheritOutputDirs = true -} - -repositories { - mavenCentral() - maven { url = 'https://jitpack.io' } - maven { url = 'https://s3-eu-west-1.amazonaws.com/maven.seqera.io/releases' } - maven { url = 'https://s3-eu-west-1.amazonaws.com/maven.seqera.io/snapshots' } -} - -configurations { - // Exclude transitive dependencies - runtimeClasspath.exclude(group: 'org.slf4j', module: 'slf4j-api') -} - -sourceSets { - main { - java.srcDirs = [] // Disable Java sources - groovy.srcDirs = ['src/main'] // Use Groovy sources - resources.srcDirs = ['src/resources'] // Use resources - } - test { - java.srcDirs = [] // Disable Java sources for tests - groovy.srcDirs = ['src/test'] // Use Groovy test sources - resources.srcDirs = ['src/testResources'] // Use test resources - } -} - -dependencies { - def nextflowVersion = rootProject.file('VERSION').text.trim() - - // Quiltcore - implementation 'com.quiltdata:quiltcore:0.1.7' - - // Compile-only dependencies - compileOnly "io.nextflow:nextflow:$nextflowVersion" - compileOnly 'org.slf4j:slf4j-api:2.1.0-alpha1' - compileOnly 'org.pf4j:pf4j:3.13.0' - - // Runtime-only dependencies - runtimeOnly 'org.junit.platform:junit-platform-launcher:1.12.2' - implementation 'commons-io:commons-io:2.19.0' - - // Test dependencies - testImplementation "io.nextflow:nextflow:$nextflowVersion" - testImplementation "org.${groovySource}.groovy:groovy:$groovyVersion" - testImplementation "org.${groovySource}.groovy:groovy-nio:$groovyVersion" - testImplementation("org.${groovySource}.groovy:groovy-test:$groovyVersion") { - exclude group: "org.${groovySource}.groovy" - } - testImplementation('cglib:cglib-nodep:3.3.0') - testImplementation('org.objenesis:objenesis:3.4') - - // Spock framework - testImplementation("org.spockframework:spock-core:2.3-$groovyV") { - exclude group: "org.${groovySource}.groovy" - exclude group: 'net.bytebuddy' - } - testImplementation("org.spockframework:spock-junit4:2.3-$groovyV") { - exclude group: "org.${groovySource}.groovy" - exclude group: 'net.bytebuddy' - } - - // Miscellaneous test dependencies - testImplementation('com.google.jimfs:jimfs:1.3.0') - testImplementation(testFixtures("io.nextflow:nextflow:$nextflowVersion")) - testImplementation(testFixtures("io.nextflow:nf-commons:$nextflowVersion")) - - // Module replacement - modules { - module('commons-logging:commons-logging') { - replacedBy('org.slf4j:jcl-over-slf4j') - } - } -} - -// Use JUnit 5 platform for testing -test { - useJUnitPlatform() -} - -jacocoTestReport { - dependsOn test // The report depends on the completion of tests -} - -jacocoTestCoverageVerification { - dependsOn jacocoTestReport // Ensure the test report is generated first - violationRules { - rule { - limit { - minimum = 0.7 // Ensure at least 70% coverage - } - } - - rule { - enabled = false - element = 'CLASS' - includes = ['org.gradle.*'] - - limit { - counter = 'LINE' - value = 'TOTALCOUNT' - maximum = 0.3 // Coverage limit for lines - } - } - } -} diff --git a/plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF b/plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF deleted file mode 100644 index b5f05245..00000000 --- a/plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF +++ /dev/null @@ -1,7 +0,0 @@ -Manifest-Version: 1.0 -Plugin-Class: nextflow.quilt.QuiltPlugin -Plugin-Id: nf-quilt -Plugin-Version: 0.9.2 -Plugin-Provider: Quilt Data -Plugin-Requires: >=24.10.0 - diff --git a/plugins/nf-quilt/src/resources/META-INF/extensions.idx b/plugins/nf-quilt/src/resources/META-INF/extensions.idx deleted file mode 100644 index 890194be..00000000 --- a/plugins/nf-quilt/src/resources/META-INF/extensions.idx +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright 2020-2022, Seqera Labs -# Copyright 2013-2019, Centre for Genomic Regulation (CRG) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -nextflow.quilt.nio.QuiltPathSerializer -nextflow.quilt.nio.QuiltPathFactory -nextflow.quilt.QuiltObserverFactory \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 859f3248..e9cf8e52 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,23 +1 @@ -/* - * Copyright 2022, Seqera Labs - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -plugins { - id('org.gradle.toolchains.foojay-resolver-convention') version '0.10.0' -} - rootProject.name = 'nf-quilt' -include 'plugins' -include('plugins:nf-quilt') diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltObserver.groovy b/src/main/groovy/nextflow/quilt/QuiltObserver.groovy similarity index 100% rename from plugins/nf-quilt/src/main/nextflow/quilt/QuiltObserver.groovy rename to src/main/groovy/nextflow/quilt/QuiltObserver.groovy diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltObserverFactory.groovy b/src/main/groovy/nextflow/quilt/QuiltObserverFactory.groovy similarity index 100% rename from plugins/nf-quilt/src/main/nextflow/quilt/QuiltObserverFactory.groovy rename to src/main/groovy/nextflow/quilt/QuiltObserverFactory.groovy diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltPathify.groovy b/src/main/groovy/nextflow/quilt/QuiltPathify.groovy similarity index 100% rename from plugins/nf-quilt/src/main/nextflow/quilt/QuiltPathify.groovy rename to src/main/groovy/nextflow/quilt/QuiltPathify.groovy diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltPlugin.groovy b/src/main/groovy/nextflow/quilt/QuiltPlugin.groovy similarity index 100% rename from plugins/nf-quilt/src/main/nextflow/quilt/QuiltPlugin.groovy rename to src/main/groovy/nextflow/quilt/QuiltPlugin.groovy diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy b/src/main/groovy/nextflow/quilt/QuiltProduct.groovy similarity index 100% rename from plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy rename to src/main/groovy/nextflow/quilt/QuiltProduct.groovy diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltID.groovy b/src/main/groovy/nextflow/quilt/jep/QuiltID.groovy similarity index 100% rename from plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltID.groovy rename to src/main/groovy/nextflow/quilt/jep/QuiltID.groovy diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy b/src/main/groovy/nextflow/quilt/jep/QuiltPackage.groovy similarity index 100% rename from plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy rename to src/main/groovy/nextflow/quilt/jep/QuiltPackage.groovy diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltParser.groovy b/src/main/groovy/nextflow/quilt/jep/QuiltParser.groovy similarity index 100% rename from plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltParser.groovy rename to src/main/groovy/nextflow/quilt/jep/QuiltParser.groovy diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltBashLib.groovy b/src/main/groovy/nextflow/quilt/nio/QuiltBashLib.groovy similarity index 100% rename from plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltBashLib.groovy rename to src/main/groovy/nextflow/quilt/nio/QuiltBashLib.groovy diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileAttributes.groovy b/src/main/groovy/nextflow/quilt/nio/QuiltFileAttributes.groovy similarity index 100% rename from plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileAttributes.groovy rename to src/main/groovy/nextflow/quilt/nio/QuiltFileAttributes.groovy diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileAttributesView.groovy b/src/main/groovy/nextflow/quilt/nio/QuiltFileAttributesView.groovy similarity index 100% rename from plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileAttributesView.groovy rename to src/main/groovy/nextflow/quilt/nio/QuiltFileAttributesView.groovy diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileCopyStrategy.groovy b/src/main/groovy/nextflow/quilt/nio/QuiltFileCopyStrategy.groovy similarity index 100% rename from plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileCopyStrategy.groovy rename to src/main/groovy/nextflow/quilt/nio/QuiltFileCopyStrategy.groovy diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileSystem.groovy b/src/main/groovy/nextflow/quilt/nio/QuiltFileSystem.groovy similarity index 100% rename from plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileSystem.groovy rename to src/main/groovy/nextflow/quilt/nio/QuiltFileSystem.groovy diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileSystemProvider.groovy b/src/main/groovy/nextflow/quilt/nio/QuiltFileSystemProvider.groovy similarity index 100% rename from plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileSystemProvider.groovy rename to src/main/groovy/nextflow/quilt/nio/QuiltFileSystemProvider.groovy diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltPath.groovy b/src/main/groovy/nextflow/quilt/nio/QuiltPath.groovy similarity index 100% rename from plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltPath.groovy rename to src/main/groovy/nextflow/quilt/nio/QuiltPath.groovy diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltPathFactory.groovy b/src/main/groovy/nextflow/quilt/nio/QuiltPathFactory.groovy similarity index 100% rename from plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltPathFactory.groovy rename to src/main/groovy/nextflow/quilt/nio/QuiltPathFactory.groovy diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltPathIterator.groovy b/src/main/groovy/nextflow/quilt/nio/QuiltPathIterator.groovy similarity index 100% rename from plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltPathIterator.groovy rename to src/main/groovy/nextflow/quilt/nio/QuiltPathIterator.groovy diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltPathSerializer.groovy b/src/main/groovy/nextflow/quilt/nio/QuiltPathSerializer.groovy similarity index 100% rename from plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltPathSerializer.groovy rename to src/main/groovy/nextflow/quilt/nio/QuiltPathSerializer.groovy diff --git a/plugins/nf-quilt/src/resources/logback-test.xml b/src/main/resources/logback-test.xml similarity index 100% rename from plugins/nf-quilt/src/resources/logback-test.xml rename to src/main/resources/logback-test.xml diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/QuiltObserverTest.groovy b/src/test/groovy/nextflow/quilt/QuiltObserverTest.groovy similarity index 100% rename from plugins/nf-quilt/src/test/nextflow/quilt/QuiltObserverTest.groovy rename to src/test/groovy/nextflow/quilt/QuiltObserverTest.groovy diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/QuiltPathifyTest.groovy b/src/test/groovy/nextflow/quilt/QuiltPathifyTest.groovy similarity index 100% rename from plugins/nf-quilt/src/test/nextflow/quilt/QuiltPathifyTest.groovy rename to src/test/groovy/nextflow/quilt/QuiltPathifyTest.groovy diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/QuiltPkgTest.groovy b/src/test/groovy/nextflow/quilt/QuiltPkgTest.groovy similarity index 74% rename from plugins/nf-quilt/src/test/nextflow/quilt/QuiltPkgTest.groovy rename to src/test/groovy/nextflow/quilt/QuiltPkgTest.groovy index 778f5415..bba06d3c 100644 --- a/plugins/nf-quilt/src/test/nextflow/quilt/QuiltPkgTest.groovy +++ b/src/test/groovy/nextflow/quilt/QuiltPkgTest.groovy @@ -49,12 +49,25 @@ class QuiltPkgTest extends QuiltSpecification { } static String manifestVersion() { - String subPath = 'src/resources/META-INF/MANIFEST.MF' - File manifestFile = new File(subPath) - def manifest = new Manifest(new FileInputStream(manifestFile)) - def attrs = manifest.getMainAttributes() - String version = attrs.getValue('Plugin-Version') - return version + // Under the new Nextflow Gradle plugin the MANIFEST.MF is generated + // into build/tmp/jar/MANIFEST.MF by the `jar` task. Fall back to the + // legacy source path for transitional builds. + for (String subPath : [ + 'build/tmp/jar/MANIFEST.MF', + 'src/resources/META-INF/MANIFEST.MF', + 'src/main/resources/META-INF/MANIFEST.MF', + ]) { + File manifestFile = new File(subPath) + if (manifestFile.exists()) { + String version = manifestFile.withInputStream { stream -> + new Manifest(stream).getMainAttributes().getValue('Plugin-Version') + } + if (version) { + return version + } + } + } + throw new FileNotFoundException('Could not locate plugin MANIFEST.MF') } static String destPackage() { diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/QuiltProductTest.groovy b/src/test/groovy/nextflow/quilt/QuiltProductTest.groovy similarity index 100% rename from plugins/nf-quilt/src/test/nextflow/quilt/QuiltProductTest.groovy rename to src/test/groovy/nextflow/quilt/QuiltProductTest.groovy diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/QuiltSpecification.groovy b/src/test/groovy/nextflow/quilt/QuiltSpecification.groovy similarity index 86% rename from plugins/nf-quilt/src/test/nextflow/quilt/QuiltSpecification.groovy rename to src/test/groovy/nextflow/quilt/QuiltSpecification.groovy index 8b648e54..124f4588 100644 --- a/plugins/nf-quilt/src/test/nextflow/quilt/QuiltSpecification.groovy +++ b/src/test/groovy/nextflow/quilt/QuiltSpecification.groovy @@ -85,12 +85,22 @@ class QuiltSpecification extends Specification { if (!Files.isDirectory(pluginPath)) { return null } - final manifestPath = pluginPath.resolve('src/resources/META-INF/MANIFEST.MF') - if (!Files.exists(manifestPath)) { - return null + // Under the new Nextflow Gradle plugin (io.nextflow.nextflow-plugin) + // the MANIFEST.MF is generated into build/tmp/jar/ during the `jar` + // task. The legacy path src/resources/META-INF/MANIFEST.MF is + // retained as a fallback for transitional builds. + final candidates = [ + pluginPath.resolve('build/tmp/jar/MANIFEST.MF'), + pluginPath.resolve('src/resources/META-INF/MANIFEST.MF'), + pluginPath.resolve('src/main/resources/META-INF/MANIFEST.MF'), + ] + for (Path manifestPath : candidates) { + if (Files.exists(manifestPath)) { + final input = Files.newInputStream(manifestPath) + return new Manifest(input) + } } - final input = Files.newInputStream(manifestPath) - return new Manifest(input) + return null } } diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/jep/QuiltIDTest.groovy b/src/test/groovy/nextflow/quilt/jep/QuiltIDTest.groovy similarity index 100% rename from plugins/nf-quilt/src/test/nextflow/quilt/jep/QuiltIDTest.groovy rename to src/test/groovy/nextflow/quilt/jep/QuiltIDTest.groovy diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/jep/QuiltPackageTest.groovy b/src/test/groovy/nextflow/quilt/jep/QuiltPackageTest.groovy similarity index 100% rename from plugins/nf-quilt/src/test/nextflow/quilt/jep/QuiltPackageTest.groovy rename to src/test/groovy/nextflow/quilt/jep/QuiltPackageTest.groovy diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/jep/QuiltParserTest.groovy b/src/test/groovy/nextflow/quilt/jep/QuiltParserTest.groovy similarity index 100% rename from plugins/nf-quilt/src/test/nextflow/quilt/jep/QuiltParserTest.groovy rename to src/test/groovy/nextflow/quilt/jep/QuiltParserTest.groovy diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltFileSystemProviderTest.groovy b/src/test/groovy/nextflow/quilt/nio/QuiltFileSystemProviderTest.groovy similarity index 100% rename from plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltFileSystemProviderTest.groovy rename to src/test/groovy/nextflow/quilt/nio/QuiltFileSystemProviderTest.groovy diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltFileSystemTest.groovy b/src/test/groovy/nextflow/quilt/nio/QuiltFileSystemTest.groovy similarity index 100% rename from plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltFileSystemTest.groovy rename to src/test/groovy/nextflow/quilt/nio/QuiltFileSystemTest.groovy diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltNioTest.groovy b/src/test/groovy/nextflow/quilt/nio/QuiltNioTest.groovy similarity index 100% rename from plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltNioTest.groovy rename to src/test/groovy/nextflow/quilt/nio/QuiltNioTest.groovy diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltPathFactoryTest.groovy b/src/test/groovy/nextflow/quilt/nio/QuiltPathFactoryTest.groovy similarity index 100% rename from plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltPathFactoryTest.groovy rename to src/test/groovy/nextflow/quilt/nio/QuiltPathFactoryTest.groovy diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltPathSerializerTest.groovy b/src/test/groovy/nextflow/quilt/nio/QuiltPathSerializerTest.groovy similarity index 100% rename from plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltPathSerializerTest.groovy rename to src/test/groovy/nextflow/quilt/nio/QuiltPathSerializerTest.groovy diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltPathTest.groovy b/src/test/groovy/nextflow/quilt/nio/QuiltPathTest.groovy similarity index 100% rename from plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltPathTest.groovy rename to src/test/groovy/nextflow/quilt/nio/QuiltPathTest.groovy