Skip to content

Commit dedabb7

Browse files
authored
Merge pull request #122 from nextflow-io/nextflow-gradle-plugin
Nextflow gradle plugin
2 parents 16263f6 + 1d316a3 commit dedabb7

File tree

109 files changed

+75
-386
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+75
-386
lines changed

.github/workflows/build-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
python-version: 3.x
2020
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
2121
- name: Obtain version from MANIFEST.MF
22-
run: echo "plugin_version=$(grep "Plugin-Version" plugins/nf-schema/src/resources/META-INF/MANIFEST.MF | awk '{print $2}' | awk -F '.' '{print $1"."$2}')" >> $GITHUB_ENV
22+
run: echo "plugin_version=$(grep "version = " build.gradle | sed -e 's/version = //' | cut -d "'" -f 2)" >> $GITHUB_ENV
2323
- name: Setup git user
2424
run: |
2525
git config --global user.name "${{github.actor}}"

Makefile

Lines changed: 12 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,23 @@
1-
2-
config ?= compileClasspath
3-
version ?= $(shell grep 'Plugin-Version' plugins/nf-schema/src/resources/META-INF/MANIFEST.MF | awk '{ print $$2 }')
4-
5-
ifdef module
6-
mm = :${module}:
7-
else
8-
mm =
9-
endif
1+
# Build the plugin
2+
assemble:
3+
./gradlew assemble
104

115
clean:
6+
rm -rf .nextflow*
7+
rm -rf work
8+
rm -rf build
129
./gradlew clean
1310

14-
compile:
15-
./gradlew compileGroovy
16-
@echo "DONE `date`"
17-
18-
19-
check:
20-
./gradlew check
21-
22-
23-
#
24-
# Show dependencies try `make deps config=runtime`, `make deps config=google`
25-
#
26-
deps:
27-
./gradlew -q ${mm}dependencies --configuration ${config}
28-
29-
deps-all:
30-
./gradlew -q dependencyInsight --configuration ${config} --dependency ${module}
31-
32-
#
33-
# Refresh SNAPSHOTs dependencies
34-
#
35-
refresh:
36-
./gradlew --refresh-dependencies
37-
3811
#
3912
# Run all tests or selected ones
4013
#
4114
test:
42-
ifndef class
43-
./gradlew ${mm}test
44-
else
45-
./gradlew ${mm}test --tests ${class}
46-
endif
47-
15+
./gradlew test
4816

17+
# Install the plugin into local nextflow plugins dir
4918
install:
50-
./gradlew copyPluginZip
51-
rm -rf ${HOME}/.nextflow/plugins/nf-schema-${version}
52-
cp -r build/plugins/nf-schema-${version} ${HOME}/.nextflow/plugins/nf-schema-${version}
53-
54-
#
55-
# Upload JAR artifacts to Maven Central
56-
#
57-
upload:
58-
./gradlew upload
59-
60-
61-
upload-plugins:
62-
./gradlew plugins:upload
19+
./gradlew install
6320

64-
publish-index:
65-
./gradlew plugins:publishIndex
21+
# Publish the plugin
22+
release:
23+
./gradlew releasePlugin

build.gradle

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
plugins {
2+
id 'io.nextflow.nextflow-plugin' version '0.0.1-alpha2'
3+
}
4+
5+
dependencies {
6+
implementation 'org.json:json:20240303'
7+
implementation 'dev.harrel:json-schema:1.5.0'
8+
implementation 'com.sanctionco.jmail:jmail:1.6.3' // Needed for e-mail format validation
9+
}
10+
11+
version = '2.4.0dev'
12+
13+
nextflowPlugin {
14+
nextflowVersion = '24.10.0'
15+
16+
provider = 'nextflow'
17+
className = 'nextflow.validation.ValidationPlugin'
18+
extensionPoints = [
19+
'nextflow.validation.ValidationExtension',
20+
'nextflow.validation.ValidationObserverFactory'
21+
]
22+
23+
publishing {
24+
github {
25+
repository = 'nextflow-io/nf-schema'
26+
userName = project.findProperty('github_username')
27+
authToken = project.findProperty('github_access_token')
28+
email = project.findProperty('github_commit_email')
29+
30+
indexUrl = 'https://github.com/nextflow-io/plugins/blob/main/plugins.json'
31+
}
32+
}
33+
}

docs/contributing/setup.md

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ description: How to contribute to nf-schema
55

66
# Getting started with plugin development
77

8-
## Compiling
8+
## Tests
99

10-
To compile and run the tests use the following command:
10+
To run the tests use the following command:
1111

1212
```bash
13-
./gradlew check
13+
make test
1414
```
1515

16-
## Launch it with installed Nextflow
16+
## Install and use in pipelines
1717

1818
!!! warning
1919

@@ -39,33 +39,6 @@ plugins {
3939
}
4040
```
4141

42-
## Launch it with a local version of Nextflow
43-
44-
- Clone the Nextflow repo into a sibling directory
45-
46-
```bash
47-
cd .. && git clone https://github.com/nextflow-io/nextflow
48-
cd nextflow && ./gradlew exportClasspath
49-
```
50-
51-
- Append to the `settings.gradle` in this project the following line:
52-
53-
```bash
54-
includeBuild('../nextflow')
55-
```
56-
57-
- Compile the plugin code
58-
59-
```bash
60-
./gradlew compileGroovy
61-
```
62-
63-
- Run nextflow with this command:
64-
65-
```bash
66-
./launch.sh run -plugins nf-schema <script/pipeline name> [pipeline params]
67-
```
68-
6942
## Change and preview the docs
7043

7144
The docs are generated using [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/).
@@ -82,3 +55,20 @@ mkdocs serve
8255
```
8356

8457
To preview the docs, open the URL provided by mkdocs in your browser.
58+
59+
## Release and publish the plugin
60+
61+
1. In `build.gradle` make sure that:
62+
- `version` matches the desired release version,
63+
- `github.repository` matches the repository of the plugin,
64+
- `github.indexUrl` points to your fork of the plugins index repository.
65+
2. Create a file named `$HOME/.gradle/gradle.properties`, where `$HOME` is your home directory. Add the following properties:
66+
- `github_username`: The GitHub username granting access to the plugin repository.
67+
- `github_access_token`: The GitHub access token required to upload and commit changes to the plugin repository.
68+
- `github_commit_email`: The email address associated with your GitHub account.
69+
3. Update the [changelog](./CHANGELOG.md).
70+
4. Build and publish the plugin to your GitHub repository:
71+
```bash
72+
make release
73+
```
74+
5. Create a pull request against the [nextflow-io/plugins](https://github.com/nextflow-io/plugins/blob/main/plugins.json) repository to make the plugin publicly accessible.

gradle.properties

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

launch.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

plugins/build.gradle

Lines changed: 0 additions & 177 deletions
This file was deleted.

0 commit comments

Comments
 (0)