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
  2. cd .. && git clone https://github.com/nextflow-io/nextflow
    cd nextflow && ./gradlew exportClasspath
    
  3. Append the following line to the settings.gradle in this project:
  4. includeBuild('../nextflow')
    
  5. Compile the plugin code
  6. ./gradlew compileGroovy
    
  7. Run nextflow with this command:
  8. ./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
  2. ./gradlew compileGroovy
    make install
    
  3. Run nextflow with this command, specifying the plugin version:
  4. 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.