forked from kestra-io/plugin-jms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
253 lines (217 loc) · 8.68 KB
/
Copy pathbuild.gradle
File metadata and controls
253 lines (217 loc) · 8.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
plugins {
id "com.vanniktech.maven.publish" version "0.34.0"
id "io.kestra.gradle.inject-bom-versions" version "1.0.0"
id 'java-library'
id "idea"
id 'jacoco'
id "com.adarshr.test-logger" version "4.0.0"
id "com.gradleup.shadow" version "9.2.2"
id 'signing'
id "com.github.ben-manes.versions" version "0.53.0"
id 'net.researchgate.release' version '3.1.0'
}
def isBuildSnapshot = version.toString().endsWith("-SNAPSHOT")
repositories {
mavenLocal()
mavenCentral()
if (isBuildSnapshot) {
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
}
}
final targetJavaVersion = JavaVersion.VERSION_21
java {
sourceCompatibility = targetJavaVersion
targetCompatibility = targetJavaVersion
}
group = "io.kestra.plugin"
description = 'Plugin JMS for Kestra'
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.compilerArgs.add("-parameters")
}
dependencies {
// Platform
annotationProcessor enforcedPlatform("io.kestra:platform:$kestraVersion")
implementation enforcedPlatform("io.kestra:platform:$kestraVersion")
// lombok
annotationProcessor "org.projectlombok:lombok"
compileOnly "org.projectlombok:lombok"
// kestra
annotationProcessor group: "io.kestra", name: "processor", version: kestraVersion
compileOnly group: "io.kestra", name: "core", version: kestraVersion
compileOnly group: "io.kestra", name: "script", version: kestraVersion
// JMS adapter
implementation group: "at.conapi.oss", name: "jms-adapter", version: "1.0.1"
}
/**********************************************************************************************************************\
* Test
**********************************************************************************************************************/
test {
useJUnitPlatform()
}
testlogger {
theme = "mocha-parallel"
showExceptions = true
showFullStackTraces = true
showStandardStreams = true
showPassedStandardStreams = false
showSkippedStandardStreams = true
}
/**********************************************************************************************************************\
* Copy Test Libs for Examples
**********************************************************************************************************************/
task copyTestLibs(type: Copy) {
description = 'Copies RabbitMQ and ActiveMQ JMS client libs to build/test-libs for manual testing examples'
from configurations.testRuntimeClasspath.filter {
it.name.contains('rabbitmq-jms') ||
it.name.contains('amqp-client') ||
it.name.startsWith('artemis-') || // Get ALL artemis JARs (jakarta-client, commons, core-client, selector)
it.name.startsWith('netty-') || // Get Netty for Artemis transport
it.name.startsWith('commons-') // Get Apache Commons libraries (beanutils, collections, logging)
}
into 'build/test-libs'
}
// Ensure copyTestLibs runs as part of the build process (even when tests are skipped)
assemble.dependsOn copyTestLibs
task copyPluginForDocker(type: Copy) {
description = 'Creates version-neutral copy of plugin JAR for Docker mounting'
from shadowJar
into 'build/libs'
rename { 'plugin-jms-docker.jar' }
}
// Ensure copyPluginForDocker runs after assembling (shadowJar is part of assemble)
assemble.finalizedBy copyPluginForDocker
dependencies {
// Platform
testAnnotationProcessor enforcedPlatform("io.kestra:platform:$kestraVersion")
testImplementation enforcedPlatform("io.kestra:platform:$kestraVersion")
// lombok
testAnnotationProcessor "org.projectlombok:lombok"
testCompileOnly 'org.projectlombok:lombok'
// micronaut
testAnnotationProcessor "io.micronaut:micronaut-inject-java"
testAnnotationProcessor "io.micronaut.validation:micronaut-validation-processor"
testImplementation "io.micronaut.test:micronaut-test-junit5"
testImplementation "io.micronaut:micronaut-jackson-databind"
// test deps needed only for to have a runner
testAnnotationProcessor group: "io.kestra", name: "processor", version: kestraVersion
testImplementation group: "io.kestra", name: "core", version: kestraVersion
testImplementation group: "io.kestra", name: "tests", version: kestraVersion
testImplementation group: "io.kestra", name: "script", version: kestraVersion
testImplementation group: "io.kestra", name: "repository-memory", version: kestraVersion
testImplementation group: "io.kestra", name: "runner-memory", version: kestraVersion
testImplementation group: "io.kestra", name: "storage-local", version: kestraVersion
// test
testImplementation "org.junit.jupiter:junit-jupiter-engine"
testImplementation "org.hamcrest:hamcrest"
testImplementation "org.hamcrest:hamcrest-library"
// RabbitMQ JMS client for integration tests and examples
testImplementation "com.rabbitmq.jms:rabbitmq-jms:3.5.0"
// ActiveMQ Artemis Jakarta client for integration tests (Jakarta JMS 3.x)
testImplementation "org.apache.activemq:artemis-jakarta-client:2.43.0"
}
/**********************************************************************************************************************\
* Allure Reports
**********************************************************************************************************************/
dependencies {
testImplementation enforcedPlatform("io.kestra:platform:$kestraVersion")
testImplementation "io.qameta.allure:allure-junit5"
}
configurations {
agent {
canBeResolved = true
canBeConsumed = true
}
}
dependencies {
agent "org.aspectj:aspectjweaver:1.9.24"
}
test {
jvmArgs = [ "-javaagent:${configurations.agent.singleFile}" ]
}
/**********************************************************************************************************************\
* Jacoco
**********************************************************************************************************************/
test {
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
}
/**********************************************************************************************************************\
* Publish
**********************************************************************************************************************/
mavenPublishing {
publishToMavenCentral(true)
signAllPublications()
coordinates("${project.group}", "${project.name}", "${project.version}")
pom {
name = "${project.name}"
description = "${project.group}:${project.name}:${project.version}"
url = "https://github.com/kestra-io/${project.name}"
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'conapi-frank'
name = 'Frank Beusenberg'
email = '[email protected]'
}
developer {
id = 'conapi-stefan'
name = 'Stefan Fritz'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:'
url = "https://github.com/kestra-io/${project.name}"
}
}
}
tasks.withType(GenerateModuleMetadata).configureEach {
// Suppression this validation error as we want to enforce the Kestra platform
suppressedValidationErrors.add('enforced-platform')
}
jar {
manifest {
attributes(
"X-Kestra-Name": project.name,
"X-Kestra-Title": "JMS",
"X-Kestra-Group": project.group + ".jms",
"X-Kestra-Description": project.description,
"X-Kestra-Version": project.version
)
}
}
shadowJar {
archiveClassifier.set(null)
mergeServiceFiles()
}
/**********************************************************************************************************************\
* Version
**********************************************************************************************************************/
release {
preCommitText = 'chore(version):'
preTagCommitMessage = 'update to version'
tagCommitMessage = 'tag version'
newVersionCommitMessage = 'update snapshot version'
tagTemplate = 'v${version}'
buildTasks = ['classes']
git {
requireBranch.set('main')
}
}
/**********************************************************************************************************************\
* Dev
**********************************************************************************************************************/
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}