diff --git a/CLAUDE.md b/CLAUDE.md index 785ac91429..fd0df4b018 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -38,7 +38,10 @@ The project follows a modular architecture with a plugin-based system for cloud ### Core Modules (`modules/`) - **nextflow**: Main application module with core workflow engine, CLI, AST transformations, executors -- **nf-commons**: Shared utilities, plugin system infrastructure, extension methods +- **nf-commons**: Shared utilities, plugin system infrastructure, extension methods, common exceptions +- **nf-config**: Configuration parsing and management (ConfigBuilder, ConfigParser, Manifest, WorkflowConfig) +- **nf-scm**: Source code management (AssetManager, repository providers for GitHub/GitLab/Bitbucket/Azure/Gitea) +- **nf-secrets**: Secrets management (SecretsProvider, SecretsLoader, integration with external secret stores) - **nf-httpfs**: HTTP filesystem support and custom providers - **nf-lang**: Language parsing, ANTLR grammars, AST implementation - **nf-lineage**: Data lineage tracking and workflow execution history diff --git a/build.gradle b/build.gradle index dfd7cc13be..c40d3a1e25 100644 --- a/build.gradle +++ b/build.gradle @@ -325,7 +325,7 @@ task compile { def getRuntimeConfigs() { def names = subprojects - .findAll { prj -> prj.name in ['nextflow','nf-commons','nf-httpfs','nf-lang','nf-lineage'] } + .findAll { prj -> prj.name in ['nextflow','nf-commons','nf-scm','nf-config','nf-secrets','nf-httpfs','nf-lang','nf-lineage'] } .collect { it.name } FileCollection result = null @@ -356,14 +356,14 @@ task exportClasspath { def libs = [] // Resolve configurations during provider evaluation (not ideal but functional) - ['nextflow','nf-commons','nf-httpfs','nf-lang','nf-lineage'].each { moduleName -> + ['nextflow','nf-commons','nf-scm','nf-config','nf-secrets','nf-httpfs','nf-lang','nf-lineage'].each { moduleName -> def moduleProject = project(":$moduleName") def cfg = moduleProject.configurations.getByName('runtimeClasspath') libs.addAll(cfg.files.collect { it.canonicalPath }) } // Add module jars - ['nextflow','nf-commons','nf-httpfs','nf-lang','nf-lineage'].each { + ['nextflow','nf-commons','nf-scm','nf-config','nf-secrets','nf-httpfs','nf-lang','nf-lineage'].each { libs << file("modules/$it/build/libs/${it}-${version}.jar").canonicalPath } @@ -387,7 +387,7 @@ ext.nexusEmail = project.findProperty('nexusEmail') // `signing.keyId` property needs to be defined in the `gradle.properties` file ext.enableSignArchives = project.findProperty('signing.keyId') -ext.coreProjects = projects( ':nextflow', ':nf-commons', ':nf-httpfs', ':nf-lang', ':nf-lineage' ) +ext.coreProjects = projects( ':nextflow', ':nf-commons', ':nf-scm', ':nf-config', ':nf-secrets', ':nf-httpfs', ':nf-lang', ':nf-lineage' ) configure(coreProjects) { group = 'io.nextflow' diff --git a/modules/nextflow/build.gradle b/modules/nextflow/build.gradle index a71409a676..e9b8230802 100644 --- a/modules/nextflow/build.gradle +++ b/modules/nextflow/build.gradle @@ -24,6 +24,9 @@ configurations { dependencies { api(project(':nf-commons')) api(project(':nf-httpfs')) + api(project(':nf-scm')) + api(project(':nf-secrets')) + api(project(':nf-config')) api(project(':nf-lang')) api "org.apache.groovy:groovy:4.0.29" api "org.apache.groovy:groovy-nio:4.0.29" @@ -44,7 +47,6 @@ dependencies { api "com.beust:jcommander:1.35" api("com.esotericsoftware.kryo:kryo:2.24.0") { exclude group: 'com.esotericsoftware.minlog', module: 'minlog' } api('org.iq80.leveldb:leveldb:0.12') - api('org.eclipse.jgit:org.eclipse.jgit:7.1.1.202505221757-r') api ('javax.activation:activation:1.1.1') api ('javax.mail:mail:1.4.7') api ('org.yaml:snakeyaml:2.2') diff --git a/modules/nextflow/src/main/groovy/nextflow/NF.groovy b/modules/nextflow/src/main/groovy/nextflow/NF.groovy index 4681be037c..d240a83df1 100644 --- a/modules/nextflow/src/main/groovy/nextflow/NF.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/NF.groovy @@ -33,11 +33,11 @@ class NF { } static String getSyntaxParserVersion() { - return SysEnv.get('NXF_SYNTAX_PARSER', 'v1') + return Const.getSyntaxParserVersion() } static boolean isSyntaxParserV2() { - return getSyntaxParserVersion() == 'v2' + return Const.isSyntaxParserV2() } static void init() { diff --git a/modules/nextflow/src/main/groovy/nextflow/cli/HubOptions.groovy b/modules/nextflow/src/main/groovy/nextflow/cli/CliHubOptions.groovy similarity index 96% rename from modules/nextflow/src/main/groovy/nextflow/cli/HubOptions.groovy rename to modules/nextflow/src/main/groovy/nextflow/cli/CliHubOptions.groovy index 9a022afda1..04b4ce5473 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cli/HubOptions.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cli/CliHubOptions.groovy @@ -18,6 +18,8 @@ package nextflow.cli import com.beust.jcommander.Parameter import groovy.transform.CompileStatic +import nextflow.scm.HubOptions + /** * Defines the command line parameters for command that need to interact with a pipeline service hub i.e. GitHub or BitBucket * @@ -25,7 +27,7 @@ import groovy.transform.CompileStatic */ @CompileStatic -trait HubOptions { +trait CliHubOptions implements HubOptions { @Parameter(names=['-hub'], description = "Service hub where the project is hosted") String hubProvider diff --git a/modules/nextflow/src/main/groovy/nextflow/cli/CliOptions.groovy b/modules/nextflow/src/main/groovy/nextflow/cli/CliOptions.groovy index 660b213116..2687a869da 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cli/CliOptions.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cli/CliOptions.groovy @@ -21,6 +21,7 @@ import com.beust.jcommander.Parameter import groovy.transform.CompileStatic import groovy.util.logging.Slf4j import nextflow.SysEnv +import nextflow.config.ConfigCliOptions import nextflow.exception.AbortOperationException import org.fusesource.jansi.Ansi @@ -31,7 +32,7 @@ import org.fusesource.jansi.Ansi */ @Slf4j @CompileStatic -class CliOptions { +class CliOptions implements ConfigCliOptions{ /** * The packages to debug diff --git a/modules/nextflow/src/main/groovy/nextflow/cli/CmdClean.groovy b/modules/nextflow/src/main/groovy/nextflow/cli/CmdClean.groovy index bb58edacbb..ffdb168edc 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cli/CmdClean.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cli/CmdClean.groovy @@ -108,7 +108,7 @@ class CmdClean extends CmdBase implements CacheBase { final builder = new ConfigBuilder() .setShowClosures(true) .showMissingVariables(true) - .setOptions(launcher.options) + .setCliOptions(launcher.options) .setBaseDir(Paths.get('.')) final config = builder.buildConfigObject() diff --git a/modules/nextflow/src/main/groovy/nextflow/cli/CmdClone.groovy b/modules/nextflow/src/main/groovy/nextflow/cli/CmdClone.groovy index 511f4f7ce1..1aae8a07bf 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cli/CmdClone.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cli/CmdClone.groovy @@ -30,7 +30,7 @@ import nextflow.scm.AssetManager @Slf4j @CompileStatic @Parameters(commandDescription = "Clone a project into a folder") -class CmdClone extends CmdBase implements HubOptions { +class CmdClone extends CmdBase implements CliHubOptions { static final public NAME = 'clone' diff --git a/modules/nextflow/src/main/groovy/nextflow/cli/CmdConfig.groovy b/modules/nextflow/src/main/groovy/nextflow/cli/CmdConfig.groovy index 9d4da3b908..2494f0f15a 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cli/CmdConfig.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cli/CmdConfig.groovy @@ -114,9 +114,10 @@ class CmdConfig extends CmdBase { .setShowClosures(true) .setStripSecrets(true) .showMissingVariables(true) - .setOptions(launcher.options) + .setCliOptions(launcher.options) .setBaseDir(base) - .setCmdConfig(this) + .setShowAllProfiles(this.showAllProfiles) + .setProfile(this.profile) final config = builder.buildConfigObject() diff --git a/modules/nextflow/src/main/groovy/nextflow/cli/CmdFs.groovy b/modules/nextflow/src/main/groovy/nextflow/cli/CmdFs.groovy index 85abaaaa5e..df66baed76 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cli/CmdFs.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cli/CmdFs.groovy @@ -203,7 +203,7 @@ class CmdFs extends CmdBase implements UsageAware { private Session createSession() { // create the config final config = new ConfigBuilder() - .setOptions(getLauncher().getOptions()) + .setCliOptions(getLauncher().getOptions()) .setBaseDir(Paths.get('.')) .build() diff --git a/modules/nextflow/src/main/groovy/nextflow/cli/CmdLineage.groovy b/modules/nextflow/src/main/groovy/nextflow/cli/CmdLineage.groovy index ce9e7a7025..804bb2c20e 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cli/CmdLineage.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cli/CmdLineage.groovy @@ -88,7 +88,7 @@ class CmdLineage extends CmdBase implements UsageAware { Plugins.init() // load the config this.config = new ConfigBuilder() - .setOptions(launcher.options) + .setCliOptions(launcher.options) .setBaseDir(Paths.get('.')) .build() // init plugins diff --git a/modules/nextflow/src/main/groovy/nextflow/cli/CmdNode.groovy b/modules/nextflow/src/main/groovy/nextflow/cli/CmdNode.groovy index 47666166d6..e1d77c386c 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cli/CmdNode.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cli/CmdNode.groovy @@ -21,6 +21,7 @@ import com.beust.jcommander.Parameters import groovy.transform.CompileStatic import groovy.util.logging.Slf4j import nextflow.config.ConfigBuilder +import nextflow.config.ConfigNodeOptions import nextflow.daemon.DaemonLauncher import nextflow.plugin.Plugins import nextflow.util.ServiceName @@ -32,7 +33,7 @@ import nextflow.util.ServiceDiscover @Slf4j @CompileStatic @Parameters -class CmdNode extends CmdBase { +class CmdNode extends CmdBase implements ConfigNodeOptions { static final public NAME = 'node' @@ -66,8 +67,8 @@ class CmdNode extends CmdBase { // create the config object def config = new ConfigBuilder() - .setOptions(launcher.options) - .setCmdNode(this) + .setCliOptions(launcher.options) + .setNodeOptions(this) .build() DaemonLauncher instance diff --git a/modules/nextflow/src/main/groovy/nextflow/cli/CmdPull.groovy b/modules/nextflow/src/main/groovy/nextflow/cli/CmdPull.groovy index c662df99ec..23bf57dbba 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cli/CmdPull.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cli/CmdPull.groovy @@ -31,7 +31,7 @@ import nextflow.util.TestOnly @Slf4j @CompileStatic @Parameters(commandDescription = "Download or update a project") -class CmdPull extends CmdBase implements HubOptions { +class CmdPull extends CmdBase implements CliHubOptions { static final public NAME = 'pull' diff --git a/modules/nextflow/src/main/groovy/nextflow/cli/CmdRun.groovy b/modules/nextflow/src/main/groovy/nextflow/cli/CmdRun.groovy index 309ef27d3f..9bc731fbe3 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cli/CmdRun.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cli/CmdRun.groovy @@ -16,6 +16,8 @@ package nextflow.cli +import nextflow.config.ConfigCliOptions + import static org.fusesource.jansi.Ansi.* import java.nio.file.NoSuchFileException @@ -32,11 +34,13 @@ import groovy.transform.Memoized import groovy.util.logging.Slf4j import groovyx.gpars.GParsConfig import nextflow.BuildInfo +import nextflow.Const import nextflow.NF import nextflow.NextflowMeta import nextflow.SysEnv import nextflow.config.ConfigBuilder import nextflow.config.ConfigMap +import nextflow.config.ConfigRunOptions import nextflow.config.ConfigValidator import nextflow.config.Manifest import nextflow.exception.AbortOperationException @@ -62,7 +66,7 @@ import org.yaml.snakeyaml.Yaml @Slf4j @CompileStatic @Parameters(commandDescription = "Execute a pipeline project") -class CmdRun extends CmdBase implements HubOptions { +class CmdRun extends CmdBase implements CliHubOptions, ConfigRunOptions{ static final public Pattern RUN_NAME_PATTERN = Pattern.compile(/^[a-z](?:[a-z\d]|[-_](?=[a-z\d])){0,79}$/, Pattern.CASE_INSENSITIVE) @@ -354,8 +358,8 @@ class CmdRun extends CmdBase implements HubOptions { // -- PHASE 1: Load config with mock secrets provider final secretsProvider = new EmptySecretProvider() ConfigBuilder builder = new ConfigBuilder() - .setOptions(launcher.options) - .setCmdRun(this) + .setCliOptions(launcher.options) + .setRunOptions(this as ConfigRunOptions) .setBaseDir(scriptFile.parent) .setCliParams(cliParams) .setSecretsProvider(secretsProvider) // Mock provider returns empty strings @@ -382,8 +386,8 @@ class CmdRun extends CmdBase implements HubOptions { if( secretsProvider.usedSecrets() ) { log.debug "Config file used secrets -- reloading config with secrets provider" builder = new ConfigBuilder() - .setOptions(launcher.options) - .setCmdRun(this) + .setCliOptions(launcher.options) + .setRunOptions(this) .setBaseDir(scriptFile.parent) .setCliParams(cliParams) // No .setSecretsProvider() - uses real secrets system now @@ -395,7 +399,7 @@ class CmdRun extends CmdBase implements HubOptions { launchInfo(config, scriptFile) // -- validate config options - if( NF.isSyntaxParserV2() ) + if( Const.isSyntaxParserV2() ) new ConfigValidator().validate(config) // -- create a new runner instance @@ -799,7 +803,7 @@ class CmdRun extends CmdBase implements HubOptions { } static protected parseParamValue(String str) { - if ( SysEnv.get('NXF_DISABLE_PARAMS_TYPE_DETECTION') || NF.isSyntaxParserV2() ) + if ( SysEnv.get('NXF_DISABLE_PARAMS_TYPE_DETECTION') || Const.isSyntaxParserV2() ) return str if ( str == null ) return null @@ -880,4 +884,25 @@ class CmdRun extends CmdBase implements HubOptions { } } + ConfigCliOptions getConfigCliOptions(){ + return launcher.options as ConfigCliOptions + } + + String getNormalizeResumeId( String previousId ) { + String uniqueId = resume ?: previousId + if( !uniqueId ) + return null + if( uniqueId == 'last' || uniqueId == 'true' ) { + if( HistoryFile.disabled() ) + throw new AbortOperationException("The resume session id should be specified via `-resume` option when history file tracking is disabled") + uniqueId = HistoryFile.DEFAULT.getLast()?.sessionId + + if( !uniqueId ) { + log.warn "It appears you have never run this project before -- Option `-resume` is ignored" + } + } + + return uniqueId + } + } diff --git a/modules/nextflow/src/main/groovy/nextflow/cli/PluginAbstractExec.groovy b/modules/nextflow/src/main/groovy/nextflow/cli/PluginAbstractExec.groovy index 8cb1391b00..98a32e8855 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cli/PluginAbstractExec.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cli/PluginAbstractExec.groovy @@ -51,7 +51,7 @@ trait PluginAbstractExec implements PluginExecAware { this.launcher = launcher1 // create the config final config = new ConfigBuilder() - .setOptions(launcher1.options) + .setCliOptions(launcher1.options) .setBaseDir(Paths.get('.')) .build() diff --git a/modules/nextflow/src/main/groovy/nextflow/script/ScriptRunner.groovy b/modules/nextflow/src/main/groovy/nextflow/script/ScriptRunner.groovy index 4449ea27c5..6bdfbc0dd4 100644 --- a/modules/nextflow/src/main/groovy/nextflow/script/ScriptRunner.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/script/ScriptRunner.groovy @@ -16,7 +16,7 @@ package nextflow.script -import static nextflow.util.ConfigHelper.* +import static nextflow.util.ConfigHelper.parseValue import java.nio.file.Path diff --git a/modules/nf-commons/build.gradle b/modules/nf-commons/build.gradle index 35635e3993..0adf64fc42 100644 --- a/modules/nf-commons/build.gradle +++ b/modules/nf-commons/build.gradle @@ -39,6 +39,7 @@ dependencies { // patch gson dependency required by pf4j api 'com.google.code.gson:gson:2.13.1' api 'io.seqera:npr-api:0.6.1' + api 'jline:jline:2.9' /* testImplementation inherited from top gradle build file */ testImplementation(testFixtures(project(":nextflow"))) diff --git a/modules/nf-commons/src/main/nextflow/Const.groovy b/modules/nf-commons/src/main/nextflow/Const.groovy index 9eb1533a99..e7200a3ff5 100644 --- a/modules/nf-commons/src/main/nextflow/Const.groovy +++ b/modules/nf-commons/src/main/nextflow/Const.groovy @@ -70,6 +70,14 @@ class Const { return Path.of(SysEnv.get('NXF_CACHE_DIR', '.nextflow')) } + static String getSyntaxParserVersion() { + return SysEnv.get('NXF_SYNTAX_PARSER', 'v1') + } + + static boolean isSyntaxParserV2() { + return getSyntaxParserVersion() == 'v2' + } + static public final String ROLE_WORKER = 'worker' static public final String ROLE_MASTER = 'master' diff --git a/modules/nextflow/src/main/groovy/nextflow/ast/NextflowXform.groovy b/modules/nf-commons/src/main/nextflow/ast/NextflowXform.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/ast/NextflowXform.groovy rename to modules/nf-commons/src/main/nextflow/ast/NextflowXform.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/exception/HttpResponseLengthExceedException.groovy b/modules/nf-commons/src/main/nextflow/exception/HttpResponseLengthExceedException.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/exception/HttpResponseLengthExceedException.groovy rename to modules/nf-commons/src/main/nextflow/exception/HttpResponseLengthExceedException.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/exception/IllegalConfigException.groovy b/modules/nf-commons/src/main/nextflow/exception/IllegalConfigException.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/exception/IllegalConfigException.groovy rename to modules/nf-commons/src/main/nextflow/exception/IllegalConfigException.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/exception/MissingCredentialsException.groovy b/modules/nf-commons/src/main/nextflow/exception/MissingCredentialsException.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/exception/MissingCredentialsException.groovy rename to modules/nf-commons/src/main/nextflow/exception/MissingCredentialsException.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/exception/ProcessException.groovy b/modules/nf-commons/src/main/nextflow/exception/ProcessException.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/exception/ProcessException.groovy rename to modules/nf-commons/src/main/nextflow/exception/ProcessException.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/exception/ProcessUnrecoverableException.groovy b/modules/nf-commons/src/main/nextflow/exception/ProcessUnrecoverableException.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/exception/ProcessUnrecoverableException.groovy rename to modules/nf-commons/src/main/nextflow/exception/ProcessUnrecoverableException.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/exception/RateLimitExceededException.groovy b/modules/nf-commons/src/main/nextflow/exception/RateLimitExceededException.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/exception/RateLimitExceededException.groovy rename to modules/nf-commons/src/main/nextflow/exception/RateLimitExceededException.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/executor/BashTemplateEngine.groovy b/modules/nf-commons/src/main/nextflow/executor/BashTemplateEngine.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/executor/BashTemplateEngine.groovy rename to modules/nf-commons/src/main/nextflow/executor/BashTemplateEngine.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/script/parser/v2/ErrorListener.groovy b/modules/nf-commons/src/main/nextflow/script/parser/v2/ErrorListener.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/script/parser/v2/ErrorListener.groovy rename to modules/nf-commons/src/main/nextflow/script/parser/v2/ErrorListener.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/util/MustacheTemplateEngine.groovy b/modules/nf-commons/src/main/nextflow/util/MustacheTemplateEngine.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/util/MustacheTemplateEngine.groovy rename to modules/nf-commons/src/main/nextflow/util/MustacheTemplateEngine.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/util/MustacheTemplateEngineTest.groovy b/modules/nf-commons/src/test/nextflow/util/MustacheTemplateEngineTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/util/MustacheTemplateEngineTest.groovy rename to modules/nf-commons/src/test/nextflow/util/MustacheTemplateEngineTest.groovy diff --git a/modules/nf-config/build.gradle b/modules/nf-config/build.gradle new file mode 100644 index 0000000000..0331f16265 --- /dev/null +++ b/modules/nf-config/build.gradle @@ -0,0 +1,43 @@ +/* + * Copyright 2013-2024, 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. + */ + + +apply plugin: 'groovy' + +sourceSets { + main.java.srcDirs = [] + main.groovy.srcDirs = ['src/main'] + main.resources.srcDirs = ['src/resources'] + test.groovy.srcDirs = ['src/test'] + test.java.srcDirs = [] + test.resources.srcDirs = [] +} + + +dependencies { + api project(':nf-commons') + api project(':nf-secrets') + api ('org.apache.groovy:groovy:4.0.29') + api ('org.apache.groovy:groovy-nio:4.0.29') + api ('org.apache.groovy:groovy-json:4.0.29') + api ('ch.artecat.grengine:grengine:3.0.2') { exclude group: 'org.codehaus.groovy' } + api ('org.yaml:snakeyaml:2.2') + + /* testImplementation inherited from top gradle build file */ + testImplementation "org.apache.groovy:groovy-json:4.0.29" // needed by wiremock + testImplementation(testFixtures(project(":nextflow"))) +} + diff --git a/modules/nextflow/src/main/groovy/nextflow/config/CascadingConfig.groovy b/modules/nf-config/src/main/nextflow/config/CascadingConfig.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/config/CascadingConfig.groovy rename to modules/nf-config/src/main/nextflow/config/CascadingConfig.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/config/ConfigBuilder.groovy b/modules/nf-config/src/main/nextflow/config/ConfigBuilder.groovy similarity index 79% rename from modules/nextflow/src/main/groovy/nextflow/config/ConfigBuilder.groovy rename to modules/nf-config/src/main/nextflow/config/ConfigBuilder.groovy index 1bb80cf0ea..8f31bd7309 100644 --- a/modules/nextflow/src/main/groovy/nextflow/config/ConfigBuilder.groovy +++ b/modules/nf-config/src/main/nextflow/config/ConfigBuilder.groovy @@ -16,7 +16,8 @@ package nextflow.config -import static nextflow.util.ConfigHelper.* +import static nextflow.util.ConfigHelper.parseValue +import static nextflow.util.ConfigHelper.toCanonicalString import java.nio.file.Path import java.nio.file.Paths @@ -25,17 +26,11 @@ import groovy.transform.Memoized import groovy.transform.PackageScope import groovy.util.logging.Slf4j import nextflow.Const -import nextflow.NF import nextflow.SysEnv -import nextflow.cli.CliOptions -import nextflow.cli.CmdConfig -import nextflow.cli.CmdNode -import nextflow.cli.CmdRun import nextflow.exception.AbortOperationException import nextflow.exception.ConfigParseException import nextflow.secret.SecretsLoader import nextflow.secret.SecretsProvider -import nextflow.util.HistoryFile import nextflow.util.SecretHelper /** * Builds up the Nextflow configuration object @@ -47,11 +42,11 @@ class ConfigBuilder { static final public String DEFAULT_PROFILE = 'standard' - CliOptions options + ConfigCliOptions cliOptions - CmdRun cmdRun + ConfigRunOptions runOptions - CmdNode cmdNode + ConfigNodeOptions nodeOptions Path baseDir @@ -87,6 +82,8 @@ class ConfigBuilder { Map declaredParams = [:] + boolean strict + ConfigBuilder() { setHomeDir(Const.APP_HOME_DIR) setCurrentDir(Paths.get('.')) @@ -102,6 +99,11 @@ class ConfigBuilder { return this } + ConfigBuilder setStrict(boolean value) { + this.strict = value + return this + } + ConfigBuilder showMissingVariables(boolean value) { this.showMissingVariables = value return this @@ -112,14 +114,14 @@ class ConfigBuilder { return this } - ConfigBuilder setOptions( CliOptions options ) { - this.options = options + ConfigBuilder setCliOptions(ConfigCliOptions options ) { + this.cliOptions = options return this } - ConfigBuilder setCmdRun( CmdRun cmdRun ) { - this.cmdRun = cmdRun - setProfile(cmdRun.profile) + ConfigBuilder setRunOptions(ConfigRunOptions runOptions ) { + this.runOptions = runOptions + setProfile(runOptions.profile) return this } @@ -143,14 +145,8 @@ class ConfigBuilder { return this } - ConfigBuilder setCmdNode( CmdNode node ) { - this.cmdNode = node - return this - } - - ConfigBuilder setCmdConfig( CmdConfig cmdConfig ) { - showAllProfiles = cmdConfig.showAllProfiles - setProfile(cmdConfig.profile) + ConfigBuilder setNodeOptions(ConfigNodeOptions node ) { + this.nodeOptions = node return this } @@ -256,8 +252,8 @@ class ConfigBuilder { def customConfigs = [] if( userConfigFiles ) customConfigs.addAll(userConfigFiles) - if( options?.userConfig ) customConfigs.addAll(options.userConfig) - if( cmdRun?.runConfig ) customConfigs.addAll(cmdRun.runConfig) + if( cliOptions?.userConfig ) customConfigs.addAll(cliOptions.userConfig) + if( runOptions?.runConfig ) customConfigs.addAll(runOptions.runConfig) if( customConfigs ) { for( def item : customConfigs ) { def configFile = item instanceof Path ? item : currentDir.resolve(item.toString()) @@ -283,8 +279,8 @@ class ConfigBuilder { @PackageScope ConfigObject buildGivenFiles(List files) { - final Map vars = cmdRun?.env - final boolean exportSysEnv = cmdRun?.exportSysEnv + final Map vars = runOptions?.env + final boolean exportSysEnv = runOptions?.exportSysEnv def items = [] if( files ) for( Path file : files ) { @@ -308,26 +304,26 @@ class ConfigBuilder { } // set the cluster options for the node command - if( cmdNode?.clusterOptions ) { + if( nodeOptions?.clusterOptions ) { def str = new StringBuilder() - cmdNode.clusterOptions.each { k, v -> + nodeOptions.clusterOptions.each { k, v -> str << "cluster." << k << '=' << wrapValue(v) << '\n' } items << str } // -- add the executor obj from the command line args - if( cmdRun?.clusterOptions ) { + if( runOptions?.clusterOptions ) { def str = new StringBuilder() - cmdRun.clusterOptions.each { k, v -> + runOptions.clusterOptions.each { k, v -> str << "cluster." << k << '=' << wrapValue(v) << '\n' } items << str } - if( cmdRun?.executorOptions ) { + if( runOptions?.executorOptions ) { def str = new StringBuilder() - cmdRun.executorOptions.each { k, v -> + runOptions.executorOptions.each { k, v -> str << "executor." << k << '=' << wrapValue(v) << '\n' } items << str @@ -365,7 +361,7 @@ class ConfigBuilder { protected ConfigObject buildConfig0( Map env, List configEntries ) { assert env != null - final ignoreIncludes = options ? options.ignoreConfigIncludes : false + final ignoreIncludes = cliOptions ? cliOptions.ignoreConfigIncludes : false final parser = ConfigParserFactory.create() .setRenderClosureAsString(showClosures) .setStripSecrets(stripSecrets) @@ -436,7 +432,7 @@ class ConfigBuilder { } final config = parse0(parser, entry) - if( NF.getSyntaxParserVersion() == 'v1' ) + if( Const.getSyntaxParserVersion() == 'v1' ) validate(config, entry) declaredParams.putAll(parser.getDeclaredParams()) result.merge(config) @@ -534,255 +530,236 @@ class ConfigBuilder { } } - private String normalizeResumeId( String uniqueId ) { - if( !uniqueId ) - return null - if( uniqueId == 'last' || uniqueId == 'true' ) { - if( HistoryFile.disabled() ) - throw new AbortOperationException("The resume session id should be specified via `-resume` option when history file tracking is disabled") - uniqueId = HistoryFile.DEFAULT.getLast()?.sessionId - - if( !uniqueId ) { - log.warn "It appears you have never run this project before -- Option `-resume` is ignored" - } - } - - return uniqueId - } - @PackageScope - void configRunOptions(ConfigObject config, Map env, CmdRun cmdRun) { + void configRunOptions(ConfigObject config, Map env, ConfigRunOptions run) { // -- set config options - if( cmdRun.cacheable != null ) - config.cacheable = cmdRun.cacheable + if( run.cacheable != null ) + config.cacheable = run.cacheable // -- set the run name - if( cmdRun.runName ) - config.runName = cmdRun.runName + if( run.runName ) + config.runName = run.runName - if( cmdRun.stubRun ) - config.stubRun = cmdRun.stubRun + if( run.stubRun ) + config.stubRun = run.stubRun // -- set the output directory - if( cmdRun.outputDir ) - config.outputDir = cmdRun.outputDir + if( run.outputDir ) + config.outputDir = run.outputDir - if( cmdRun.preview ) - config.preview = cmdRun.preview + if( run.preview ) + config.preview = run.preview - if( cmdRun.plugins ) - config.plugins = cmdRun.plugins.tokenize(',') + if( run.plugins ) + config.plugins = run.plugins.tokenize(',') // -- sets the working directory - if( cmdRun.workDir ) - config.workDir = cmdRun.workDir + if( run.workDir ) + config.workDir = run.workDir else if( !config.workDir ) config.workDir = env.get('NXF_WORK') ?: 'work' - if( cmdRun.bucketDir ) - config.bucketDir = cmdRun.bucketDir + if( run.bucketDir ) + config.bucketDir = run.bucketDir // -- sets the library path - if( cmdRun.libPath ) - config.libDir = cmdRun.libPath + if( run.libPath ) + config.libDir = run.libPath else if ( !config.isSet('libDir') && env.get('NXF_LIB') ) config.libDir = env.get('NXF_LIB') // -- override 'process' parameters defined on the cmd line - cmdRun.process.each { name, value -> + run.process.each { name, value -> config.process[name] = parseValue(value) } - if( cmdRun.withoutConda && config.conda instanceof Map ) { + if( run.withoutConda && config.conda instanceof Map ) { // disable conda execution log.debug "Disabling execution with Conda as requested by command-line option `-without-conda`" config.conda.enabled = false } // -- apply the conda environment - if( cmdRun.withConda ) { - if( cmdRun.withConda != '-' ) - config.process.conda = cmdRun.withConda + if( run.withConda ) { + if( run.withConda != '-' ) + config.process.conda = run.withConda config.conda.enabled = true } - if( cmdRun.withoutSpack && config.spack instanceof Map ) { + if( run.withoutSpack && config.spack instanceof Map ) { // disable spack execution log.debug "Disabling execution with Spack as requested by command-line option `-without-spack`" config.spack.enabled = false } // -- apply the spack environment - if( cmdRun.withSpack ) { - if( cmdRun.withSpack != '-' ) - config.process.spack = cmdRun.withSpack + if( run.withSpack ) { + if( run.withSpack != '-' ) + config.process.spack = run.withSpack config.spack.enabled = true } // -- sets the resume option - if( cmdRun.resume ) - config.resume = cmdRun.resume - - if( config.isSet('resume') ) - config.resume = normalizeResumeId(config.resume as String) + if( run.resume || config.isSet('resume')) + config.resume = run.getNormalizeResumeId(config.resume as String) // -- sets `dumpHashes` option - if( cmdRun.dumpHashes ) { - config.dumpHashes = cmdRun.dumpHashes != '-' ? cmdRun.dumpHashes : 'default' + if( run.dumpHashes ) { + config.dumpHashes = run.dumpHashes != '-' ? run.dumpHashes : 'default' } - if( cmdRun.dumpChannels ) - config.dumpChannels = cmdRun.dumpChannels.tokenize(',') + if( run.dumpChannels ) + config.dumpChannels = run.dumpChannels.tokenize(',') // -- other configuration parameters - if( cmdRun.poolSize ) { - config.poolSize = cmdRun.poolSize + if( run.poolSize ) { + config.poolSize = run.poolSize } - if( cmdRun.queueSize ) { - config.executor.queueSize = cmdRun.queueSize + if( run.queueSize ) { + config.executor.queueSize = run.queueSize } - if( cmdRun.pollInterval ) { - config.executor.pollInterval = cmdRun.pollInterval + if( run.pollInterval ) { + config.executor.pollInterval = run.pollInterval } // -- sets trace file options - if( cmdRun.withTrace ) { + if( run.withTrace ) { if( !(config.trace instanceof Map) ) config.trace = [:] config.trace.enabled = true - if( cmdRun.withTrace != '-' ) - config.trace.file = cmdRun.withTrace + if( run.withTrace != '-' ) + config.trace.file = run.withTrace } // -- sets report report options - if( cmdRun.withReport ) { + if( run.withReport ) { if( !(config.report instanceof Map) ) config.report = [:] config.report.enabled = true - if( cmdRun.withReport != '-' ) - config.report.file = cmdRun.withReport + if( run.withReport != '-' ) + config.report.file = run.withReport } // -- sets timeline report options - if( cmdRun.withTimeline ) { + if( run.withTimeline ) { if( !(config.timeline instanceof Map) ) config.timeline = [:] config.timeline.enabled = true - if( cmdRun.withTimeline != '-' ) - config.timeline.file = cmdRun.withTimeline + if( run.withTimeline != '-' ) + config.timeline.file = run.withTimeline } // -- sets DAG report options - if( cmdRun.withDag ) { + if( run.withDag ) { if( !(config.dag instanceof Map) ) config.dag = [:] config.dag.enabled = true - if( cmdRun.withDag != '-' ) - config.dag.file = cmdRun.withDag + if( run.withDag != '-' ) + config.dag.file = run.withDag } - if( cmdRun.withNotification ) { + if( run.withNotification ) { if( !(config.notification instanceof Map) ) config.notification = [:] - if( cmdRun.withNotification in ['true','false']) { - config.notification.enabled = cmdRun.withNotification == 'true' + if( run.withNotification in ['true','false']) { + config.notification.enabled = run.withNotification == 'true' } else { config.notification.enabled = true - config.notification.to = cmdRun.withNotification + config.notification.to = run.withNotification } } // -- sets the messages options - if( cmdRun.withWebLog ) { + if( run.withWebLog ) { log.warn "The command line option '-with-weblog' is deprecated - consider enabling this feature by setting 'weblog.enabled=true' in your configuration file" if( !(config.weblog instanceof Map) ) config.weblog = [:] config.weblog.enabled = true - if( cmdRun.withWebLog != '-' ) - config.weblog.url = cmdRun.withWebLog + if( run.withWebLog != '-' ) + config.weblog.url = run.withWebLog else if( !config.weblog.url ) config.weblog.url = 'http://localhost' } // -- sets tower options - if( cmdRun.withTower ) { + if( run.withTower ) { if( !(config.tower instanceof Map) ) config.tower = [:] config.tower.enabled = true - if( cmdRun.withTower != '-' ) - config.tower.endpoint = cmdRun.withTower + if( run.withTower != '-' ) + config.tower.endpoint = run.withTower else if( !config.tower.endpoint ) config.tower.endpoint = 'https://api.cloud.seqera.io' } // -- set wave options - if( cmdRun.withWave ) { + if( run.withWave ) { if( !(config.wave instanceof Map) ) config.wave = [:] config.wave.enabled = true - if( cmdRun.withWave != '-' ) - config.wave.endpoint = cmdRun.withWave + if( run.withWave != '-' ) + config.wave.endpoint = run.withWave else if( !config.wave.endpoint ) config.wave.endpoint = 'https://wave.seqera.io' } // -- set fusion options - if( cmdRun.withFusion ) { + if( run.withFusion ) { if( !(config.fusion instanceof Map) ) config.fusion = [:] - config.fusion.enabled = cmdRun.withFusion == 'true' + config.fusion.enabled = run.withFusion == 'true' } // -- set cloudcache options final envCloudPath = env.get('NXF_CLOUDCACHE_PATH') - if( cmdRun.cloudCachePath || envCloudPath ) { + if( run.cloudCachePath || envCloudPath ) { if( !(config.cloudcache instanceof Map) ) config.cloudcache = [:] if( !config.cloudcache.isSet('enabled') ) config.cloudcache.enabled = true - if( cmdRun.cloudCachePath && cmdRun.cloudCachePath != '-' ) - config.cloudcache.path = cmdRun.cloudCachePath + if( run.cloudCachePath && run.cloudCachePath != '-' ) + config.cloudcache.path = run.cloudCachePath else if( !config.cloudcache.isSet('path') && envCloudPath ) config.cloudcache.path = envCloudPath } // -- add the command line parameters to the 'taskConfig' object if( cliParams ) - config.params = mergeMaps( (Map)config.params, cliParams, NF.strictMode ) + config.params = mergeMaps( (Map)config.params, cliParams, strict ) - if( cmdRun.withoutDocker && config.docker instanceof Map ) { + if( run.withoutDocker && config.docker instanceof Map ) { // disable docker execution log.debug "Disabling execution in Docker container as requested by command-line option `-without-docker`" config.docker.enabled = false } - if( cmdRun.withDocker ) { - configContainer(config, 'docker', cmdRun.withDocker) + if( run.withDocker ) { + configContainer(config, 'docker', run.withDocker) } - if( cmdRun.withPodman ) { - configContainer(config, 'podman', cmdRun.withPodman) + if( run.withPodman ) { + configContainer(config, 'podman', run.withPodman) } - if( cmdRun.withSingularity ) { - configContainer(config, 'singularity', cmdRun.withSingularity) + if( run.withSingularity ) { + configContainer(config, 'singularity', run.withSingularity) } - if( cmdRun.withApptainer ) { - configContainer(config, 'apptainer', cmdRun.withApptainer) + if( run.withApptainer ) { + configContainer(config, 'apptainer', run.withApptainer) } - if( cmdRun.withCharliecloud ) { - configContainer(config, 'charliecloud', cmdRun.withCharliecloud) + if( run.withCharliecloud ) { + configContainer(config, 'charliecloud', run.withCharliecloud) } } private void configContainer(ConfigObject config, String engine, def cli) { - log.debug "Enabling execution in ${engine.capitalize()} container as requested by command-line option `-with-$engine ${cmdRun.withDocker}`" + log.debug "Enabling execution in ${engine.capitalize()} container as requested by command-line option `-with-$engine ${runOptions.withDocker}`" if( !config.containsKey(engine) ) config.put(engine, [:]) @@ -829,11 +806,11 @@ class ConfigBuilder { ConfigObject buildConfigObject() { // -- configuration file(s) - def configFiles = validateConfigFiles(options?.config) + def configFiles = validateConfigFiles(cliOptions?.config) def config = buildGivenFiles(configFiles) - if( cmdRun ) - configRunOptions(config, SysEnv.get(), cmdRun) + if( runOptions ) + configRunOptions(config, SysEnv.get(), runOptions) return config } @@ -919,13 +896,13 @@ class ConfigBuilder { } } - static String resolveConfig(Path baseDir, CmdRun cmdRun) { + static String resolveConfig(Path baseDir, ConfigRunOptions run) { final config = new ConfigBuilder() .setShowClosures(true) .setStripSecrets(true) - .setOptions(cmdRun.launcher.options) - .setCmdRun(cmdRun) + .setCliOptions(run.getConfigCliOptions()) + .setRunOptions(run) .setBaseDir(baseDir) .buildConfigObject() diff --git a/modules/nf-config/src/main/nextflow/config/ConfigCliOptions.groovy b/modules/nf-config/src/main/nextflow/config/ConfigCliOptions.groovy new file mode 100644 index 0000000000..d9e542370c --- /dev/null +++ b/modules/nf-config/src/main/nextflow/config/ConfigCliOptions.groovy @@ -0,0 +1,28 @@ +/* + * Copyright 2013-2026, 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. + */ + +package nextflow.config + +/** + * Interface to get common cli command options used for configuration purposes. + * + * @author Jorge Ejarque (jorge.ejarque@seqera.io) + */ +interface ConfigCliOptions { + List getConfig() + boolean getIgnoreConfigIncludes() + List getUserConfig() +} \ No newline at end of file diff --git a/modules/nextflow/src/main/groovy/nextflow/config/ConfigClosurePlaceholder.groovy b/modules/nf-config/src/main/nextflow/config/ConfigClosurePlaceholder.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/config/ConfigClosurePlaceholder.groovy rename to modules/nf-config/src/main/nextflow/config/ConfigClosurePlaceholder.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/config/ConfigField.groovy b/modules/nf-config/src/main/nextflow/config/ConfigField.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/config/ConfigField.groovy rename to modules/nf-config/src/main/nextflow/config/ConfigField.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/config/ConfigMap.groovy b/modules/nf-config/src/main/nextflow/config/ConfigMap.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/config/ConfigMap.groovy rename to modules/nf-config/src/main/nextflow/config/ConfigMap.groovy diff --git a/modules/nf-config/src/main/nextflow/config/ConfigNodeOptions.groovy b/modules/nf-config/src/main/nextflow/config/ConfigNodeOptions.groovy new file mode 100644 index 0000000000..f1dcd9ca44 --- /dev/null +++ b/modules/nf-config/src/main/nextflow/config/ConfigNodeOptions.groovy @@ -0,0 +1,26 @@ +/* + * Copyright 2013-2026, 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. + */ + +package nextflow.config + +/** + * Interface to get `node` command options used for configuration purposes. + * + * @author Jorge Ejarque (jorge.ejarque@seqera.io) + */ +interface ConfigNodeOptions { + Map getClusterOptions() +} \ No newline at end of file diff --git a/modules/nextflow/src/main/groovy/nextflow/config/ConfigParser.groovy b/modules/nf-config/src/main/nextflow/config/ConfigParser.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/config/ConfigParser.groovy rename to modules/nf-config/src/main/nextflow/config/ConfigParser.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/config/ConfigParserFactory.groovy b/modules/nf-config/src/main/nextflow/config/ConfigParserFactory.groovy similarity index 94% rename from modules/nextflow/src/main/groovy/nextflow/config/ConfigParserFactory.groovy rename to modules/nf-config/src/main/nextflow/config/ConfigParserFactory.groovy index acbc338b38..0cad2661b9 100644 --- a/modules/nextflow/src/main/groovy/nextflow/config/ConfigParserFactory.groovy +++ b/modules/nf-config/src/main/nextflow/config/ConfigParserFactory.groovy @@ -19,7 +19,7 @@ package nextflow.config import groovy.transform.CompileStatic import groovy.util.logging.Slf4j -import nextflow.NF +import nextflow.Const import nextflow.config.parser.v1.ConfigParserV1 import nextflow.config.parser.v2.ConfigParserV2 @@ -33,7 +33,7 @@ import nextflow.config.parser.v2.ConfigParserV2 class ConfigParserFactory { static ConfigParser create() { - final parser = NF.getSyntaxParserVersion() + final parser = Const.getSyntaxParserVersion() if( parser == 'v1' ) { return new ConfigParserV1() } diff --git a/modules/nf-config/src/main/nextflow/config/ConfigRunOptions.groovy b/modules/nf-config/src/main/nextflow/config/ConfigRunOptions.groovy new file mode 100644 index 0000000000..fddab5e87b --- /dev/null +++ b/modules/nf-config/src/main/nextflow/config/ConfigRunOptions.groovy @@ -0,0 +1,70 @@ +/* + * Copyright 2013-2026, 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. + */ +package nextflow.config + +/** + * Interface to get `run` command options used for configuration purposes. + * + * @author Jorge Ejarque (jorge.ejarque@seqera.io) + */ +interface ConfigRunOptions { + String getBucketDir() + String getCloudCachePath() + String getLibPath() + String getOutputDir() + String getWorkDir() + Boolean getCacheable() + boolean getPreview() + String getResume() + String getRunName() + String getTest() + boolean getStubRun() + Integer getPoolSize() + long getPollInterval() + Integer getQueueSize() + String getPlugins() + String getProfile() + List getRunConfig() + Map getExecutorOptions() + Map getProcess() + Map getClusterOptions() + Map getEnv() + boolean getExportSysEnv() + ConfigCliOptions getConfigCliOptions() + Boolean getWithoutConda() + String getWithConda() + Boolean getWithoutSpack() + String getWithSpack() + String getWithTrace() + String getWithReport() + String getWithTimeline() + String getWithDag() + String getWithNotification() + String getWithWebLog() + String getWithTower() + String getWithWave() + String getWithFusion() + boolean getWithoutDocker() + def getWithDocker() + def getWithPodman() + def getWithSingularity() + def getWithApptainer() + def getWithCharliecloud() + String getDumpHashes() + String getDumpChannels() + String getNormalizeResumeId(String id) + +} \ No newline at end of file diff --git a/modules/nextflow/src/main/groovy/nextflow/config/ConfigValidator.groovy b/modules/nf-config/src/main/nextflow/config/ConfigValidator.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/config/ConfigValidator.groovy rename to modules/nf-config/src/main/nextflow/config/ConfigValidator.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/config/Manifest.groovy b/modules/nf-config/src/main/nextflow/config/Manifest.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/config/Manifest.groovy rename to modules/nf-config/src/main/nextflow/config/Manifest.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/config/StripSecretsXform.groovy b/modules/nf-config/src/main/nextflow/config/StripSecretsXform.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/config/StripSecretsXform.groovy rename to modules/nf-config/src/main/nextflow/config/StripSecretsXform.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/config/WorkflowConfig.groovy b/modules/nf-config/src/main/nextflow/config/WorkflowConfig.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/config/WorkflowConfig.groovy rename to modules/nf-config/src/main/nextflow/config/WorkflowConfig.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/config/parser/v1/ConfigBase.groovy b/modules/nf-config/src/main/nextflow/config/parser/v1/ConfigBase.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/config/parser/v1/ConfigBase.groovy rename to modules/nf-config/src/main/nextflow/config/parser/v1/ConfigBase.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/config/parser/v1/ConfigParserV1.groovy b/modules/nf-config/src/main/nextflow/config/parser/v1/ConfigParserV1.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/config/parser/v1/ConfigParserV1.groovy rename to modules/nf-config/src/main/nextflow/config/parser/v1/ConfigParserV1.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/config/parser/v1/ConfigTransform.groovy b/modules/nf-config/src/main/nextflow/config/parser/v1/ConfigTransform.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/config/parser/v1/ConfigTransform.groovy rename to modules/nf-config/src/main/nextflow/config/parser/v1/ConfigTransform.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/config/parser/v1/ConfigTransformImpl.groovy b/modules/nf-config/src/main/nextflow/config/parser/v1/ConfigTransformImpl.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/config/parser/v1/ConfigTransformImpl.groovy rename to modules/nf-config/src/main/nextflow/config/parser/v1/ConfigTransformImpl.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/config/parser/v1/PluginsDsl.groovy b/modules/nf-config/src/main/nextflow/config/parser/v1/PluginsDsl.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/config/parser/v1/PluginsDsl.groovy rename to modules/nf-config/src/main/nextflow/config/parser/v1/PluginsDsl.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/config/parser/v2/ClosureToStringVisitor.java b/modules/nf-config/src/main/nextflow/config/parser/v2/ClosureToStringVisitor.java similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/config/parser/v2/ClosureToStringVisitor.java rename to modules/nf-config/src/main/nextflow/config/parser/v2/ClosureToStringVisitor.java diff --git a/modules/nextflow/src/main/groovy/nextflow/config/parser/v2/ConfigCompiler.java b/modules/nf-config/src/main/nextflow/config/parser/v2/ConfigCompiler.java similarity index 99% rename from modules/nextflow/src/main/groovy/nextflow/config/parser/v2/ConfigCompiler.java rename to modules/nf-config/src/main/nextflow/config/parser/v2/ConfigCompiler.java index 5976c29fc7..e7b7ab94af 100644 --- a/modules/nextflow/src/main/groovy/nextflow/config/parser/v2/ConfigCompiler.java +++ b/modules/nf-config/src/main/nextflow/config/parser/v2/ConfigCompiler.java @@ -33,7 +33,6 @@ import nextflow.script.control.Compiler; import nextflow.script.control.GStringToStringVisitor; import nextflow.script.control.PathCompareVisitor; -import org.codehaus.groovy.ast.ASTNode; import org.codehaus.groovy.ast.ClassHelper; import org.codehaus.groovy.ast.ClassNode; import org.codehaus.groovy.control.CompilationUnit; diff --git a/modules/nextflow/src/main/groovy/nextflow/config/parser/v2/ConfigDsl.groovy b/modules/nf-config/src/main/nextflow/config/parser/v2/ConfigDsl.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/config/parser/v2/ConfigDsl.groovy rename to modules/nf-config/src/main/nextflow/config/parser/v2/ConfigDsl.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/config/parser/v2/ConfigParserV2.groovy b/modules/nf-config/src/main/nextflow/config/parser/v2/ConfigParserV2.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/config/parser/v2/ConfigParserV2.groovy rename to modules/nf-config/src/main/nextflow/config/parser/v2/ConfigParserV2.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/config/spec/MarkdownRenderer.groovy b/modules/nf-config/src/main/nextflow/config/spec/MarkdownRenderer.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/config/spec/MarkdownRenderer.groovy rename to modules/nf-config/src/main/nextflow/config/spec/MarkdownRenderer.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/exception/ConfigParseException.groovy b/modules/nf-config/src/main/nextflow/exception/ConfigParseException.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/exception/ConfigParseException.groovy rename to modules/nf-config/src/main/nextflow/exception/ConfigParseException.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/util/ConfigHelper.groovy b/modules/nf-config/src/main/nextflow/util/ConfigHelper.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/util/ConfigHelper.groovy rename to modules/nf-config/src/main/nextflow/util/ConfigHelper.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/config/CascadingConfigTest.groovy b/modules/nf-config/src/test/nextflow/config/CascadingConfigTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/config/CascadingConfigTest.groovy rename to modules/nf-config/src/test/nextflow/config/CascadingConfigTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/config/ConfigBuilderTest.groovy b/modules/nf-config/src/test/nextflow/config/ConfigBuilderTest.groovy similarity index 95% rename from modules/nextflow/src/test/groovy/nextflow/config/ConfigBuilderTest.groovy rename to modules/nf-config/src/test/nextflow/config/ConfigBuilderTest.groovy index 0220ea7e2c..c28b54ede4 100644 --- a/modules/nextflow/src/test/groovy/nextflow/config/ConfigBuilderTest.groovy +++ b/modules/nf-config/src/test/nextflow/config/ConfigBuilderTest.groovy @@ -50,8 +50,8 @@ class ConfigBuilderTest extends Specification { ConfigObject configWithParams(Path file, Map runOpts, Path baseDir=null) { def run = new CmdRun(runOpts) return new ConfigBuilder() - .setOptions(new CliOptions()) - .setCmdRun(run) + .setCliOptions(new CliOptions()) + .setRunOptions(run) .setCliParams(run.parsedParams(ConfigBuilder.getConfigVars(baseDir, null))) .buildGivenFiles(file) } @@ -59,8 +59,8 @@ class ConfigBuilderTest extends Specification { ConfigObject configWithParams(Map config, Map runOpts, Map cliOpts=[:]) { def run = new CmdRun(runOpts) return new ConfigBuilder(config) - .setOptions(new CliOptions(cliOpts)) - .setCmdRun(run) + .setCliOptions(new CliOptions(cliOpts)) + .setRunOptions(run) .setCliParams(run.parsedParams(ConfigBuilder.getConfigVars(null, null))) .build() } @@ -606,7 +606,7 @@ class ConfigBuilderTest extends Specification { when: def opt = new CliOptions() def run = new CmdRun(executorOptions: [ alpha: 1, 'beta.x': 'hola', 'beta.y': 'ciao' ]) - def result = new ConfigBuilder().setOptions(opt).setCmdRun(run).buildGivenFiles() + def result = new ConfigBuilder().setCliOptions(opt).setRunOptions(run).buildGivenFiles() then: result.executor.alpha == 1 result.executor.beta.x == 'hola' @@ -619,7 +619,7 @@ class ConfigBuilderTest extends Specification { when: def opt = new CliOptions() def run = new CmdRun(clusterOptions: [ alpha: 1, 'beta.x': 'hola', 'beta.y': 'ciao' ]) - def result = new ConfigBuilder().setOptions(opt).setCmdRun(run).buildGivenFiles() + def result = new ConfigBuilder().setCliOptions(opt).setRunOptions(run).buildGivenFiles() then: result.cluster.alpha == 1 result.cluster.beta.x == 'hola' @@ -632,7 +632,7 @@ class ConfigBuilderTest extends Specification { when: def opt = new CliOptions() def run = new CmdRun(withDocker: 'cbcrg/piper') - def config = new ConfigBuilder().setOptions(opt).setCmdRun(run).build() + def config = new ConfigBuilder().setCliOptions(opt).setRunOptions(run).build() then: config.docker.enabled @@ -656,7 +656,7 @@ class ConfigBuilderTest extends Specification { when: def opt = new CliOptions(config: [file.toFile().canonicalPath] ) def run = new CmdRun(withDocker: '-') - def config = new ConfigBuilder().setOptions(opt).setCmdRun(run).build() + def config = new ConfigBuilder().setCliOptions(opt).setRunOptions(run).build() then: config.docker.enabled config.docker.image == 'busybox' @@ -665,7 +665,7 @@ class ConfigBuilderTest extends Specification { when: opt = new CliOptions(config: [file.toFile().canonicalPath] ) run = new CmdRun(withDocker: 'cbcrg/mybox') - config = new ConfigBuilder().setOptions(opt).setCmdRun(run).build() + config = new ConfigBuilder().setCliOptions(opt).setRunOptions(run).build() then: config.docker.enabled config.process.container == 'cbcrg/mybox' @@ -684,7 +684,7 @@ class ConfigBuilderTest extends Specification { ''' def opt = new CliOptions(config: [file.toFile().canonicalPath]) def run = new CmdRun(withDocker: '-') - def config = new ConfigBuilder().setOptions(opt).setCmdRun(run).build() + def config = new ConfigBuilder().setCliOptions(opt).setRunOptions(run).build() then: config.docker.enabled config.process.'withName:test'.container == 'busybox' @@ -696,7 +696,7 @@ class ConfigBuilderTest extends Specification { ''' opt = new CliOptions(config: [file.toFile().canonicalPath]) run = new CmdRun(withDocker: '-') - config = new ConfigBuilder().setOptions(opt).setCmdRun(run).build() + config = new ConfigBuilder().setCliOptions(opt).setRunOptions(run).build() then: config.docker.enabled config.process.container == 'busybox' @@ -704,7 +704,7 @@ class ConfigBuilderTest extends Specification { when: opt = new CliOptions() run = new CmdRun(withDocker: '-') - new ConfigBuilder().setOptions(opt).setCmdRun(run).build() + new ConfigBuilder().setCliOptions(opt).setRunOptions(run).build() then: def e = thrown(AbortOperationException) e.message == 'You have requested to run with Docker but no image was specified' @@ -716,7 +716,7 @@ class ConfigBuilderTest extends Specification { ''' opt = new CliOptions(config: [file.toFile().canonicalPath]) run = new CmdRun(withDocker: '-') - new ConfigBuilder().setOptions(opt).setCmdRun(run).build() + new ConfigBuilder().setCliOptions(opt).setRunOptions(run).build() then: e = thrown(AbortOperationException) e.message == 'You have requested to run with Docker but no image was specified' @@ -739,7 +739,7 @@ class ConfigBuilderTest extends Specification { when: def opt = new CliOptions(config: [file.toFile().canonicalPath] ) def run = new CmdRun(withoutDocker: true) - def config = new ConfigBuilder().setOptions(opt).setCmdRun(run).build() + def config = new ConfigBuilder().setCliOptions(opt).setRunOptions(run).build() then: !config.docker.enabled config.docker.image == 'busybox' @@ -754,8 +754,8 @@ class ConfigBuilderTest extends Specification { def cmd = new CmdNode(clusterOptions: [join: 'x', group: 'y', interface: 'abc', slots: 10, 'tcp.alpha':'uno', 'tcp.beta': 'due']) def config = new ConfigBuilder() - .setOptions(opt) - .setCmdNode(cmd) + .setCliOptions(opt) + .setNodeOptions(cmd) .build() then: @@ -1310,7 +1310,7 @@ class ConfigBuilderTest extends Specification { when: def opt = new CliOptions(config: [file.toFile().canonicalPath] ) def run = new CmdRun(withoutConda: true) - def config = new ConfigBuilder().setOptions(opt).setCmdRun(run).build() + def config = new ConfigBuilder().setCliOptions(opt).setRunOptions(run).build() then: !config.conda.enabled !config.process.conda @@ -1378,7 +1378,7 @@ class ConfigBuilderTest extends Specification { when: def opt = new CliOptions(config: [file.toFile().canonicalPath] ) def run = new CmdRun(withoutSpack: true) - def config = new ConfigBuilder().setOptions(opt).setCmdRun(run).build() + def config = new ConfigBuilder().setCliOptions(opt).setRunOptions(run).build() then: !config.spack.enabled !config.process.spack @@ -1549,45 +1549,24 @@ class ConfigBuilderTest extends Specification { def builder when: - builder = new ConfigBuilder().setCmdRun(new CmdRun(profile: 'foo')) + builder = new ConfigBuilder().setRunOptions(new CmdRun(profile: 'foo')) then: builder.profile == 'foo' builder.validateProfile when: - builder = new ConfigBuilder().setCmdRun(new CmdRun()) + builder = new ConfigBuilder().setRunOptions(new CmdRun()) then: builder.profile == 'standard' !builder.validateProfile when: - builder = new ConfigBuilder().setCmdRun(new CmdRun(profile: 'standard')) + builder = new ConfigBuilder().setRunOptions(new CmdRun(profile: 'standard')) then: builder.profile == 'standard' builder.validateProfile } - def 'should set config options' () { - def builder - - when: - builder = new ConfigBuilder().setCmdConfig(new CmdConfig()) - then: - !builder.showAllProfiles - - when: - builder = new ConfigBuilder().setCmdConfig(new CmdConfig(showAllProfiles: true)) - then: - builder.showAllProfiles - - when: - builder = new ConfigBuilder().setCmdConfig(new CmdConfig(profile: 'foo')) - then: - builder.profile == 'foo' - builder.validateProfile - - } - def 'should set params into config object' () { given: @@ -1681,7 +1660,7 @@ class ConfigBuilderTest extends Specification { def 'should run with conda' () { when: - def config = new ConfigBuilder().setCmdRun(new CmdRun(withConda: '/some/path/env.yml')).build() + def config = new ConfigBuilder().setRunOptions(new CmdRun(withConda: '/some/path/env.yml')).build() then: config.process.conda == '/some/path/env.yml' @@ -1690,7 +1669,7 @@ class ConfigBuilderTest extends Specification { def 'should run with spack' () { when: - def config = new ConfigBuilder().setCmdRun(new CmdRun(withSpack: '/some/path/env.yaml')).build() + def config = new ConfigBuilder().setRunOptions(new CmdRun(withSpack: '/some/path/env.yaml')).build() then: config.process.spack == '/some/path/env.yaml' @@ -1710,7 +1689,7 @@ class ConfigBuilderTest extends Specification { when: SysEnv.push(HOME: '/home/user') def opt = new CliOptions(config: [file.toFile().canonicalPath] ) - def cfg = new ConfigBuilder().setOptions(opt).build() + def cfg = new ConfigBuilder().setCliOptions(opt).build() SysEnv.pop() then: cfg.params.foo == '/home/user' @@ -1721,7 +1700,7 @@ class ConfigBuilderTest extends Specification { params.foo = bar ''' opt = new CliOptions(config: [file.toFile().canonicalPath] ) - new ConfigBuilder().setOptions(opt).build() + new ConfigBuilder().setCliOptions(opt).build() then: def e = thrown(ConfigParseException) e.message == "Unknown config attribute `bar` -- check config file: ${file.toRealPath()}".toString() @@ -1741,7 +1720,7 @@ class ConfigBuilderTest extends Specification { when: def opt = new CliOptions(config: [file.toFile().canonicalPath] ) def builder = new ConfigBuilder() - .setOptions(opt) + .setCliOptions(opt) .showMissingVariables(true) def cfg = builder.buildConfigObject() def str = ConfigHelper.toCanonicalString(cfg) @@ -1769,7 +1748,7 @@ class ConfigBuilderTest extends Specification { params.x = foo.bar ''' def opt = new CliOptions(config: [file.toFile().canonicalPath] ) - new ConfigBuilder().setOptions(opt).build() + new ConfigBuilder().setCliOptions(opt).build() then: def e = thrown(ConfigParseException) e.message == "Unknown config attribute `foo.bar` -- check config file: ${file.toRealPath()}".toString() @@ -1809,23 +1788,23 @@ class ConfigBuilderTest extends Specification { Map config when: - config = new ConfigBuilder().setCmdRun(new CmdRun()).build() + config = new ConfigBuilder().setRunOptions(new CmdRun()).build() then: !config.notification when: - config = new ConfigBuilder().setCmdRun(new CmdRun(withNotification: true)).build() + config = new ConfigBuilder().setRunOptions(new CmdRun(withNotification: true)).build() then: config.notification.enabled == true when: - config = new ConfigBuilder().setCmdRun(new CmdRun(withNotification: false)).build() + config = new ConfigBuilder().setRunOptions(new CmdRun(withNotification: false)).build() then: config.notification.enabled == false config.notification.to == null when: - config = new ConfigBuilder().setCmdRun(new CmdRun(withNotification: 'yo@nextflow.com')).build() + config = new ConfigBuilder().setRunOptions(new CmdRun(withNotification: 'yo@nextflow.com')).build() then: config.notification.enabled == true config.notification.to == 'yo@nextflow.com' @@ -1837,22 +1816,22 @@ class ConfigBuilderTest extends Specification { Map config when: - config = new ConfigBuilder().setCmdRun(new CmdRun()).build() + config = new ConfigBuilder().setRunOptions(new CmdRun()).build() then: !config.fusion when: - config = new ConfigBuilder().setCmdRun(new CmdRun(withFusion: true)).build() + config = new ConfigBuilder().setRunOptions(new CmdRun(withFusion: true)).build() then: config.fusion.enabled == true when: - config = new ConfigBuilder().setCmdRun(new CmdRun(withFusion: false)).build() + config = new ConfigBuilder().setRunOptions(new CmdRun(withFusion: false)).build() then: config.fusion == [enabled: false] when: - config = new ConfigBuilder().setCmdRun(new CmdRun(withFusion: true)).build() + config = new ConfigBuilder().setRunOptions(new CmdRun(withFusion: true)).build() then: config.fusion == [enabled: true] } @@ -1862,12 +1841,12 @@ class ConfigBuilderTest extends Specification { Map config when: - config = new ConfigBuilder().setCmdRun(new CmdRun()).build() + config = new ConfigBuilder().setRunOptions(new CmdRun()).build() then: !config.stubRun when: - config = new ConfigBuilder().setCmdRun(new CmdRun(stubRun: true)).build() + config = new ConfigBuilder().setRunOptions(new CmdRun(stubRun: true)).build() then: config.stubRun == true } @@ -1877,12 +1856,12 @@ class ConfigBuilderTest extends Specification { Map config when: - config = new ConfigBuilder().setCmdRun(new CmdRun()).build() + config = new ConfigBuilder().setRunOptions(new CmdRun()).build() then: !config.preview when: - config = new ConfigBuilder().setCmdRun(new CmdRun(preview: true)).build() + config = new ConfigBuilder().setRunOptions(new CmdRun(preview: true)).build() then: config.preview == true } @@ -2329,7 +2308,7 @@ class ConfigBuilderTest extends Specification { when: def cfg1 = new ConfigBuilder() - .setOptions( new CliOptions(userConfig: [config.toString()])) + .setCliOptions( new CliOptions(userConfig: [config.toString()])) .build() then: cfg1.params.test.foo == "foo_def" @@ -2588,7 +2567,7 @@ class ConfigBuilderTest extends Specification { when: def opt = new CliOptions() - def config = new ConfigBuilder().setBaseDir(folder).setOptions(opt).buildGivenFiles(configMain) + def config = new ConfigBuilder().setBaseDir(folder).setCliOptions(opt).buildGivenFiles(configMain) then: config.p1 == 'one' config.p2 == 'two' @@ -2645,7 +2624,7 @@ class ConfigBuilderTest extends Specification { when: def opt = new CliOptions() - def config = new ConfigBuilder().setBaseDir(folder).setOptions(opt).buildGivenFiles(configMain) + def config = new ConfigBuilder().setBaseDir(folder).setCliOptions(opt).buildGivenFiles(configMain) then: config.p1 == 'one' config.p2 == 'two' @@ -2727,7 +2706,7 @@ class ConfigBuilderTest extends Specification { def opt = new CliOptions() def config = new ConfigBuilder() .setBaseDir(folder) - .setOptions(opt) + .setCliOptions(opt) .setStripSecrets(true) .buildGivenFiles(configMain) then: diff --git a/modules/nextflow/src/test/groovy/nextflow/config/ConfigMapTest.groovy b/modules/nf-config/src/test/nextflow/config/ConfigMapTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/config/ConfigMapTest.groovy rename to modules/nf-config/src/test/nextflow/config/ConfigMapTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/config/ConfigValidatorTest.groovy b/modules/nf-config/src/test/nextflow/config/ConfigValidatorTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/config/ConfigValidatorTest.groovy rename to modules/nf-config/src/test/nextflow/config/ConfigValidatorTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/config/ManifestTest.groovy b/modules/nf-config/src/test/nextflow/config/ManifestTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/config/ManifestTest.groovy rename to modules/nf-config/src/test/nextflow/config/ManifestTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/config/parser/v1/ConfigParserV1Test.groovy b/modules/nf-config/src/test/nextflow/config/parser/v1/ConfigParserV1Test.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/config/parser/v1/ConfigParserV1Test.groovy rename to modules/nf-config/src/test/nextflow/config/parser/v1/ConfigParserV1Test.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/config/parser/v2/ConfigParserV2Test.groovy b/modules/nf-config/src/test/nextflow/config/parser/v2/ConfigParserV2Test.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/config/parser/v2/ConfigParserV2Test.groovy rename to modules/nf-config/src/test/nextflow/config/parser/v2/ConfigParserV2Test.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/util/ConfigHelperTest.groovy b/modules/nf-config/src/test/nextflow/util/ConfigHelperTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/util/ConfigHelperTest.groovy rename to modules/nf-config/src/test/nextflow/util/ConfigHelperTest.groovy diff --git a/modules/nf-scm/build.gradle b/modules/nf-scm/build.gradle new file mode 100644 index 0000000000..e8b901104e --- /dev/null +++ b/modules/nf-scm/build.gradle @@ -0,0 +1,42 @@ +/* + * Copyright 2013-2024, 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. + */ + + +apply plugin: 'groovy' + +sourceSets { + main.java.srcDirs = [] + main.groovy.srcDirs = ['src/main'] + main.resources.srcDirs = ['src/resources'] + test.groovy.srcDirs = ['src/test'] + test.java.srcDirs = [] + test.resources.srcDirs = [] +} + + +dependencies { + api project(':nf-commons') + api project(':nf-config') + api "org.apache.groovy:groovy:4.0.29" + api "org.apache.groovy:groovy-nio:4.0.29" + api "org.apache.groovy:groovy-json:4.0.29" + api('org.eclipse.jgit:org.eclipse.jgit:7.1.1.202505221757-r') + + /* testImplementation inherited from top gradle build file */ + testImplementation "org.apache.groovy:groovy-json:4.0.29" + testImplementation(testFixtures(project(":nextflow"))) +} + diff --git a/modules/nextflow/src/main/groovy/nextflow/exception/AmbiguousPipelineNameException.groovy b/modules/nf-scm/src/main/nextflow/exception/AmbiguousPipelineNameException.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/exception/AmbiguousPipelineNameException.groovy rename to modules/nf-scm/src/main/nextflow/exception/AmbiguousPipelineNameException.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/scm/AbstractRepositoryStrategy.groovy b/modules/nf-scm/src/main/nextflow/scm/AbstractRepositoryStrategy.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/scm/AbstractRepositoryStrategy.groovy rename to modules/nf-scm/src/main/nextflow/scm/AbstractRepositoryStrategy.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/scm/AssetManager.groovy b/modules/nf-scm/src/main/nextflow/scm/AssetManager.groovy similarity index 98% rename from modules/nextflow/src/main/groovy/nextflow/scm/AssetManager.groovy rename to modules/nf-scm/src/main/nextflow/scm/AssetManager.groovy index 166ac84d4c..1ec2f407d6 100644 --- a/modules/nextflow/src/main/groovy/nextflow/scm/AssetManager.groovy +++ b/modules/nf-scm/src/main/nextflow/scm/AssetManager.groovy @@ -28,7 +28,6 @@ import groovy.transform.PackageScope import groovy.transform.ToString import groovy.transform.TupleConstructor import groovy.util.logging.Slf4j -import nextflow.cli.HubOptions import nextflow.config.Manifest import nextflow.config.ConfigParserFactory import nextflow.exception.AbortOperationException @@ -49,10 +48,6 @@ import org.eclipse.jgit.merge.MergeStrategy * - {@Link MultiRevisionRepositoryStrategy}: This approach allows multiple revisions to coexist efficiently by sharing objects * through a bare repository and creating lightweight clones for each commit. * - * A {@link AssetManager.RepositoryStatus} is defined according to the status of the project folder (`localRootPath`). - * It is used to automatically select the {@link RepositoryStrategy}. The {@link LegacyRepositoryStrategy} will be selected for LEGACY_ONLY status, - * and the @Link MultiRevisionRepositoryStrategy} for other statuses (UNINNITIALIZED, BARE_ONLY and HYBRID) - * * @author Paolo Di Tommaso */ diff --git a/modules/nextflow/src/main/groovy/nextflow/scm/AzureRepositoryProvider.groovy b/modules/nf-scm/src/main/nextflow/scm/AzureRepositoryProvider.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/scm/AzureRepositoryProvider.groovy rename to modules/nf-scm/src/main/nextflow/scm/AzureRepositoryProvider.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/scm/BitbucketRepositoryProvider.groovy b/modules/nf-scm/src/main/nextflow/scm/BitbucketRepositoryProvider.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/scm/BitbucketRepositoryProvider.groovy rename to modules/nf-scm/src/main/nextflow/scm/BitbucketRepositoryProvider.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/scm/BitbucketServerRepositoryProvider.groovy b/modules/nf-scm/src/main/nextflow/scm/BitbucketServerRepositoryProvider.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/scm/BitbucketServerRepositoryProvider.groovy rename to modules/nf-scm/src/main/nextflow/scm/BitbucketServerRepositoryProvider.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/scm/GitReferenceHelper.groovy b/modules/nf-scm/src/main/nextflow/scm/GitReferenceHelper.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/scm/GitReferenceHelper.groovy rename to modules/nf-scm/src/main/nextflow/scm/GitReferenceHelper.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/scm/GitUrl.groovy b/modules/nf-scm/src/main/nextflow/scm/GitUrl.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/scm/GitUrl.groovy rename to modules/nf-scm/src/main/nextflow/scm/GitUrl.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/scm/GiteaRepositoryProvider.groovy b/modules/nf-scm/src/main/nextflow/scm/GiteaRepositoryProvider.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/scm/GiteaRepositoryProvider.groovy rename to modules/nf-scm/src/main/nextflow/scm/GiteaRepositoryProvider.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/scm/GithubRepositoryProvider.groovy b/modules/nf-scm/src/main/nextflow/scm/GithubRepositoryProvider.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/scm/GithubRepositoryProvider.groovy rename to modules/nf-scm/src/main/nextflow/scm/GithubRepositoryProvider.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/scm/GitlabRepositoryProvider.groovy b/modules/nf-scm/src/main/nextflow/scm/GitlabRepositoryProvider.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/scm/GitlabRepositoryProvider.groovy rename to modules/nf-scm/src/main/nextflow/scm/GitlabRepositoryProvider.groovy diff --git a/modules/nf-scm/src/main/nextflow/scm/HubOptions.groovy b/modules/nf-scm/src/main/nextflow/scm/HubOptions.groovy new file mode 100644 index 0000000000..4ad6ae978f --- /dev/null +++ b/modules/nf-scm/src/main/nextflow/scm/HubOptions.groovy @@ -0,0 +1,29 @@ +/* + * Copyright 2013-2026, 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. + */ + +package nextflow.scm + +/** + * Interface to manage the required data to interact with a pipeline service hub i.e. GitHub or BitBucket + * + * @author Jorge Ejarque + */ +interface HubOptions { + String getHubProvider() + String getHubPassword() + String getHubUser() + void setHubProvider(String hubProvider) +} \ No newline at end of file diff --git a/modules/nextflow/src/main/groovy/nextflow/scm/LegacyRepositoryStrategy.groovy b/modules/nf-scm/src/main/nextflow/scm/LegacyRepositoryStrategy.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/scm/LegacyRepositoryStrategy.groovy rename to modules/nf-scm/src/main/nextflow/scm/LegacyRepositoryStrategy.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/scm/LocalRepositoryProvider.groovy b/modules/nf-scm/src/main/nextflow/scm/LocalRepositoryProvider.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/scm/LocalRepositoryProvider.groovy rename to modules/nf-scm/src/main/nextflow/scm/LocalRepositoryProvider.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/scm/MultiRevisionRepositoryStrategy.groovy b/modules/nf-scm/src/main/nextflow/scm/MultiRevisionRepositoryStrategy.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/scm/MultiRevisionRepositoryStrategy.groovy rename to modules/nf-scm/src/main/nextflow/scm/MultiRevisionRepositoryStrategy.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/scm/ProviderConfig.groovy b/modules/nf-scm/src/main/nextflow/scm/ProviderConfig.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/scm/ProviderConfig.groovy rename to modules/nf-scm/src/main/nextflow/scm/ProviderConfig.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/scm/ProviderPath.groovy b/modules/nf-scm/src/main/nextflow/scm/ProviderPath.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/scm/ProviderPath.groovy rename to modules/nf-scm/src/main/nextflow/scm/ProviderPath.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/scm/RepositoryFactory.groovy b/modules/nf-scm/src/main/nextflow/scm/RepositoryFactory.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/scm/RepositoryFactory.groovy rename to modules/nf-scm/src/main/nextflow/scm/RepositoryFactory.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/scm/RepositoryProvider.groovy b/modules/nf-scm/src/main/nextflow/scm/RepositoryProvider.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/scm/RepositoryProvider.groovy rename to modules/nf-scm/src/main/nextflow/scm/RepositoryProvider.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/scm/RepositoryStrategy.groovy b/modules/nf-scm/src/main/nextflow/scm/RepositoryStrategy.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/scm/RepositoryStrategy.groovy rename to modules/nf-scm/src/main/nextflow/scm/RepositoryStrategy.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/script/ScriptFile.groovy b/modules/nf-scm/src/main/nextflow/script/ScriptFile.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/script/ScriptFile.groovy rename to modules/nf-scm/src/main/nextflow/script/ScriptFile.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/scm/AssetManagerTest.groovy b/modules/nf-scm/src/test/nextflow/scm/AssetManagerTest.groovy similarity index 88% rename from modules/nextflow/src/test/groovy/nextflow/scm/AssetManagerTest.groovy rename to modules/nf-scm/src/test/nextflow/scm/AssetManagerTest.groovy index 19ec66aed4..f611f91d42 100644 --- a/modules/nextflow/src/test/groovy/nextflow/scm/AssetManagerTest.groovy +++ b/modules/nf-scm/src/test/nextflow/scm/AssetManagerTest.groovy @@ -96,8 +96,8 @@ class AssetManagerTest extends Specification { folder.resolve('cbcrg/pipe1').mkdirs() folder.resolve('cbcrg/pipe2').mkdirs() folder.resolve('ncbi/blast').mkdirs() - folder.resolve(REPOS_SUBDIR +'/ncbi/blast').mkdirs() - folder.resolve(REPOS_SUBDIR +'/new/repo').mkdirs() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR +'/ncbi/blast').mkdirs() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR +'/new/repo').mkdirs() when: def list = AssetManager.list() @@ -198,9 +198,9 @@ class AssetManagerTest extends Specification { when: manager.download("v1.2") then: - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/1b420d060d3fad67027154ac48e3bdea06f058da/.git').isDirectory() - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + BARE_REPO).isDirectory() - manager.getLocalPath().toString() == folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/1b420d060d3fad67027154ac48e3bdea06f058da').toString() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/1b420d060d3fad67027154ac48e3bdea06f058da/.git').isDirectory() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.BARE_REPO).isDirectory() + manager.getLocalPath().toString() == folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/1b420d060d3fad67027154ac48e3bdea06f058da').toString() when: manager.download("v1.2") then: @@ -242,9 +242,9 @@ class AssetManagerTest extends Specification { when: manager.download("6b9515aba6c7efc6a9b3f273ce116fc0c224bf68") then: - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/6b9515aba6c7efc6a9b3f273ce116fc0c224bf68/.git').isDirectory() - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + BARE_REPO).isDirectory() - manager.getLocalPath().toString() == folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/6b9515aba6c7efc6a9b3f273ce116fc0c224bf68').toString() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/6b9515aba6c7efc6a9b3f273ce116fc0c224bf68/.git').isDirectory() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.BARE_REPO).isDirectory() + manager.getLocalPath().toString() == folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/6b9515aba6c7efc6a9b3f273ce116fc0c224bf68').toString() when: def result = manager.download("6b9515aba6c7efc6a9b3f273ce116fc0c224bf68") @@ -309,9 +309,9 @@ class AssetManagerTest extends Specification { when: manager.download("mybranch") then: - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + BARE_REPO).isDirectory() - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/1c3e9e7404127514d69369cd87f8036830f5cf64/.git').isDirectory() - manager.getLocalPath().toString() == folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/1c3e9e7404127514d69369cd87f8036830f5cf64').toString() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.BARE_REPO).isDirectory() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/1c3e9e7404127514d69369cd87f8036830f5cf64/.git').isDirectory() + manager.getLocalPath().toString() == folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/1c3e9e7404127514d69369cd87f8036830f5cf64').toString() when: manager.download("mybranch") then: @@ -331,7 +331,7 @@ class AssetManagerTest extends Specification { when: manager.download("master") then: - folder.resolve(REPOS_SUBDIR + '/pditommaso/nf-azure-repo/nf-azure-repo/' + BARE_REPO).isDirectory() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/pditommaso/nf-azure-repo/nf-azure-repo/' + MultiRevisionRepositoryStrategy.BARE_REPO).isDirectory() when: manager.download("master") then: @@ -374,16 +374,16 @@ class AssetManagerTest extends Specification { when: manager.download("v1.2") then: - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/1b420d060d3fad67027154ac48e3bdea06f058da/.git').isDirectory() - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + BARE_REPO).isDirectory() - manager.getLocalPath().toString() == folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/1b420d060d3fad67027154ac48e3bdea06f058da').toString() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/1b420d060d3fad67027154ac48e3bdea06f058da/.git').isDirectory() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.BARE_REPO).isDirectory() + manager.getLocalPath().toString() == folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/1b420d060d3fad67027154ac48e3bdea06f058da').toString() when: manager.download("mybranch") then: - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + BARE_REPO).isDirectory() - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/1c3e9e7404127514d69369cd87f8036830f5cf64/.git').isDirectory() - manager.getLocalPath().toString() == folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/1c3e9e7404127514d69369cd87f8036830f5cf64').toString() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.BARE_REPO).isDirectory() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/1c3e9e7404127514d69369cd87f8036830f5cf64/.git').isDirectory() + manager.getLocalPath().toString() == folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/1c3e9e7404127514d69369cd87f8036830f5cf64').toString() noExceptionThrown() } @@ -703,9 +703,9 @@ class AssetManagerTest extends Specification { when: manager.download("dev") then: - folder.resolve(REPOS_SUBDIR + '/nextflow-io/nf-test-branch/' + REVISION_SUBDIR + '/6f882561d589365c3950d170df8445e3c0dc8028/.git').isDirectory() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/nf-test-branch/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/6f882561d589365c3950d170df8445e3c0dc8028/.git').isDirectory() and: - folder.resolve(REPOS_SUBDIR + '/nextflow-io/nf-test-branch/' + REVISION_SUBDIR + '/6f882561d589365c3950d170df8445e3c0dc8028/workflow.nf').text == "println 'Hello'\n" + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/nf-test-branch/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/6f882561d589365c3950d170df8445e3c0dc8028/workflow.nf').text == "println 'Hello'\n" when: manager.download() @@ -760,9 +760,9 @@ class AssetManagerTest extends Specification { when: manager.download("v0.1") then: - folder.resolve(REPOS_SUBDIR + '/nextflow-io/nf-test-branch/' + REVISION_SUBDIR + '/6f882561d589365c3950d170df8445e3c0dc8028/.git').isDirectory() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/nf-test-branch/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/6f882561d589365c3950d170df8445e3c0dc8028/.git').isDirectory() and: - folder.resolve(REPOS_SUBDIR + '/nextflow-io/nf-test-branch/' + REVISION_SUBDIR + '/6f882561d589365c3950d170df8445e3c0dc8028/workflow.nf').text == "println 'Hello'\n" + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/nf-test-branch/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/6f882561d589365c3950d170df8445e3c0dc8028/workflow.nf').text == "println 'Hello'\n" when: manager.download() @@ -873,7 +873,7 @@ class AssetManagerTest extends Specification { def 'should select multi-revision strategy when bare repository exists'() { given: def folder = tempDir.getRoot() - def barePath = folder.resolve(REPOS_SUBDIR + '/test-org/test-repo/' + BARE_REPO) + def barePath = folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/test-org/test-repo/' + MultiRevisionRepositoryStrategy.BARE_REPO) barePath.mkdirs() // Create a proper bare git repository @@ -903,7 +903,7 @@ class AssetManagerTest extends Specification { legacyPath.resolve('.git/config').text = GIT_CONFIG_TEXT // Create bare repository - def barePath = folder.resolve(REPOS_SUBDIR + '/test-org/test-repo/' + BARE_REPO) + def barePath = folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/test-org/test-repo/' + MultiRevisionRepositoryStrategy.BARE_REPO) barePath.mkdirs() def initBare = Git.init() initBare.setDirectory(barePath.toFile()) @@ -995,7 +995,7 @@ class AssetManagerTest extends Specification { manager.isOnlyLegacy() when: 'only bare exists' - def barePath3 = folder.resolve(REPOS_SUBDIR + '/test-org/repo3/' + BARE_REPO) + def barePath3 = folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/test-org/repo3/' + MultiRevisionRepositoryStrategy.BARE_REPO) barePath3.mkdirs() def initBare3 = Git.init() initBare3.setDirectory(barePath3.toFile()) @@ -1014,7 +1014,7 @@ class AssetManagerTest extends Specification { legacyPath4.mkdirs() legacyPath4.resolve('.git').mkdir() legacyPath4.resolve('.git/config').text = GIT_CONFIG_TEXT - def barePath4 = folder.resolve(REPOS_SUBDIR + '/test-org/repo4/' + BARE_REPO) + def barePath4 = folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/test-org/repo4/' + MultiRevisionRepositoryStrategy.BARE_REPO) barePath4.mkdirs() def initBare4 = Git.init() initBare4.setDirectory(barePath4.toFile()) @@ -1050,8 +1050,8 @@ class AssetManagerTest extends Specification { manager.download(revision2) and: 'verify both revisions exist' - def commit1Path = folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/1b420d060d3fad67027154ac48e3bdea06f058da') - def commit2Path = folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/1c3e9e7404127514d69369cd87f8036830f5cf64') + def commit1Path = folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/1b420d060d3fad67027154ac48e3bdea06f058da') + def commit2Path = folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/1c3e9e7404127514d69369cd87f8036830f5cf64') commit1Path.exists() commit2Path.exists() @@ -1061,7 +1061,7 @@ class AssetManagerTest extends Specification { then: 'first revision is deleted but second remains' !commit1Path.exists() commit2Path.exists() - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + BARE_REPO).exists() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.BARE_REPO).exists() } @Requires({System.getenv('NXF_GITHUB_ACCESS_TOKEN')}) @@ -1080,10 +1080,10 @@ class AssetManagerTest extends Specification { manager.download(revision2) and: 'verify both revisions and bare repo exist' - def projectPath = folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello') - def commit1Path = projectPath.resolve(REVISION_SUBDIR + '/1b420d060d3fad67027154ac48e3bdea06f058da') - def commit2Path = projectPath.resolve(REVISION_SUBDIR + '/1c3e9e7404127514d69369cd87f8036830f5cf64') - def barePath = projectPath.resolve(BARE_REPO) + def projectPath = folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello') + def commit1Path = projectPath.resolve(MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/1b420d060d3fad67027154ac48e3bdea06f058da') + def commit2Path = projectPath.resolve(MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/1c3e9e7404127514d69369cd87f8036830f5cf64') + def barePath = projectPath.resolve(MultiRevisionRepositoryStrategy.BARE_REPO) commit1Path.exists() commit2Path.exists() barePath.exists() @@ -1112,7 +1112,7 @@ class AssetManagerTest extends Specification { manager.download(revision) and: 'make local changes' - def commitPath = folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/1b420d060d3fad67027154ac48e3bdea06f058da') + def commitPath = folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/1b420d060d3fad67027154ac48e3bdea06f058da') commitPath.resolve('test-file.txt').text = 'uncommitted change' when: 'try to drop without force' diff --git a/modules/nextflow/src/test/groovy/nextflow/scm/AzureRepositoryProviderTest.groovy b/modules/nf-scm/src/test/nextflow/scm/AzureRepositoryProviderTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/scm/AzureRepositoryProviderTest.groovy rename to modules/nf-scm/src/test/nextflow/scm/AzureRepositoryProviderTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/scm/BitbucketRepositoryProviderTest.groovy b/modules/nf-scm/src/test/nextflow/scm/BitbucketRepositoryProviderTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/scm/BitbucketRepositoryProviderTest.groovy rename to modules/nf-scm/src/test/nextflow/scm/BitbucketRepositoryProviderTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/scm/BitbucketServerRepositoryProviderTest.groovy b/modules/nf-scm/src/test/nextflow/scm/BitbucketServerRepositoryProviderTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/scm/BitbucketServerRepositoryProviderTest.groovy rename to modules/nf-scm/src/test/nextflow/scm/BitbucketServerRepositoryProviderTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/scm/GitReferenceHelperTest.groovy b/modules/nf-scm/src/test/nextflow/scm/GitReferenceHelperTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/scm/GitReferenceHelperTest.groovy rename to modules/nf-scm/src/test/nextflow/scm/GitReferenceHelperTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/scm/GitUrlTest.groovy b/modules/nf-scm/src/test/nextflow/scm/GitUrlTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/scm/GitUrlTest.groovy rename to modules/nf-scm/src/test/nextflow/scm/GitUrlTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/scm/GiteaRepositoryProviderTest.groovy b/modules/nf-scm/src/test/nextflow/scm/GiteaRepositoryProviderTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/scm/GiteaRepositoryProviderTest.groovy rename to modules/nf-scm/src/test/nextflow/scm/GiteaRepositoryProviderTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/scm/GithubRepositoryProviderTest.groovy b/modules/nf-scm/src/test/nextflow/scm/GithubRepositoryProviderTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/scm/GithubRepositoryProviderTest.groovy rename to modules/nf-scm/src/test/nextflow/scm/GithubRepositoryProviderTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/scm/GitlabRepositoryProviderTest.groovy b/modules/nf-scm/src/test/nextflow/scm/GitlabRepositoryProviderTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/scm/GitlabRepositoryProviderTest.groovy rename to modules/nf-scm/src/test/nextflow/scm/GitlabRepositoryProviderTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/scm/HubOptionsTest.groovy b/modules/nf-scm/src/test/nextflow/scm/HubOptionsTest.groovy similarity index 93% rename from modules/nextflow/src/test/groovy/nextflow/scm/HubOptionsTest.groovy rename to modules/nf-scm/src/test/nextflow/scm/HubOptionsTest.groovy index 0d9e38068c..33eefaffdc 100644 --- a/modules/nextflow/src/test/groovy/nextflow/scm/HubOptionsTest.groovy +++ b/modules/nf-scm/src/test/nextflow/scm/HubOptionsTest.groovy @@ -16,7 +16,7 @@ package nextflow.scm -import nextflow.cli.HubOptions +import nextflow.cli.CliHubOptions import spock.lang.Specification /** @@ -28,7 +28,7 @@ class HubOptionsTest extends Specification { def testUser() { when: - def cmd = [:] as HubOptions + def cmd = [:] as CliHubOptions cmd.hubUser = credential then: cmd.getHubUser() == user diff --git a/modules/nextflow/src/test/groovy/nextflow/scm/LocalRepositoryProviderTest.groovy b/modules/nf-scm/src/test/nextflow/scm/LocalRepositoryProviderTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/scm/LocalRepositoryProviderTest.groovy rename to modules/nf-scm/src/test/nextflow/scm/LocalRepositoryProviderTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/scm/MultiRevisionRepositoryStrategyTest.groovy b/modules/nf-scm/src/test/nextflow/scm/MultiRevisionRepositoryStrategyTest.groovy similarity index 66% rename from modules/nextflow/src/test/groovy/nextflow/scm/MultiRevisionRepositoryStrategyTest.groovy rename to modules/nf-scm/src/test/nextflow/scm/MultiRevisionRepositoryStrategyTest.groovy index d5971ec4de..ca4c12baeb 100644 --- a/modules/nextflow/src/test/groovy/nextflow/scm/MultiRevisionRepositoryStrategyTest.groovy +++ b/modules/nf-scm/src/test/nextflow/scm/MultiRevisionRepositoryStrategyTest.groovy @@ -55,16 +55,16 @@ class MultiRevisionRepositoryStrategyTest extends Specification { when: def strategy = createStrategy('cbcrg/pipe1', null) - folder.resolve(REPOS_SUBDIR + '/cbcrg/pipe1/' + REVISION_SUBDIR + '/12345').mkdirs() - folder.resolve(REPOS_SUBDIR + '/cbcrg/pipe1/' + REVISION_SUBDIR + '/67890').mkdirs() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/cbcrg/pipe1/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/12345').mkdirs() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/cbcrg/pipe1/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/67890').mkdirs() def list = strategy.listDownloadedCommits() then: list.sort() == ['12345', '67890'] when: strategy = createStrategy('cbcrg/pipe2', null) - folder.resolve(REPOS_SUBDIR + '/cbcrg/pipe2/' + REVISION_SUBDIR + '/abcde').mkdirs() - folder.resolve(REPOS_SUBDIR + '/cbcrg/pipe2/' + REVISION_SUBDIR + '/fghij').mkdirs() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/cbcrg/pipe2/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/abcde').mkdirs() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/cbcrg/pipe2/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/fghij').mkdirs() list = strategy.listDownloadedCommits() then: list.sort() == ['abcde', 'fghij'] @@ -86,8 +86,8 @@ class MultiRevisionRepositoryStrategyTest extends Specification { when: strategy.checkBareRepo(manifest) then: - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + BARE_REPO).isDirectory() - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + BARE_REPO + '/config').exists() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.BARE_REPO).isDirectory() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.BARE_REPO + '/config').exists() expect: strategy.revisionToCommitWithBareRepo('v1.2') == '1b420d060d3fad67027154ac48e3bdea06f058da' @@ -110,21 +110,21 @@ class MultiRevisionRepositoryStrategyTest extends Specification { when: strategy.download('7588c46ffefb4e3c06d4ab32c745c4d5e56cdad8', 1, manifest) then: - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/7588c46ffefb4e3c06d4ab32c745c4d5e56cdad8/.git').isDirectory() - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/7588c46ffefb4e3c06d4ab32c745c4d5e56cdad8/.git/objects/info/alternates').text == folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + BARE_REPO + '/objects').toAbsolutePath().toString() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/7588c46ffefb4e3c06d4ab32c745c4d5e56cdad8/.git').isDirectory() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/7588c46ffefb4e3c06d4ab32c745c4d5e56cdad8/.git/objects/info/alternates').text == folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.BARE_REPO + '/objects').toAbsolutePath().toString() when: // tag v1.2 -> commit 1b420d060d3fad67027154ac48e3bdea06f058da strategy.download('v1.2', 1, manifest) then: - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/1b420d060d3fad67027154ac48e3bdea06f058da/.git').isDirectory() - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/1b420d060d3fad67027154ac48e3bdea06f058da/.git/objects/info/alternates').text == folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + BARE_REPO + '/objects').toAbsolutePath().toString() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/1b420d060d3fad67027154ac48e3bdea06f058da/.git').isDirectory() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/1b420d060d3fad67027154ac48e3bdea06f058da/.git/objects/info/alternates').text == folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.BARE_REPO + '/objects').toAbsolutePath().toString() when: strategy.download('mybranch', 1, manifest) then: - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/1c3e9e7404127514d69369cd87f8036830f5cf64/.git').isDirectory() - folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + REVISION_SUBDIR + '/1c3e9e7404127514d69369cd87f8036830f5cf64/.git/objects/info/alternates').text == folder.resolve(REPOS_SUBDIR + '/nextflow-io/hello/' + BARE_REPO + '/objects').toAbsolutePath().toString() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/1c3e9e7404127514d69369cd87f8036830f5cf64/.git').isDirectory() + folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.REVISION_SUBDIR + '/1c3e9e7404127514d69369cd87f8036830f5cf64/.git/objects/info/alternates').text == folder.resolve(MultiRevisionRepositoryStrategy.REPOS_SUBDIR + '/nextflow-io/hello/' + MultiRevisionRepositoryStrategy.BARE_REPO + '/objects').toAbsolutePath().toString() } } diff --git a/modules/nextflow/src/test/groovy/nextflow/scm/ProviderConfigTest.groovy b/modules/nf-scm/src/test/nextflow/scm/ProviderConfigTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/scm/ProviderConfigTest.groovy rename to modules/nf-scm/src/test/nextflow/scm/ProviderConfigTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/scm/ProviderPathTest.groovy b/modules/nf-scm/src/test/nextflow/scm/ProviderPathTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/scm/ProviderPathTest.groovy rename to modules/nf-scm/src/test/nextflow/scm/ProviderPathTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/scm/RepositoryProviderTest.groovy b/modules/nf-scm/src/test/nextflow/scm/RepositoryProviderTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/scm/RepositoryProviderTest.groovy rename to modules/nf-scm/src/test/nextflow/scm/RepositoryProviderTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/scm/UpdateModuleTest.groovy b/modules/nf-scm/src/test/nextflow/scm/UpdateModuleTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/scm/UpdateModuleTest.groovy rename to modules/nf-scm/src/test/nextflow/scm/UpdateModuleTest.groovy diff --git a/modules/nf-secrets/build.gradle b/modules/nf-secrets/build.gradle new file mode 100644 index 0000000000..7ca4eeba49 --- /dev/null +++ b/modules/nf-secrets/build.gradle @@ -0,0 +1,39 @@ +/* + * Copyright 2013-2024, 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. + */ + + +apply plugin: 'groovy' + +sourceSets { + main.java.srcDirs = [] + main.groovy.srcDirs = ['src/main'] + main.resources.srcDirs = ['src/resources'] + test.groovy.srcDirs = ['src/test'] + test.java.srcDirs = [] + test.resources.srcDirs = [] +} + + +dependencies { + api project(':nf-commons') + api "org.apache.groovy:groovy:4.0.29" + api "org.apache.groovy:groovy-nio:4.0.29" + + /* testImplementation inherited from top gradle build file */ + testImplementation "org.apache.groovy:groovy-json:4.0.29" + testImplementation(testFixtures(project(":nextflow"))) +} + diff --git a/modules/nextflow/src/main/groovy/nextflow/secret/EmptySecretProvider.groovy b/modules/nf-secrets/src/main/nextflow/secret/EmptySecretProvider.groovy similarity index 99% rename from modules/nextflow/src/main/groovy/nextflow/secret/EmptySecretProvider.groovy rename to modules/nf-secrets/src/main/nextflow/secret/EmptySecretProvider.groovy index fd5bc98da4..10454e4d27 100644 --- a/modules/nextflow/src/main/groovy/nextflow/secret/EmptySecretProvider.groovy +++ b/modules/nf-secrets/src/main/nextflow/secret/EmptySecretProvider.groovy @@ -100,7 +100,7 @@ import groovy.transform.CompileStatic * * * @author Ben Sherman - * @see nextflow.cli.CmdRun#run() + * @see CmdRun#run() * @see nextflow.secret.SecretsLoader */ @CompileStatic diff --git a/modules/nextflow/src/main/groovy/nextflow/secret/LocalSecretsProvider.groovy b/modules/nf-secrets/src/main/nextflow/secret/LocalSecretsProvider.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/secret/LocalSecretsProvider.groovy rename to modules/nf-secrets/src/main/nextflow/secret/LocalSecretsProvider.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/secret/MissingSecretException.groovy b/modules/nf-secrets/src/main/nextflow/secret/MissingSecretException.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/secret/MissingSecretException.groovy rename to modules/nf-secrets/src/main/nextflow/secret/MissingSecretException.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/secret/NullProvider.groovy b/modules/nf-secrets/src/main/nextflow/secret/NullProvider.groovy similarity index 74% rename from modules/nextflow/src/main/groovy/nextflow/secret/NullProvider.groovy rename to modules/nf-secrets/src/main/nextflow/secret/NullProvider.groovy index dbd244f43d..d4dcd9d894 100644 --- a/modules/nextflow/src/main/groovy/nextflow/secret/NullProvider.groovy +++ b/modules/nf-secrets/src/main/nextflow/secret/NullProvider.groovy @@ -20,7 +20,6 @@ package nextflow.secret import groovy.transform.CompileStatic import groovy.transform.PackageScope import nextflow.exception.AbortOperationException -import org.eclipse.jgit.errors.NotSupportedException /** * A secret provider only used to report an error when secrets are disabled @@ -47,27 +46,27 @@ class NullProvider implements SecretsProvider { @Override void putSecret(String name, String value) { - throw new NotSupportedException("Operation 'putSecret' is not supported by ${this.class.name}") + throw new UnsupportedOperationException("Operation 'putSecret' is not supported by ${this.class.name}") } @Override void removeSecret(String name) { - throw new NotSupportedException("Operation 'removeSecret' is not supported by ${this.class.name}") + throw new UnsupportedOperationException("Operation 'removeSecret' is not supported by ${this.class.name}") } @Override Set listSecretsNames() { - throw new NotSupportedException("Operation 'listSecretsNames' is not supported by ${this.class.name}") + throw new UnsupportedOperationException("Operation 'listSecretsNames' is not supported by ${this.class.name}") } @Override String getSecretsEnv(List secretNames) { - throw new NotSupportedException("Operation 'getSecretsEnv' is not supported by ${this.class.name}") + throw new UnsupportedOperationException("Operation 'getSecretsEnv' is not supported by ${this.class.name}") } @Override String getSecretsEnv() { - throw new NotSupportedException("Operation 'getSecretsEnv' is not supported by ${this.class.name}") + throw new UnsupportedOperationException("Operation 'getSecretsEnv' is not supported by ${this.class.name}") } @Override diff --git a/modules/nextflow/src/main/groovy/nextflow/secret/Secret.groovy b/modules/nf-secrets/src/main/nextflow/secret/Secret.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/secret/Secret.groovy rename to modules/nf-secrets/src/main/nextflow/secret/Secret.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/secret/SecretImpl.groovy b/modules/nf-secrets/src/main/nextflow/secret/SecretImpl.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/secret/SecretImpl.groovy rename to modules/nf-secrets/src/main/nextflow/secret/SecretImpl.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/secret/SecretsHelper.groovy b/modules/nf-secrets/src/main/nextflow/secret/SecretsHelper.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/secret/SecretsHelper.groovy rename to modules/nf-secrets/src/main/nextflow/secret/SecretsHelper.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/secret/SecretsLoader.groovy b/modules/nf-secrets/src/main/nextflow/secret/SecretsLoader.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/secret/SecretsLoader.groovy rename to modules/nf-secrets/src/main/nextflow/secret/SecretsLoader.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/secret/SecretsProvider.groovy b/modules/nf-secrets/src/main/nextflow/secret/SecretsProvider.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/secret/SecretsProvider.groovy rename to modules/nf-secrets/src/main/nextflow/secret/SecretsProvider.groovy diff --git a/modules/nextflow/src/main/groovy/nextflow/util/SecretHelper.groovy b/modules/nf-secrets/src/main/nextflow/util/SecretHelper.groovy similarity index 100% rename from modules/nextflow/src/main/groovy/nextflow/util/SecretHelper.groovy rename to modules/nf-secrets/src/main/nextflow/util/SecretHelper.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/secret/DummySecretsProvider.groovy b/modules/nf-secrets/src/test/nextflow/secret/DummySecretsProvider.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/secret/DummySecretsProvider.groovy rename to modules/nf-secrets/src/test/nextflow/secret/DummySecretsProvider.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/secret/LocalSecretsProviderTest.groovy b/modules/nf-secrets/src/test/nextflow/secret/LocalSecretsProviderTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/secret/LocalSecretsProviderTest.groovy rename to modules/nf-secrets/src/test/nextflow/secret/LocalSecretsProviderTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/secret/SecretHelperTest.groovy b/modules/nf-secrets/src/test/nextflow/secret/SecretHelperTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/secret/SecretHelperTest.groovy rename to modules/nf-secrets/src/test/nextflow/secret/SecretHelperTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/secret/SecretsLoaderTest.groovy b/modules/nf-secrets/src/test/nextflow/secret/SecretsLoaderTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/secret/SecretsLoaderTest.groovy rename to modules/nf-secrets/src/test/nextflow/secret/SecretsLoaderTest.groovy diff --git a/modules/nextflow/src/test/groovy/nextflow/util/SecretHelperTest.groovy b/modules/nf-secrets/src/test/nextflow/util/SecretHelperTest.groovy similarity index 100% rename from modules/nextflow/src/test/groovy/nextflow/util/SecretHelperTest.groovy rename to modules/nf-secrets/src/test/nextflow/util/SecretHelperTest.groovy diff --git a/packing.gradle b/packing.gradle index dca30c9bfe..7bcd4b0f3b 100644 --- a/packing.gradle +++ b/packing.gradle @@ -16,6 +16,9 @@ dependencies { defaultCfg "org.apache.ivy:ivy:2.5.2" // default cfg = runtime + httpfs + lineage + amazon + tower client + wave client defaultCfg project(':nf-httpfs') + defaultCfg project(':nf-scm') + defaultCfg project(':nf-config') + defaultCfg project(':nf-secrets') defaultCfg project(':nf-lineage') console project(':plugins:nf-console') google project(':plugins:nf-google') diff --git a/plugins/nf-console/src/main/nextflow/ui/console/Nextflow.groovy b/plugins/nf-console/src/main/nextflow/ui/console/Nextflow.groovy index d153a61a04..b94d26aa42 100644 --- a/plugins/nf-console/src/main/nextflow/ui/console/Nextflow.groovy +++ b/plugins/nf-console/src/main/nextflow/ui/console/Nextflow.groovy @@ -83,9 +83,9 @@ class Nextflow extends Console { // create the config object return new ConfigBuilder() - .setOptions( new CliOptions() ) + .setCliOptions( new CliOptions() ) .setBaseDir(base) - .setCmdRun( new CmdRun() ) + .setRunOptions( new CmdRun() ) .build() } diff --git a/plugins/nf-k8s/src/main/nextflow/k8s/K8sDriverLauncher.groovy b/plugins/nf-k8s/src/main/nextflow/k8s/K8sDriverLauncher.groovy index d9a9f53048..85cc5b5469 100644 --- a/plugins/nf-k8s/src/main/nextflow/k8s/K8sDriverLauncher.groovy +++ b/plugins/nf-k8s/src/main/nextflow/k8s/K8sDriverLauncher.groovy @@ -265,9 +265,9 @@ class K8sDriverLauncher { // -- load local config if available final builder = new ConfigBuilder() .setShowClosures(true) - .setOptions(cmd.launcher.options) + .setCliOptions(cmd.launcher.options) .setProfile(cmd.profile) - .setCmdRun(cmd) + .setRunOptions(cmd) if( !interactive && !pipelineName.startsWith('/') && !cmd.remoteProfile && !cmd.runRemoteConfig ) { // -- check and parse project remote config diff --git a/settings.gradle b/settings.gradle index d8eb7aea65..1f63f6570b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -29,6 +29,9 @@ rootProject.name = 'nextflow-prj' include 'nextflow' include 'nf-commons' +include 'nf-scm' +include 'nf-config' +include 'nf-secrets' include 'nf-httpfs' include 'nf-lang' include 'nf-lineage'