Skip to content

Latest commit

 

History

History
191 lines (132 loc) · 5.09 KB

File metadata and controls

191 lines (132 loc) · 5.09 KB

Dev

Set up dev environment using SDK Man

# install SDK Man
curl -s "https://get.sdkman.io" | bash

# new terminal session

# install these versions
sdk install java 17.0.10-amzn
sdk install gradle 8.4

# make sure these are set
sdk default java 17.0.10-amzn
sdk default gradle 8.4

Install Nextflow and leave the nextflow executable in the current directory, for convenience

wget -qO- https://get.nextflow.io | bash

compile the plugin and put in into the Nextflow plugin dir

./gradlew unzipPlugin

# this will place the plugin files at the location:
# ~/.nextflow/plugins/nf-niceutils-0.0.1

run the pipeline with the Nextflow binary in the local dir

./nextflow run examples/test.nf

run the test cases

./gradlew test
  • if a test failed it will create a report at build/reports/tests/test/classes/com.nextflow.plugin.PluginTest.html

Files

These are the primary files used for dev

  • most of the helper methods are in this file: src/main/groovy/com/nextflow/plugin/ExampleFunctions.groovy

  • the test cases are in this file: src/test/groovy/com/nextflow/plugin/ExampleFunctionsTest.groovy

Release

How to make a Release

  • update the Groovy files here

gradle.properties

  • create a git release
git tag -a 0.0.1 main
git push --tags origin main
  • clean up the project to remove stale build artifacts
./gradlew clean
  • create a JSON manifest + .zip files for the plugin
./gradlew jsonPlugin

# creates these files;
# build/plugin/nf-niceutils-0.0.1-meta.json
# build/plugin/nf-niceutils-0.0.1.zip
  • double check that its right
$ cat ./build/plugin/nf-niceutils-0.0.1-meta.json
{
    "version": "0.0.1",
    "date": "2024-03-22T14:09:04.655533-04:00",
    "url": "https://github.com/stevekm/nf-niceutils/releases/download/0.0.1/nf-niceutils-0.0.1.zip",
    "requires": ">=22.10.0",
    "sha512sum": "8079463cf9aa1995240c70c9c4e12d5060c1820c266f91858ac0b7cec51779f0ae6ee6ce572a9320ddbdcdd5da2792f6c09445e66913b6e6b112931606b58634"
}

$ sha512sum build/plugin/nf-niceutils-0.0.1.zip
8079463cf9aa1995240c70c9c4e12d5060c1820c266f91858ac0b7cec51779f0ae6ee6ce572a9320ddbdcdd5da2792f6c09445e66913b6e6b112931606b58634  build/plugin/nf-niceutils-0.0.1.zip

On GitHub make a new release. Choose the tag that was just created, and attach the .zip file.

Update the Nextflow Plugins Registry with the new JSON manifest and submit a PR against it for the update.

To test it out, on another system without the plugin installed (but this repo cloned), run this

# using my own fork of the registry
NXF_PLUGINS_TEST_REPOSITORY=https://raw.githubusercontent.com/stevekm/nextflow-plugins-registry/main/plugins.json nextflow run examples/test.nf

Extras

run for example to generate Nextflow’s artifacts

./gradlew jsonPlugin

if something goes wrong, try this and start again

./gradlew clean
./gradlew build
rm -rf .gradle

Versions

$ java --version
openjdk 17.0.10 2024-01-16 LTS
OpenJDK Runtime Environment Corretto-17.0.10.7.1 (build 17.0.10+7-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.10.7.1 (build 17.0.10+7-LTS, mixed mode, sharing)

$ gradle --version

------------------------------------------------------------
Gradle 8.4
------------------------------------------------------------

Build time:   2023-10-04 20:52:13 UTC
Revision:     e9251e572c9bd1d01e503a0dfdf43aedaeecdc3f

Kotlin:       1.9.10
Groovy:       3.0.17
Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM:          17.0.10 (Amazon.com Inc. 17.0.10+7-LTS)
OS:           Mac OS X 14.3.1 aarch64

Resources

Nextflow docs

Slack

Examples

Gradle notes

Spock unit test notes