Skip to content

Getting started with plugin development

Launch it with Nextflow

To test with Nextflow for development purpose:

  1. Clone the Nextflow repo into a sibling directory
cd .. && git clone https://github.com/nextflow-io/nextflow
cd nextflow && ./gradlew exportClasspath
  1. Append the following line to the settings.gradle in this project:
includeBuild('../nextflow')
  1. Compile the plugin code
./gradlew compileGroovy
  1. Run nextflow with this command:
./launch.sh run -plugins nf-co2footprint <script/pipeline name> [pipeline params]

Alternative: Launch without a local Nextflow build

The plugin can be tested without using a local Nextflow build using the following steps:

Warning

This will install the compiled plugin code into your $NXF_PLUGINS_DIR directory (default: ${HOME}/.nextflow/plugins). If the plugin version from the manifest file (plugins/nf-co2footprint/src/resources/META-INF/MANIFEST.MF) of the dev code matches an existing plugin, any install will be overwritten.

  1. Compile and install the plugin code
./gradlew compileGroovy
make install
  1. Run nextflow with this command, specifying the plugin version:
nextflow run -plugins nf-co2footprint@1.0.0-beta <script/pipeline name> [pipeline params]

Compiling and running tests

To compile and run the tests use the following command:

./gradlew check

Change and preview the docs

The docs are generated using Material for MkDocs. To change the docs, edit the files in the docs/ folder and run the following command to generate the docs (after installing mkdocs via pip install mkdocs-material):

mkdocs serve

To preview the docs, open the URL provided by mkdocs in your browser.