@@ -139,7 +139,58 @@ allprojects {
139
139
}
140
140
}
141
141
142
- task tar (type : Tar ) {
142
+ tasks. register(' dist' ) {
143
+ subprojects. forEach { subProject ->
144
+ dependsOn(" ${ subProject.path} :jar" )
145
+ }
146
+ def includedProjects =
147
+ [" eventmesh-common" ,
148
+ " eventmesh-meta:eventmesh-meta-api" ,
149
+ " eventmesh-metrics-plugin:eventmesh-metrics-api" ,
150
+ " eventmesh-protocol-plugin:eventmesh-protocol-api" ,
151
+ " eventmesh-retry:eventmesh-retry-api" ,
152
+ " eventmesh-runtime" ,
153
+ " eventmesh-security-plugin:eventmesh-security-api" ,
154
+ " eventmesh-spi" ,
155
+ " eventmesh-starter" ,
156
+ " eventmesh-storage-plugin:eventmesh-storage-api" ,
157
+ " eventmesh-trace-plugin:eventmesh-trace-api" ,
158
+ " eventmesh-webhook:eventmesh-webhook-api" ,
159
+ " eventmesh-webhook:eventmesh-webhook-admin" ,
160
+ " eventmesh-webhook:eventmesh-webhook-receive" ]
161
+ doLast {
162
+ includedProjects. each {
163
+ def subProject = findProject(it)
164
+ logger. lifecycle(' Install module: module: {}' , subProject. name)
165
+ copy {
166
+ from subProject. jar. archivePath
167
+ into rootProject. file(' dist/apps' )
168
+ }
169
+ copy {
170
+ from subProject. file(' bin' )
171
+ into rootProject. file(' dist/bin' )
172
+ }
173
+ copy {
174
+ from subProject. file(' conf' )
175
+ from subProject. sourceSets. main. resources. srcDirs
176
+ into rootProject. file(' dist/conf' )
177
+ duplicatesStrategy = DuplicatesStrategy . EXCLUDE
178
+ exclude ' META-INF'
179
+ }
180
+ copy {
181
+ from subProject. configurations. runtimeClasspath
182
+ into rootProject. file(' dist/lib' )
183
+ exclude ' eventmesh-*'
184
+ }
185
+ }
186
+ copy {
187
+ from ' tools/third-party-licenses'
188
+ into rootProject. file(' dist' )
189
+ }
190
+ }
191
+ }
192
+
193
+ tasks. register(' tar' , Tar ) {
143
194
archiveBaseName. set(project. name)
144
195
archiveVersion. set(project. version. toString())
145
196
archiveExtension. set(' tar.gz' )
@@ -150,7 +201,7 @@ task tar(type: Tar) {
150
201
}
151
202
}
152
203
153
- task zip ( type : Zip ) {
204
+ tasks . register( ' zip ' , Zip ) {
154
205
archiveBaseName. set(project. name)
155
206
archiveVersion. set(project. version. toString())
156
207
archiveExtension. set(' zip' )
@@ -160,50 +211,39 @@ task zip(type: Zip) {
160
211
}
161
212
}
162
213
163
- task installPlugin () {
164
- if (! new File (" ${ rootDir} /dist" ). exists()) {
165
- return
214
+ tasks. register(' installPlugin' ) {
215
+ var pluginProjects = subprojects. findAll {
216
+ it. file(' gradle.properties' ). exists()
217
+ && it. properties. containsKey(' pluginType' )
218
+ && it. properties. containsKey(' pluginName' )
219
+ }
220
+ doLast {
221
+ String [] libJars = java.util.Optional . ofNullable(file(' dist/lib' ). list()). orElse(new String [0 ])
222
+ pluginProjects. forEach(subProject -> {
223
+ var pluginType = subProject. properties. get(' pluginType' )
224
+ var pluginName = subProject. properties. get(' pluginName' )
225
+ logger. lifecycle(' Install plugin: pluginType: {}, pluginInstanceName: {}, module: {}' , pluginType,
226
+ pluginName, subProject. name)
227
+ copy {
228
+ from subProject. jar. archivePath
229
+ into rootProject. file(" dist/plugin/${ pluginType} /${ pluginName} " )
230
+ }
231
+ copy {
232
+ from subProject. configurations. runtimeClasspath
233
+ into rootProject. file(" dist/plugin/${ pluginType} /${ pluginName} " )
234
+ exclude(libJars)
235
+ }
236
+ copy {
237
+ from subProject. file(' conf' )
238
+ from subProject. sourceSets. main. resources. srcDirs
239
+ into rootProject. file(" dist/conf" )
240
+ exclude ' META-INF'
241
+ }
242
+ })
166
243
}
167
- String [] libJars = java.util.Optional . ofNullable(new File (" ${ rootDir} /dist/lib" ). list()). orElseGet(() -> new String [0 ])
168
- getAllprojects(). forEach(subProject -> {
169
- var file = new File (" ${ subProject.projectDir} /gradle.properties" )
170
- if (! file. exists()) {
171
- return
172
- }
173
- var properties = new Properties ()
174
- properties. load(new FileInputStream (file))
175
- var pluginType = properties. getProperty(" pluginType" )
176
- var pluginName = properties. getProperty(" pluginName" )
177
- if (pluginType == null || pluginName == null ) {
178
- return
179
- }
180
- var pluginFile = new File (" ${ rootDir} /dist/plugin/${ pluginType} /${ pluginName} " )
181
- if (pluginFile. exists()) {
182
- return
183
- }
184
- pluginFile. mkdirs()
185
- println String . format(
186
- " install plugin, pluginType: %s, pluginInstanceName: %s, module: %s" , pluginType, pluginName, subProject. getName()
187
- )
188
-
189
- copy {
190
- into " ${ rootDir} /dist/plugin/${ pluginType} /${ pluginName} "
191
- from " ${ subProject.getProjectDir()} /dist/apps"
192
- }
193
- copy {
194
- into " ${ rootDir} /dist/plugin/${ pluginType} /${ pluginName} "
195
- from " ${ subProject.getProjectDir()} /dist/lib/"
196
- exclude(libJars)
197
- }
198
- copy {
199
- into " ${ rootDir} /dist/conf"
200
- from " ${ subProject.getProjectDir()} /dist/conf"
201
- exclude ' META-INF'
202
- }
203
- })
204
244
}
205
245
206
- task printProjects ( ) {
246
+ tasks . register( ' printProjects ' ) {
207
247
getAllprojects(). forEach(subProject -> {
208
248
if (" EventMesh" . equals(subProject. getName())) {
209
249
return
@@ -303,77 +343,6 @@ subprojects {
303
343
}
304
344
}
305
345
306
- task dist(dependsOn : [' jar' ]) {
307
- doFirst {
308
- new File (" ${ projectDir} /dist/bin" ). mkdirs()
309
- new File (" ${ projectDir} /dist/apps" ). mkdirs()
310
- new File (" ${ projectDir} /dist/conf" ). mkdirs()
311
- new File (" ${ projectDir} /dist/lib" ). mkdirs()
312
- new File (" ${ projectDir} /dist/licenses" ). mkdirs()
313
- }
314
- Set<String > rootProject = [" eventmesh-common" ,
315
- " eventmesh-storage-api" ,
316
- " eventmesh-metrics-api" ,
317
- " eventmesh-meta-api" ,
318
- " eventmesh-trace-api" ,
319
- " eventmesh-retry-api" ,
320
- " eventmesh-runtime" ,
321
- " eventmesh-security-api" ,
322
- " eventmesh-protocol-api" ,
323
- " eventmesh-starter" ,
324
- " eventmesh-spi" ,
325
- " eventmesh-webhook-api" ,
326
- " eventmesh-webhook-admin" ,
327
- " eventmesh-webhook-receive" ]
328
- doLast {
329
- copy {
330
- into(" ${ projectDir} /dist/apps" )
331
- from project. jar. getArchivePath()
332
- }
333
- copy {
334
- into(" ${ projectDir} /dist/lib" )
335
- from project. configurations. runtimeClasspath
336
- }
337
- copy {
338
- into(" ${ projectDir} /dist/bin" )
339
- from ' bin'
340
- }
341
- copy {
342
- into(" ${ projectDir} /dist/conf" )
343
- from ' conf' , sourceSets. main. resources. srcDirs
344
- setDuplicatesStrategy(DuplicatesStrategy . EXCLUDE )
345
- exclude ' META-INF'
346
- }
347
- if (rootProject. contains(project. name)) {
348
- new File (" ${ rootDir} /dist/apps" ). mkdirs()
349
- new File (" ${ rootDir} /dist/lib" ). mkdirs()
350
- new File (" ${ rootDir} /dist/bin" ). mkdirs()
351
- new File (" ${ rootDir} /dist/conf" ). mkdirs()
352
- copy {
353
- into(" ${ rootDir} /dist/apps" )
354
- from " ${ projectDir} /dist/apps"
355
- }
356
- copy {
357
- into " ${ rootDir} /dist/lib"
358
- from " ${ projectDir} /dist/lib"
359
- exclude " eventmesh-*"
360
- }
361
- copy {
362
- into " ${ rootDir} /dist/bin"
363
- from " ${ projectDir} /dist/bin"
364
- }
365
- copy {
366
- into " ${ rootDir} /dist/conf"
367
- from " ${ projectDir} /dist/conf"
368
- }
369
- }
370
- copy {
371
- into " ${ rootDir} /dist"
372
- from " ${ rootDir} /tools/third-party-licenses"
373
- }
374
- }
375
- }
376
-
377
346
javadoc {
378
347
source = sourceSets. main. java
379
348
destinationDir = reporting. file(" javadoc" )
@@ -491,7 +460,6 @@ subprojects {
491
460
dependency " org.apache.logging.log4j:log4j-api:${ log4jVersion} "
492
461
dependency " org.apache.logging.log4j:log4j-core:${ log4jVersion} "
493
462
dependency " org.apache.logging.log4j:log4j-slf4j2-impl:${ log4jVersion} "
494
- dependency " org.apache.logging.log4j:log4j-slf4j-impl:${ log4jVersion} " // used with SLF4J 1.7.x or older for third-party dependencies
495
463
496
464
dependency " com.lmax:disruptor:3.4.2"
497
465
@@ -513,15 +481,13 @@ subprojects {
513
481
dependency " io.dropwizard.metrics:metrics-annotation:4.1.0"
514
482
dependency " io.dropwizard.metrics:metrics-json:4.1.0"
515
483
516
- dependency ' io.opentelemetry:opentelemetry-api:1.3.0'
517
- dependency ' io.opentelemetry:opentelemetry-sdk:1.3.0'
518
- dependency ' io.opentelemetry:opentelemetry-sdk-metrics:1.3.0-alpha'
519
- dependency ' io.opentelemetry:opentelemetry-exporter-prometheus:1.3.0-alpha'
520
- dependency ' io.prometheus:simpleclient:0.8.1'
521
- dependency ' io.prometheus:simpleclient_httpserver:0.8.1'
522
- dependency ' io.opentelemetry:opentelemetry-exporter-zipkin:1.3.0'
523
- dependency ' io.opentelemetry:opentelemetry-semconv:1.3.0-alpha'
524
- dependency ' io.opentelemetry:opentelemetry-exporter-jaeger:1.4.0'
484
+ dependency ' io.opentelemetry:opentelemetry-api:1.36.0'
485
+ dependency ' io.opentelemetry:opentelemetry-sdk:1.36.0'
486
+ dependency ' io.opentelemetry:opentelemetry-sdk-metrics:1.36.0'
487
+ dependency ' io.opentelemetry:opentelemetry-exporter-prometheus:1.36.0-alpha'
488
+ dependency ' io.opentelemetry:opentelemetry-exporter-zipkin:1.36.0'
489
+ dependency ' io.opentelemetry:opentelemetry-semconv:1.30.1-alpha'
490
+ dependency ' io.opentelemetry:opentelemetry-exporter-jaeger:1.34.1'
525
491
526
492
dependency " io.openmessaging:openmessaging-api:2.2.1-pubsub"
527
493
0 commit comments