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