Skip to content
This repository was archived by the owner on Sep 1, 2025. It is now read-only.

Commit c6d5999

Browse files
committed
Explicitly adds the JUnit Platform Launcher as a test runtime dependency
This fix is to address the deprecation warning that occurs when running tests. This solution follows the recommended approach from the Gradle documentation and should resolve the deprecation warning while maintaining the same test functionality.
1 parent 8fc48c5 commit c6d5999

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

plugins/nf-hello/build.gradle

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,43 @@ dependencies {
7878
modules {
7979
module("commons-logging:commons-logging") { replacedBy("org.slf4j:jcl-over-slf4j") }
8080
}
81+
82+
// Add this line to explicitly declare the test framework launcher
83+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
8184
}
8285

8386
// use JUnit 5 platform
8487
test {
8588
useJUnitPlatform()
8689
}
8790

91+
// Task to install the plugin to the Nextflow plugins directory
92+
task installPlugin(type: Copy, dependsOn: copyPluginZip) {
93+
def pluginsDir = System.getenv('NXF_PLUGINS_DIR') ?:
94+
System.getenv('NXF_HOME') ? "${System.getenv('NXF_HOME')}/plugins" :
95+
"${System.getProperty('user.home')}/.nextflow/plugins"
96+
97+
def pluginZip = file("$rootProject.buildDir/plugins/${project.name}-${project.version}.zip")
98+
def pluginDir = file("$pluginsDir/${project.name}-${project.version}")
99+
100+
doFirst {
101+
println "Installing plugin to: $pluginDir"
102+
pluginDir.mkdirs()
103+
}
104+
105+
from zipTree(pluginZip)
106+
into pluginDir
107+
108+
doLast {
109+
println "Plugin installed successfully!"
110+
println "Installation location determined by:"
111+
if (System.getenv('NXF_PLUGINS_DIR')) {
112+
println " - NXF_PLUGINS_DIR environment variable"
113+
} else if (System.getenv('NXF_HOME')) {
114+
println " - NXF_HOME environment variable"
115+
} else {
116+
println " - Default location (~/.nextflow/plugins)"
117+
}
118+
}
119+
}
120+

0 commit comments

Comments
 (0)