Skip to content

Commit ccab49b

Browse files
committed
build: Use nextflow gradle plugin
Signed-off-by: Edmund Miller <[email protected]>
1 parent ea40692 commit ccab49b

27 files changed

+38
-318
lines changed

Makefile

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

105
clean:
116
rm -rf .nextflow*
127
rm -rf work
138
rm -rf build
14-
rm -rf plugins/*/build
159
./gradlew clean
1610

17-
compile:
18-
./gradlew compileGroovy
19-
@echo "DONE `date`"
20-
21-
22-
check:
23-
./gradlew check
24-
25-
26-
#
27-
# Show dependencies try `make deps config=runtime`, `make deps config=google`
28-
#
29-
deps:
30-
./gradlew -q ${mm}dependencies --configuration ${config}
31-
32-
deps-all:
33-
./gradlew -q dependencyInsight --configuration ${config} --dependency ${module}
34-
35-
#
36-
# Refresh SNAPSHOTs dependencies
37-
#
38-
refresh:
39-
./gradlew --refresh-dependencies
40-
41-
#
42-
# Run all tests or selected ones
43-
#
11+
# Run plugin unit tests
4412
test:
45-
ifndef class
46-
./gradlew ${mm}test
47-
else
48-
./gradlew ${mm}test --tests ${class}
49-
endif
50-
51-
assemble:
52-
./gradlew assemble
53-
54-
#
55-
# generate build zips under build/plugins
56-
# you can install the plugin copying manually these files to $HOME/.nextflow/plugins
57-
#
58-
buildPlugins:
59-
./gradlew copyPluginZip
60-
61-
#
62-
# Upload JAR artifacts to Maven Central
63-
#
64-
upload:
65-
./gradlew upload
66-
67-
68-
upload-plugins:
69-
./gradlew plugins:upload
70-
71-
publish-index:
72-
./gradlew plugins:publishIndex
13+
./gradlew test
7314

7415
# Install the plugin into local nextflow plugins dir
7516
install:
76-
./gradlew copyPluginZip
77-
rm -rf ${HOME}/.nextflow/plugins/nf-sqldb-${version}
78-
cp -r build/plugins/nf-sqldb-${version} ${HOME}/.nextflow/plugins/nf-sqldb-${version}
79-
17+
./gradlew install
8018

81-
publish-jar:
82-
./gradlew plugins:nf-sqldb:publishMavenPublicationToMavenRepository
19+
# Publish the plugin
20+
release:
21+
./gradlew releasePlugin

plugins/nf-sqldb/build.gradle renamed to build.gradle

Lines changed: 21 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,12 @@
1515
*/
1616

1717
plugins {
18-
// Apply the groovy plugin to add support for Groovy
19-
id 'io.nextflow.groovy-library-conventions'
20-
id 'idea'
18+
id 'io.nextflow.nextflow-plugin' version '1.0.0-beta.6'
2119
id 'de.undercouch.download' version '4.1.2'
2220
}
2321

24-
group = 'io.nextflow'
25-
// DO NOT SET THE VERSION HERE
26-
// THE VERSION FOR PLUGINS IS DEFINED IN THE `/resources/META-INF/MANIFEST.NF` file
27-
28-
idea {
29-
module.inheritOutputDirs = true
30-
}
22+
// Plugin version (from latest MANIFEST.MF)
23+
version = '0.7.1'
3124

3225
repositories {
3326
mavenCentral()
@@ -36,29 +29,8 @@ repositories {
3629
maven { url = 'https://s3-eu-west-1.amazonaws.com/maven.seqera.io/snapshots' }
3730
}
3831

39-
configurations {
40-
// see https://docs.gradle.org/4.1/userguide/dependency_management.html#sub:exclude_transitive_dependencies
41-
runtimeClasspath.exclude group: 'org.slf4j', module: 'slf4j-api'
42-
}
43-
44-
sourceSets {
45-
main.java.srcDirs = []
46-
main.groovy.srcDirs = ['src/main']
47-
main.resources.srcDirs = ['src/resources']
48-
test.groovy.srcDirs = ['src/test']
49-
test.java.srcDirs = []
50-
test.resources.srcDirs = []
51-
}
52-
53-
ext{
54-
nextflowVersion = '25.04.0'
55-
}
56-
5732
dependencies {
58-
compileOnly "io.nextflow:nextflow:$nextflowVersion"
59-
compileOnly 'org.slf4j:slf4j-api:2.0.16'
60-
compileOnly 'org.pf4j:pf4j:3.12.0'
61-
33+
// Latest database dependencies from master branch
6234
api("org.apache.groovy:groovy-sql:4.0.26") { transitive = false }
6335
api 'com.h2database:h2:1.4.200'
6436
api 'mysql:mysql-connector-java:8.0.33'
@@ -77,25 +49,29 @@ dependencies {
7749
// test configuration
7850
testImplementation "org.apache.groovy:groovy:4.0.26"
7951
testImplementation "org.apache.groovy:groovy-nio:4.0.26"
80-
testImplementation "io.nextflow:nextflow:$nextflowVersion"
8152
testImplementation ("org.apache.groovy:groovy-test:4.0.26") { exclude group: 'org.apache.groovy' }
8253
testImplementation ("cglib:cglib-nodep:3.3.0")
8354
testImplementation ("org.objenesis:objenesis:3.1")
8455
testImplementation ("org.spockframework:spock-core:2.3-groovy-4.0") { exclude group: 'org.apache.groovy'; exclude group: 'net.bytebuddy' }
8556
testImplementation ('org.spockframework:spock-junit4:2.3-groovy-4.0') { exclude group: 'org.apache.groovy'; exclude group: 'net.bytebuddy' }
8657
testImplementation ('com.google.jimfs:jimfs:1.1')
8758

88-
testImplementation(testFixtures("io.nextflow:nextflow:$nextflowVersion"))
89-
testImplementation(testFixtures("io.nextflow:nf-commons:$nextflowVersion"))
90-
9159
// see https://docs.gradle.org/4.1/userguide/dependency_management.html#sec:module_replacement
9260
modules {
9361
module("commons-logging:commons-logging") { replacedBy("org.slf4j:jcl-over-slf4j") }
9462
}
9563
}
9664

97-
test {
98-
useJUnitPlatform()
65+
nextflowPlugin {
66+
// Minimum Nextflow version
67+
nextflowVersion = '25.04.0'
68+
69+
// Plugin metadata
70+
provider = 'Seqera Labs'
71+
className = 'nextflow.sql.SqlPlugin'
72+
extensionPoints = [
73+
'nextflow.sql.ChannelSqlExtension'
74+
]
9975
}
10076

10177
/**
@@ -127,5 +103,10 @@ task copyAthenDep(dependsOn: unzipAthenDep, type: Copy) {
127103
from file(new File(buildDir, '/downloads/unzip/awsathena/SimbaAthenaJDBC-2.0.25.1001/AthenaJDBC42_2.0.25.1001.jar'))
128104
into "src/dist/lib"
129105
}
130-
project.copyPluginLibs.dependsOn('copyAthenDep')
131-
project.compileGroovy.dependsOn('copyAthenDep')
106+
107+
// Hook into the new plugin's build process
108+
compileGroovy.dependsOn('copyAthenDep')
109+
110+
test {
111+
useJUnitPlatform()
112+
}

0 commit comments

Comments
 (0)