Warning
This plugin is in early active development, please use nextflow-io/nf-hello
for production usage for now.
This is a Gradle plugin for building Nextflow plugins.
It sets up default dependencies required for integration with Nextflow, and adds some custom gradle tasks to help build and publish your Nextflow plugin.
Apply and configure this plugin in your build.gradle
file, for example:
plugins {
id 'io.nextflow.nextflow-plugin' version '0.0.1-alpha3'
}
dependencies {
// (optional) put any library dependencies here
}
// plugin version
version = '0.0.1'
nextflowPlugin {
// minimum nextflow version
nextflowVersion = '24.11.0-edge'
provider = 'example-inc'
className = 'com.example.ExamplePlugin'
extensionPoints = [
'com.example.ExampleObserver',
'com.example.ExampleFunctions'
]
publishing {
github {
repository = 'example-inc/nf-example'
userName = project.findProperty('github_username')
authToken = project.findProperty('github_access_token')
email = project.findProperty('github_commit_email')
indexUrl = 'https://github.com/nextflow-io/plugins/main/plugins.json'
}
}
}
This will add some useful tasks to your Gradle build:
assemble
- compile the Nextflow plugin code and assemble it into a zip fileinstallPlugin
- copy the assembled plugin into your local Nextflow plugins dirreleasePlugin
- published the assembled plugin to a Github repository, and update the central plugins.json index repository
You should also ensure that your project's settings.gradle
declares the plugin name, eg:
rootProject.name = '<YOUR-PLUGIN-NAME>'
Follow these steps to migrate an existing Nextflow plugin:
- If your project uses a
plugins
dir, move itssrc
dir to the project root - Make sure your plugin sources are now in
src/main/groovy
orsrc/main/java
- Replace any gradle build files with the configuration described above
See nextflow-io/nf-hello#21 for an example
This section is only relevant if you want to make changes to this Gradle plugin itself, and isn't needed for developing Nextflow plugins.
- Checkout this project and install it to your local maven repo:
./gradlew publishToMavenLocal
- In your Nextflow plugin project, add this to the
settings.gradle
:
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
}
}
- Apply the configuration, as described above