14
14
* limitations under the License.
15
15
*/
16
16
17
- plugins {
18
- // Apply the groovy plugin to add support for Groovy
19
- id ' io.nextflow.groovy-library-conventions'
20
- id ' idea'
21
- id ' de.undercouch.download' version ' 4.1.2'
17
+ // Add the download plugin
18
+ buildscript {
19
+ repositories {
20
+ mavenCentral()
21
+ }
22
+ dependencies {
23
+ classpath ' de.undercouch:gradle-download-task:4.1.2'
24
+ }
22
25
}
23
26
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
+ plugins {
28
+ id ' io.nextflow.nextflow-plugin ' version ' 0.0.1-alpha '
29
+ }
27
30
28
- idea {
29
- module. inheritOutputDirs = true
31
+ sourceSets {
32
+ main {
33
+ groovy {
34
+ srcDirs = [' src/main/groovy' ]
35
+ }
36
+ resources {
37
+ srcDirs = [' src/main/resources' ]
38
+ }
39
+ }
40
+ test {
41
+ groovy {
42
+ srcDirs = [' src/test/groovy' ]
43
+ }
44
+ }
30
45
}
31
46
32
47
repositories {
@@ -36,75 +51,86 @@ repositories {
36
51
maven { url = ' https://s3-eu-west-1.amazonaws.com/maven.seqera.io/snapshots' }
37
52
}
38
53
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 = ' 24.04.0'
55
- }
56
-
57
54
dependencies {
58
- compileOnly " io.nextflow:nextflow:$nextflowVersion "
59
- compileOnly ' org.slf4j:slf4j-api:2.0.7'
60
- compileOnly ' org.pf4j:pf4j:3.12.0'
61
-
55
+ // API dependencies from the original build.gradle
62
56
api(" org.apache.groovy:groovy-sql:4.0.23" ) { transitive = false }
63
57
api ' com.h2database:h2:1.4.200'
64
58
api ' mysql:mysql-connector-java:8.0.33'
65
59
api ' org.mariadb.jdbc:mariadb-java-client:2.7.0'
66
60
api ' org.postgresql:postgresql:42.7.4'
67
61
api ' org.xerial:sqlite-jdbc:3.47.0.0'
68
62
api ' org.duckdb:duckdb_jdbc:0.10.2'
69
-
70
-
71
- // JDBC driver setup for AWS Athena - the 3rd party JAR are being downloaded and setup as gradle tasks below.
72
- // Reference https://docs.aws.amazon.com/athena/latest/ug/connect-with-jdbc.html
63
+
64
+ // Replace commons-logging with jcl-over-slf4j
65
+ implementation ' org.slf4j:jcl-over-slf4j:2.0.7'
66
+
67
+ // JDBC driver for AWS Athena
73
68
api files(' src/dist/lib/AthenaJDBC42_2.0.25.1001.jar' )
74
-
75
- // NOTE: Had to remove the slf4j jar due to a conflict
76
69
implementation fileTree(dir : ' src/dist/lib/libs' , include : ' *.jar' )
77
-
78
- // test configuration
70
+
71
+ // Test dependencies
79
72
testImplementation " org.apache.groovy:groovy:4.0.23"
80
73
testImplementation " org.apache.groovy:groovy-nio:4.0.23"
81
- testImplementation " io.nextflow:nextflow:$nextflowVersion "
82
74
testImplementation (" org.apache.groovy:groovy-test:4.0.23" ) { exclude group : ' org.apache.groovy' }
83
75
testImplementation (" cglib:cglib-nodep:3.3.0" )
84
76
testImplementation (" org.objenesis:objenesis:3.1" )
85
77
testImplementation (" org.spockframework:spock-core:2.3-groovy-4.0" ) { exclude group : ' org.apache.groovy' ; exclude group : ' net.bytebuddy' }
86
78
testImplementation (' org.spockframework:spock-junit4:2.3-groovy-4.0' ) { exclude group : ' org.apache.groovy' ; exclude group : ' net.bytebuddy' }
87
79
testImplementation (' com.google.jimfs:jimfs:1.1' )
88
80
89
- testImplementation(testFixtures(" io.nextflow:nextflow:$nextflowVersion " ))
90
- testImplementation(testFixtures(" io.nextflow:nf-commons:$nextflowVersion " ))
81
+ // Add back Nextflow test dependencies
82
+ testImplementation " io.nextflow:nextflow:${ nextflowPlugin.nextflowVersion} "
83
+ testImplementation(testFixtures(" io.nextflow:nextflow:${ nextflowPlugin.nextflowVersion} " ))
84
+ testImplementation(testFixtures(" io.nextflow:nf-commons:${ nextflowPlugin.nextflowVersion} " ))
85
+ }
86
+
87
+ configurations {
88
+ // see https://docs.gradle.org/4.1/userguide/dependency_management.html#sub:exclude_transitive_dependencies
89
+ runtimeClasspath. exclude group : ' org.slf4j' , module : ' slf4j-api'
90
+ }
91
91
92
- // see https://docs.gradle.org/4.1/userguide/dependency_management.html#sec:module_replacement
93
- modules {
94
- module(" commons-logging:commons-logging" ) { replacedBy(" org.slf4j:jcl-over-slf4j" ) }
92
+ // Use the version from the MANIFEST.MF
93
+ version = ' 0.6.0'
94
+
95
+ nextflowPlugin {
96
+ // From the MANIFEST.MF
97
+ nextflowVersion = ' 24.04.0'
98
+
99
+ provider = ' Seqera Labs'
100
+ className = ' nextflow.sql.SqlPlugin'
101
+ extensionPoints = [
102
+ ' nextflow.sql.ChannelSqlExtension'
103
+ ]
104
+
105
+ publishing {
106
+ github {
107
+ repository = ' seqera/nf-sqldb'
108
+ userName = project. findProperty(' github_username' )
109
+ authToken = project. findProperty(' github_access_token' )
110
+ email = project. findProperty(' github_commit_email' )
111
+
112
+ // You may need to adjust this URL if the central plugin index is different
113
+ indexUrl = ' https://github.com/nextflow-io/plugins/main/plugins.json'
114
+ }
95
115
}
96
116
}
97
117
118
+ // Configure the packagePlugin task to handle duplicates
119
+ tasks. named(' packagePlugin' ) {
120
+ duplicatesStrategy = DuplicatesStrategy . EXCLUDE
121
+ }
122
+
123
+ // Add test configuration for Java modules
98
124
test {
99
125
useJUnitPlatform()
126
+ jvmArgs = [' --add-opens=java.base/java.lang=ALL-UNNAMED' ,
127
+ ' --add-opens=java.base/java.util=ALL-UNNAMED' ,
128
+ ' --add-opens=java.base/java.lang.reflect=ALL-UNNAMED' ]
100
129
}
101
130
102
- /**
103
- * AWS Athena
104
- * The following tasks download and confirm the MD5 checksum of the ZIP archive
105
- * for Simba Athena JDBC driver and extract its contents to the build directory
106
- * Reference: https://docs.aws.amazon.com/athena/latest/ug/connect-with-jdbc.html
107
- */
131
+ // AWS Athena dependencies setup - migrated from the original build.gradle
132
+ apply plugin : ' de.undercouch.download'
133
+
108
134
task downloadAthenDep (type : Download ) {
109
135
src ' https://s3.amazonaws.com/athena-downloads/drivers/JDBC/SimbaAthenaJDBC-2.0.25.1001/SimbaAthenaJDBC-2.0.25.1001.zip'
110
136
dest new File (buildDir, ' downloads/SimbaAthenaJDBC-2.0.25.1001.zip' )
@@ -122,11 +148,13 @@ task unzipAthenDep(dependsOn: verifyAthenDep, type: Copy) {
122
148
into " ${ buildDir} /downloads/unzip/awsathena/"
123
149
}
124
150
125
- // Files under src/dist are included into the distribution zip
126
- // https://docs.gradle.org/current/userguide/application_plugin.html
127
151
task copyAthenDep (dependsOn : unzipAthenDep, type : Copy ) {
128
152
from file(new File (buildDir, ' /downloads/unzip/awsathena/SimbaAthenaJDBC-2.0.25.1001/AthenaJDBC42_2.0.25.1001.jar' ))
129
153
into " src/dist/lib"
130
154
}
131
- project. copyPluginLibs. dependsOn(' copyAthenDep' )
132
- project. compileGroovy. dependsOn(' copyAthenDep' )
155
+
156
+ // Make sure compileGroovy depends on copyAthenDep
157
+ compileGroovy. dependsOn(copyAthenDep)
158
+
159
+ // Hook into the assemble task to ensure Athena dependencies are properly set up
160
+ assemble. dependsOn(' copyAthenDep' )
0 commit comments