@@ -25,7 +25,7 @@ buildscript {
25
25
repositories {
26
26
mavenCentral()
27
27
maven {
28
- url ' https://plugins.gradle.org/m2/'
28
+ url = ' https://plugins.gradle.org/m2/'
29
29
}
30
30
}
31
31
}
@@ -103,16 +103,16 @@ allprojects {
103
103
testLogging {
104
104
// set options for log level LIFECYCLE
105
105
events " passed" , " skipped" , " failed" , " standardOut"
106
- showExceptions true
107
- exceptionFormat " full"
108
- showCauses true
109
- showStackTraces true
110
- enableAssertions false
106
+ showExceptions = true
107
+ exceptionFormat = " full"
108
+ showCauses = true
109
+ showStackTraces = true
110
+ enableAssertions = false
111
111
112
112
// set options for log level DEBUG and INFO
113
113
debug {
114
114
events " started" , " passed" , " skipped" , " failed" , " standardOut" , " standardError"
115
- exceptionFormat " full"
115
+ exceptionFormat = " full"
116
116
}
117
117
info. events = debug. events
118
118
info. exceptionFormat = debug. exceptionFormat
@@ -133,7 +133,7 @@ subprojects {
133
133
repositories {
134
134
mavenCentral()
135
135
maven {
136
- url ' https://plugins.gradle.org/m2/'
136
+ url = ' https://plugins.gradle.org/m2/'
137
137
}
138
138
}
139
139
@@ -165,8 +165,9 @@ tasks.register("configureArchitecture") {
165
165
166
166
tasks. register(" configureArtifactInfo" ) {
167
167
dependsOn configureArchitecture
168
- description " Set the url to download stack artifacts for select stack version"
168
+ description = " Set the url to download stack artifacts for select stack version"
169
169
170
+ def projectRef = project
170
171
doLast {
171
172
def splitVersion = version. split(' \\ .' )
172
173
int major = splitVersion[0 ]. toInteger()
@@ -189,28 +190,28 @@ tasks.register("configureArtifactInfo") {
189
190
}
190
191
}
191
192
192
- project . ext. set(" artifactApiVersion" , qualifiedVersion)
193
+ projectRef . ext. set(" artifactApiVersion" , qualifiedVersion)
193
194
}
194
195
}
195
196
196
197
tasks. register(" markAliasDefinitions" , SignAliasDefinitions ) {
197
- description " Create an hashes aliases file from original aliases yml definition"
198
+ description = " Create an hashes aliases file from original aliases yml definition"
198
199
hashedFile = project. file(" ${ project.buildDir} /plugin_aliases_hashed.yml" )
199
200
}
200
201
201
202
tasks. register(" markTestAliasDefinitions" , SignAliasDefinitions ) {
202
- description " Create an hashes aliases file for testing aliases yml definition"
203
+ description = " Create an hashes aliases file for testing aliases yml definition"
203
204
stage SignAliasDefinitions.Stage . test
204
205
hashedFile = project. file(" ${ project.buildDir} /plugin_aliases_hashed_test.yml" )
205
206
}
206
207
207
208
tasks. register(" copyPluginAlias" , Copy ) {
208
- description " Copy the marked plugin_aliases.yml file to destination folders"
209
+ description = " Copy the marked plugin_aliases.yml file to destination folders"
209
210
dependsOn = [copyPluginAlias_ruby, copyPluginAlias_java]
210
211
}
211
212
212
213
tasks. register(" copyPluginAlias_ruby" , Copy ) {
213
- description " Copy the marked plugin_aliases.yml file to destination folders"
214
+ description = " Copy the marked plugin_aliases.yml file to destination folders"
214
215
dependsOn " markAliasDefinitions"
215
216
216
217
inputs. file(" ${ buildDir} /plugin_aliases_hashed.yml" )
@@ -222,7 +223,7 @@ tasks.register("copyPluginAlias_ruby", Copy) {
222
223
}
223
224
224
225
tasks. register(" copyPluginAlias_java" , Copy ) {
225
- description " Copy the marked plugin_aliases.yml file to destination folders"
226
+ description = " Copy the marked plugin_aliases.yml file to destination folders"
226
227
dependsOn " markAliasDefinitions"
227
228
228
229
inputs. file(" ${ buildDir} /plugin_aliases_hashed.yml" )
@@ -234,12 +235,12 @@ tasks.register("copyPluginAlias_java", Copy) {
234
235
}
235
236
236
237
tasks. register(" copyPluginTestAlias" ) {
237
- description " Copy the marked test plugin_aliases.yml file to destination folders"
238
+ description = " Copy the marked test plugin_aliases.yml file to destination folders"
238
239
dependsOn = [copyPluginTestAlias_ruby, copyPluginTestAlias_java]
239
240
}
240
241
241
242
tasks. register(" copyPluginTestAlias_ruby" , Copy ) {
242
- description " Copy the marked test plugin_aliases.yml file into Ruby's plugin_manager specs"
243
+ description = " Copy the marked test plugin_aliases.yml file into Ruby's plugin_manager specs"
243
244
dependsOn " markTestAliasDefinitions"
244
245
245
246
inputs. file(markTestAliasDefinitions. hashedFile)
@@ -251,7 +252,7 @@ tasks.register("copyPluginTestAlias_ruby", Copy) {
251
252
}
252
253
253
254
tasks. register(" copyPluginTestAlias_java" , Copy ) {
254
- description " Copy the marked test plugin_aliases.yml file into logstash-core's test resources"
255
+ description = " Copy the marked test plugin_aliases.yml file into logstash-core's test resources"
255
256
dependsOn " markTestAliasDefinitions"
256
257
257
258
inputs. file(" ${ buildDir} /plugin_aliases_hashed_test.yml" )
@@ -447,30 +448,39 @@ tasks.register("installIntegrationTestGems") {
447
448
}
448
449
}
449
450
450
- tasks. register(" downloadFilebeat" ) {
451
- dependsOn configureArtifactInfo
452
- description " Download Filebeat Snapshot for current branch version: ${ version} "
451
+ tasks. register(" prepareFilebeatDownload" ) {
452
+ dependsOn configureArtifactInfo
453
+
454
+ def projectRef = project
455
+ doLast {
456
+ String beatsVersion = projectRef. ext. get(" artifactApiVersion" )
457
+ String downloadedFilebeatName = " filebeat-${ beatsVersion} -${ projectRef.ext.get("beatsArchitecture")} "
458
+ projectRef. ext. set(" unpackedFilebeatName" , downloadedFilebeatName)
459
+
460
+ def res = SnapshotArtifactURLs . packageUrls(" beats" , beatsVersion, downloadedFilebeatName)
461
+ projectRef. ext. set(" filebeatSnapshotUrl" , System . getenv(" FILEBEAT_SNAPSHOT_URL" ) ?: res. packageUrl)
462
+ projectRef. ext. set(" filebeatDownloadLocation" , " ${ projectDir} /build/${ downloadedFilebeatName} .tar.gz" )
463
+ }
464
+ }
465
+
466
+ tasks. register(" downloadFilebeat" , Download ) {
467
+ dependsOn prepareFilebeatDownload
468
+ description = " Download Filebeat Snapshot for current branch version: ${ version} "
453
469
454
470
project. ext. set(" versionFound" , true )
455
471
inputs. file(" ${ projectDir} /versions.yml" )
456
472
457
- doLast {
458
- download {
459
- String beatsVersion = project. ext. get(" artifactApiVersion" )
460
- String downloadedFilebeatName = " filebeat-${ beatsVersion} -${ project.ext.get("beatsArchitecture")} "
461
- project. ext. set(" unpackedFilebeatName" , downloadedFilebeatName)
473
+ def projectRef = project
462
474
463
- def res = SnapshotArtifactURLs . packageUrls( " beats " , beatsVersion, downloadedFilebeatName)
464
- project . ext. set( " filebeatSnapshotUrl" , System . getenv( " FILEBEAT_SNAPSHOT_URL " ) ?: res . packageUrl)
465
- project . ext. set( " filebeatDownloadLocation" , " ${ projectDir } /build/ ${ downloadedFilebeatName } .tar.gz " )
475
+ // Use lazy configuration to get values after prepareFilebeatDownload runs
476
+ src { projectRef . ext. filebeatSnapshotUrl }
477
+ dest { new File (projectRef . ext. filebeatDownloadLocation) }
466
478
467
- src project . ext . filebeatSnapshotUrl
468
- onlyIfNewer true
479
+ onlyIfNewer true
480
+ retries 3
469
481
470
- dest new File (project. ext. filebeatDownloadLocation)
471
- retries 3
472
- }
473
- System . out. println " Downloaded to ${ project.ext.filebeatDownloadLocation} "
482
+ doLast {
483
+ System . out. println " Downloaded to ${ projectRef.ext.filebeatDownloadLocation} "
474
484
}
475
485
}
476
486
@@ -495,11 +505,12 @@ tasks.register("copyFilebeat") {
495
505
tasks. register(" checkEsSHA" ) {
496
506
dependsOn configureArtifactInfo
497
507
498
- description " Download ES version remote's fingerprint file"
508
+ description = " Download ES version remote's fingerprint file"
499
509
510
+ def projectRef = project
500
511
doLast {
501
- String esVersion = project . ext. get(" artifactApiVersion" )
502
- String downloadedElasticsearchName = " elasticsearch-${ esVersion} -${ project .ext.get("esArchitecture")} "
512
+ String esVersion = projectRef . ext. get(" artifactApiVersion" )
513
+ String downloadedElasticsearchName = " elasticsearch-${ esVersion} -${ projectRef .ext.get("esArchitecture")} "
503
514
String remoteSHA
504
515
505
516
def res = SnapshotArtifactURLs . packageUrls(" elasticsearch" , esVersion, downloadedElasticsearchName)
@@ -529,30 +540,39 @@ tasks.register("checkEsSHA") {
529
540
}
530
541
}
531
542
532
- tasks. register(" downloadEs" ) {
533
- dependsOn = [configureArtifactInfo, checkEsSHA]
534
-
535
- description " Download ES Snapshot for current branch version: ${ version} "
536
- inputs. file(" ${ projectDir} /versions.yml" )
543
+ tasks. register(" prepareEsDownload" ) {
544
+ dependsOn configureArtifactInfo
537
545
546
+ def projectRef = project
538
547
doLast {
539
- download {
540
- String esVersion = project. ext. get(" artifactApiVersion" )
541
- String downloadedElasticsearchName = " elasticsearch-${ esVersion} -${ project.ext.get("esArchitecture")} "
548
+ String esVersion = projectRef. ext. get(" artifactApiVersion" )
549
+ String downloadedElasticsearchName = " elasticsearch-${ esVersion} -${ projectRef.ext.get("esArchitecture")} "
542
550
543
- project . ext. set(" unpackedElasticsearchName" , " elasticsearch-${ esVersion} " )
551
+ projectRef . ext. set(" unpackedElasticsearchName" , " elasticsearch-${ esVersion} " )
544
552
545
- def res = SnapshotArtifactURLs . packageUrls(" elasticsearch" , esVersion, downloadedElasticsearchName)
546
- project. ext. set(" elasticsearchSnapshotURL" , System . getenv(" ELASTICSEARCH_SNAPSHOT_URL" ) ?: res. packageUrl)
547
- project. ext. set(" elasticsearchDownloadLocation" , " ${ projectDir} /build/${ downloadedElasticsearchName} .tar.gz" )
553
+ def res = SnapshotArtifactURLs . packageUrls(" elasticsearch" , esVersion, downloadedElasticsearchName)
554
+ projectRef. ext. set(" elasticsearchSnapshotURL" , System . getenv(" ELASTICSEARCH_SNAPSHOT_URL" ) ?: res. packageUrl)
555
+ projectRef. ext. set(" elasticsearchDownloadLocation" , " ${ projectDir} /build/${ downloadedElasticsearchName} .tar.gz" )
556
+ }
557
+ }
548
558
549
- src project . ext . elasticsearchSnapshotURL
550
- onlyIfNewer true
551
- retries 3
552
- dest new File (project . ext . elasticsearchDownloadLocation)
553
- }
559
+ tasks . register( " downloadEs " , Download ) {
560
+ dependsOn = [prepareEsDownload, checkEsSHA]
561
+
562
+ description = " Download ES Snapshot for current branch version: ${ version } "
563
+ inputs . file( " ${ projectDir } /versions.yml " )
554
564
555
- System . out. println " Downloaded to ${ project.ext.elasticsearchDownloadLocation} "
565
+ def projectRef = project
566
+
567
+ src { projectRef. ext. elasticsearchSnapshotURL }
568
+ dest { new File (projectRef. ext. elasticsearchDownloadLocation) }
569
+
570
+ onlyIfNewer true
571
+ overwrite false
572
+ retries 3
573
+
574
+ doLast {
575
+ System . out. println " Downloaded to ${ projectRef.ext.elasticsearchDownloadLocation} "
556
576
}
557
577
}
558
578
@@ -609,7 +629,7 @@ tasks.register("generateLicenseReport", JavaExec) {
609
629
String noticePath = " NOTICE.txt"
610
630
611
631
classpath = project. files([jarFile])
612
- main = " org.logstash.dependencies.Main"
632
+ mainClass = " org.logstash.dependencies.Main"
613
633
args licenseReportInputCSV,
614
634
project. getBuildDir(). toString() + " /licenseReportFolders.txt" ,
615
635
licenseReportOutputCSV, noticePath
@@ -828,7 +848,7 @@ tasks.register("downloadJdk", Download) {
828
848
829
849
def jdkDetails = new JDKDetails (gradle. ext. versions. bundled_jdk, osName, jdkArch)
830
850
831
- description " Download JDK ${ jdkDetails.major} , OS: ${ osName} "
851
+ description = " Download JDK ${ jdkDetails.major} , OS: ${ osName} "
832
852
833
853
// find url of build artifact
834
854
String artifactApiUrl = jdkDetails. createDownloadUrl()
0 commit comments