Skip to content

Commit

Permalink
Fix build script to run with Gradle 7 (#145)
Browse files Browse the repository at this point in the history
Update the Gradle wrapper used to version 7.2 and fixed build.gradle script.
  • Loading branch information
andsel authored Oct 27, 2021
1 parent 44ef935 commit ac65746
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Unreleased
- Fix: update to Gradle 7 [#145](https://github.com/logstash-plugins/logstash-input-http/pull/145)

## 3.4.2
- Docs: added `v8` as an acceptable value for `ecs_compatibility` [#142](https://github.com/logstash-plugins/logstash-input-http/pull/142)

Expand Down
22 changes: 11 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ repositories {
}

dependencies {
testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-library:1.3'
testCompile 'org.apache.logging.log4j:log4j-core:2.11.1'
testImplementation 'junit:junit:4.12'
testImplementation 'org.hamcrest:hamcrest-library:1.3'
testImplementation 'org.apache.logging.log4j:log4j-core:2.11.1'

compile 'io.netty:netty-all:4.1.65.Final'
compile 'org.apache.logging.log4j:log4j-api:2.11.1'
implementation 'io.netty:netty-all:4.1.65.Final'
implementation 'org.apache.logging.log4j:log4j-api:2.11.1'
}

test {
Expand All @@ -33,13 +33,13 @@ test {
}
}

task run (type: JavaExec, dependsOn: classes){
task run (type: JavaExec, dependsOn: classes) {
// turn on or off ssl
if(project.hasProperty('providedargs')){
if (project.hasProperty('providedargs')) {
args(providedargs.split(','))
}
description = "Plugin testing"
main = "org.logstash.plugins.input.http.Runner"
mainClass = "org.logstash.plugins.input.http.Runner"
classpath = sourceSets.main.runtimeClasspath
}

Expand All @@ -49,7 +49,7 @@ task generateGemJarRequiresFile {
jars_file.newWriter().withWriter { w ->
w << "# AUTOGENERATED BY THE GRADLE SCRIPT. DO NOT EDIT.\n\n"
w << "require \'jar_dependencies\'\n"
configurations.runtime.allDependencies.each {
configurations.runtimeClasspath.allDependencies.each {
w << "require_jar(\'${it.group}\', \'${it.name}\', \'${it.version}\')\n"
}
w << "require_jar(\'${project.group}\', \'${project.name}\', \'${project.version}\')\n"
Expand All @@ -60,8 +60,8 @@ task generateGemJarRequiresFile {
task vendor {
doLast {
String vendorPathPrefix = "vendor/jar-dependencies"
configurations.runtime.allDependencies.each { dep ->
File f = configurations.runtime.filter { it.absolutePath.contains("${dep.group}/${dep.name}/${dep.version}") }.singleFile
configurations.runtimeClasspath.allDependencies.each { dep ->
File f = configurations.runtimeClasspath.filter { it.absolutePath.contains("${dep.group}/${dep.name}/${dep.version}") }.singleFile
String groupPath = dep.group.replaceAll('\\.', '/')
File newJarFile = file("${vendorPathPrefix}/${groupPath}/${dep.name}/${dep.version}/${dep.name}-${dep.version}.jar")
newJarFile.mkdirs()
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit ac65746

Please sign in to comment.