Skip to content

Commit 16a9213

Browse files
committed
Fix build script to run with Gradle 7
1 parent 44ef935 commit 16a9213

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## Unreleased
2+
- Fix: update to Gradle 7 [#145](https://github.com/logstash-plugins/logstash-input-http/pull/145)
3+
14
## 3.4.2
25
- Docs: added `v8` as an acceptable value for `ecs_compatibility` [#142](https://github.com/logstash-plugins/logstash-input-http/pull/142)
36

build.gradle

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ repositories {
1818
}
1919

2020
dependencies {
21-
testCompile 'junit:junit:4.12'
22-
testCompile 'org.hamcrest:hamcrest-library:1.3'
23-
testCompile 'org.apache.logging.log4j:log4j-core:2.11.1'
21+
testImplementation 'junit:junit:4.12'
22+
testImplementation 'org.hamcrest:hamcrest-library:1.3'
23+
testImplementation 'org.apache.logging.log4j:log4j-core:2.11.1'
2424

25-
compile 'io.netty:netty-all:4.1.65.Final'
26-
compile 'org.apache.logging.log4j:log4j-api:2.11.1'
25+
implementation 'io.netty:netty-all:4.1.65.Final'
26+
implementation 'org.apache.logging.log4j:log4j-api:2.11.1'
2727
}
2828

2929
test {
@@ -33,23 +33,25 @@ test {
3333
}
3434
}
3535

36-
task run (type: JavaExec, dependsOn: classes){
36+
task run (type: JavaExec, dependsOn: classes) {
3737
// turn on or off ssl
38-
if(project.hasProperty('providedargs')){
38+
if (project.hasProperty('providedargs')) {
3939
args(providedargs.split(','))
4040
}
4141
description = "Plugin testing"
42-
main = "org.logstash.plugins.input.http.Runner"
42+
mainClass = "org.logstash.plugins.input.http.Runner"
4343
classpath = sourceSets.main.runtimeClasspath
4444
}
4545

4646
task generateGemJarRequiresFile {
47+
configurations.implementation.canBeResolved = true
48+
4749
doLast {
4850
File jars_file = file('lib/logstash-input-http_jars.rb')
4951
jars_file.newWriter().withWriter { w ->
5052
w << "# AUTOGENERATED BY THE GRADLE SCRIPT. DO NOT EDIT.\n\n"
5153
w << "require \'jar_dependencies\'\n"
52-
configurations.runtime.allDependencies.each {
54+
configurations.implementation.allDependencies.each {
5355
w << "require_jar(\'${it.group}\', \'${it.name}\', \'${it.version}\')\n"
5456
}
5557
w << "require_jar(\'${project.group}\', \'${project.name}\', \'${project.version}\')\n"
@@ -60,8 +62,8 @@ task generateGemJarRequiresFile {
6062
task vendor {
6163
doLast {
6264
String vendorPathPrefix = "vendor/jar-dependencies"
63-
configurations.runtime.allDependencies.each { dep ->
64-
File f = configurations.runtime.filter { it.absolutePath.contains("${dep.group}/${dep.name}/${dep.version}") }.singleFile
65+
configurations.implementation.allDependencies.each { dep ->
66+
File f = configurations.implementation.filter { it.absolutePath.contains("${dep.group}/${dep.name}/${dep.version}") }.singleFile
6567
String groupPath = dep.group.replaceAll('\\.', '/')
6668
File newJarFile = file("${vendorPathPrefix}/${groupPath}/${dep.name}/${dep.version}/${dep.name}-${dep.version}.jar")
6769
newJarFile.mkdirs()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)