Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/main/groovy/io/nextflow/gradle/NextflowPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ class NextflowPlugin implements Plugin<Project> {
}
// </HACK>

// retain method parameter names so that generateSpec can read them
project.tasks.withType(JavaCompile).configureEach { task ->
task.options.compilerArgs.add('-parameters')
}
project.tasks.withType(GroovyCompile).configureEach { task ->
task.groovyOptions.parameters = true
// Java sources jointly compiled with Groovy
task.options.compilerArgs.add('-parameters')
}

// -----------------------------------
// Common dependencies
// -----------------------------------
Expand Down
19 changes: 19 additions & 0 deletions src/test/groovy/io/nextflow/gradle/NextflowPluginTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,25 @@ class NextflowPluginTest extends Specification {
compileOnlyDeps.find { it.group == 'org.pf4j' && it.name == 'pf4j' && it.version == '3.4.1' }
}

def "should compile with method parameter names"() {
given:
project.nextflowPlugin {
description = 'A test plugin'
provider = 'Test Author'
className = 'com.example.TestPlugin'
nextflowVersion = '24.04.0'
extensionPoints = ['com.example.TestExtension']
}

when:
project.evaluate()

then:
project.tasks.compileJava.options.compilerArgs.contains('-parameters')
project.tasks.compileGroovy.groovyOptions.parameters
project.tasks.compileGroovy.options.compilerArgs.contains('-parameters')
}

def "should configure jar task to include extensions.idx file"() {
given:
project.nextflowPlugin {
Expand Down
Loading