@@ -72,7 +72,7 @@ dependencies {
72
72
elasticsearchClient(' co.elastic.clients:elasticsearch-java' ) {
73
73
// brings latest version available for 8.x branch
74
74
version {
75
- strictly(' [8.0, 9.0[ ' )
75
+ strictly(' [8.0, 9.0] ' )
76
76
}
77
77
}
78
78
elasticsearchMinimalCore fileTree(dir : { importMinimalElasticsearch. jars }, include : [" *.jar" ])
@@ -257,6 +257,45 @@ task buildElasticsearchLocalDistro(dependsOn: unzipDownloadedElasticsearchSource
257
257
}
258
258
}
259
259
260
+ task buildElasticsearchLogstashBridge (type : Exec ) {
261
+ description " builds logstash-bridge lib module"
262
+
263
+ dependsOn buildElasticsearchLocalDistro
264
+ mustRunAfter buildElasticsearchLocalDistro
265
+
266
+ def logFile = project. file(" ${ buildDir} /logstash-bridge-build.log" )
267
+ doFirst {
268
+ def funneler = new OutputStreamFunneler (new LazyFileOutputStream (logFile))
269
+ standardOutput = funneler. funnelInstance
270
+ errorOutput = funneler. funnelInstance
271
+ }
272
+
273
+ def esSource = " ${ buildDir} /elasticsearch-source/"
274
+ def esBuildDir = " ${ esSource} /build"
275
+
276
+ inputs. dir esSource
277
+ outputs. dir " ${ esBuildDir} /libs/logstash-bridge"
278
+
279
+ ext. buildRoot = esBuildDir
280
+ workingDir esSource
281
+ commandLine " ./gradlew" , " :lib:logstash-bridge:build"
282
+
283
+ ignoreExitValue true // handled in doLast
284
+ doLast {
285
+ def exitValue = executionResult. get(). exitValue
286
+ if (exitValue != 0 ) {
287
+ if (logFile. exists()) {
288
+ println " \n ===== Elasticsearch logstash-bridge build Log ====="
289
+ println logFile. text
290
+ println " ===== End of Elasticsearch logstash-bridge build Log =====\n "
291
+ } else {
292
+ " Elasticsearch logstash-bridge build failed and ${ logFile.path} log does not exist"
293
+ }
294
+ throw new GradleException (" Elasticsearch logstash-bridge build failed, see the logs for details." )
295
+ }
296
+ }
297
+ }
298
+
260
299
task shadeElasticsearchIngestGeoIpModule (type : com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar ) {
261
300
description " Shades embedded dependencies of the Elasticsearch Ingest GeoIP module"
262
301
@@ -316,13 +355,30 @@ task shadeElasticsearchRedactPlugin(type: com.github.jengelman.gradle.plugins.sh
316
355
exclude ' **/module-info.class'
317
356
}
318
357
358
+ task shadeElasticsearchLogstashBridge (type : com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar ) {
359
+ description " Shades the Elasticsearch logstash-bridge jar"
360
+
361
+ dependsOn buildElasticsearchLogstashBridge
362
+
363
+ from(" ${ buildDir} /elasticsearch-source/libs/logstash-bridge/build/distributions" ) {
364
+ include " elasticsearch-logstash-bridge-*.jar"
365
+ }
366
+
367
+ archiveFileName = " elasticsearch-logstash-bridge-shaded.jar"
368
+ destinationDirectory = file(" ${ buildDir} /shaded" )
369
+
370
+ exclude ' **/module-info.class'
371
+ }
372
+
319
373
task importMinimalElasticsearch () {
320
374
description " Imports minimal portions of Elasticsearch localDistro"
321
375
322
376
dependsOn buildElasticsearchLocalDistro
377
+ dependsOn buildElasticsearchLogstashBridge
323
378
dependsOn shadeElasticsearchIngestGeoIpModule
324
379
dependsOn shadeElasticsearchGrokImplementation
325
380
dependsOn shadeElasticsearchRedactPlugin
381
+ dependsOn shadeElasticsearchLogstashBridge
326
382
327
383
ext. jars = " ${ buildDir} /elasticsearch-minimal-jars"
328
384
@@ -341,6 +397,7 @@ task importMinimalElasticsearch() {
341
397
include jarPackageNamed(" lucene-core" )
342
398
include jarPackageNamed(" lucene-analysis-common" )
343
399
}
400
+ from(shadeElasticsearchLogstashBridge)
344
401
from(shadeElasticsearchGrokImplementation)
345
402
from(buildElasticsearchLocalDistro. module(" x-pack-core" ))
346
403
0 commit comments