Skip to content

Commit

Permalink
Remove module all components import
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <[email protected]>
  • Loading branch information
pditommaso committed Jul 29, 2023
1 parent a59af39 commit a6d08c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
16 changes: 6 additions & 10 deletions modules/nextflow/src/main/groovy/nextflow/script/ScriptMeta.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -327,16 +327,12 @@ class ScriptMeta {

void addModule(ScriptMeta script, String name, String alias) {
assert script
if( name ) {
// include a specific
def item = script.getComponent(name)
if( !item )
throw new MissingModuleComponentException(script, name)
addModule0(item, alias)
}
else for( def item : script.getDefinitions() ) {
addModule0(item)
}
assert name
// include a specific
def item = script.getComponent(name)
if( !item )
throw new MissingModuleComponentException(script, name)
addModule0(item, alias)
}

protected void addModule0(ComponentDef component, String alias=null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ class ScriptMetaTest extends Dsl2Spec {
meta3.addDefinition(proc3, func3, work3)

when:
meta1.addModule(meta2, null, null)
meta1.addModule(meta2, 'func2', null)
meta1.addModule(meta2, 'proc2', null)
meta1.addModule(meta2, 'work2', null)
meta1.addModule(meta3, 'proc3', 'my_process')
meta1.addModule(meta3, 'work3', null)

Expand Down

0 comments on commit a6d08c0

Please sign in to comment.