Skip to content

Commit

Permalink
Fix build script to run with Gradle 7 (#69)
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.

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
  • Loading branch information
andsel and jsvd committed Oct 27, 2021
1 parent 21aaa53 commit 3b8783a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Unreleased
- Fixed Gradle's script to use Gradle 7 [#69](https://github.com/logstash-plugins/logstash-input-azure_event_hubs/pull/69)

## 1.4.0
- Updated the minor version of Azure SDK and other dependencies to ensure users of this plugin get upstream fixes and improvements [#67](https://github.com/logstash-plugins/logstash-input-azure_event_hubs/pull/67)

Expand Down
28 changes: 15 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,39 @@ repositories {
}

dependencies {
testCompile 'junit:junit:4.12'

compile 'com.microsoft.azure:azure-eventhubs:2.3.2'
compile 'com.microsoft.azure:qpid-proton-j-extensions:1.2.4'
compile 'com.microsoft.azure:azure-eventhubs-eph:2.5.2'
compile 'com.microsoft.azure:azure-storage:8.6.6'
runtime 'com.google.code.gson:gson:2.8.5'
runtime 'org.apache.qpid:proton-j:0.33.9'
compile 'org.apache.logging.log4j:log4j-api:2.9.1'
runtime 'org.apache.logging.log4j:log4j-slf4j-impl:2.9.1'
testImplementation 'junit:junit:4.12'

implementation 'com.microsoft.azure:azure-eventhubs:2.3.2'
implementation 'com.microsoft.azure:qpid-proton-j-extensions:1.2.4'
implementation 'com.microsoft.azure:azure-eventhubs-eph:2.5.2'
implementation 'com.microsoft.azure:azure-storage:8.6.6'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'org.apache.qpid:proton-j:0.33.9'
implementation 'org.apache.logging.log4j:log4j-api:2.9.1'
implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.9.1'
}


task generateGemJarRequiresFile {
configurations.implementation.canBeResolved = true
doLast {
File jars_file = file('lib/logstash-input-azure_event_hubs.rb')
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.implementation.allDependencies.each {
w << "require_jar(\'${it.group}\', \'${it.name}\', \'${it.version}\')\n"
}
}
}
}

task vendor {
configurations.implementation.canBeResolved = true
doLast {
String vendorPathPrefix = "vendor/jar-dependencies"
configurations.runtime.allDependencies.each { dep ->
File f = configurations.runtime.filter { it.absolutePath.contains("${dep.group}" + File.separator + "${dep.name}" + File.separator + "${dep.version}") }.singleFile
configurations.implementation.allDependencies.each { dep ->
File f = configurations.implementation.filter { it.absolutePath.contains("${dep.group}" + File.separator + "${dep.name}" + File.separator + "${dep.version}") }.singleFile
String groupPath = dep.group.replaceAll('\\.', '/')
File newJarFile = file("${vendorPathPrefix}" + File.separator + "${groupPath}" + File.separator + "${dep.name}"+ File.separator + "${dep.version}" + File.separator + "${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
6 changes: 3 additions & 3 deletions lib/logstash-input-azure_event_hubs.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# AUTOGENERATED BY THE GRADLE SCRIPT. DO NOT EDIT.

require 'jar_dependencies'
require_jar('com.google.code.gson', 'gson', '2.8.5')
require_jar('org.apache.qpid', 'proton-j', '0.33.9')
require_jar('org.apache.logging.log4j', 'log4j-slf4j-impl', '2.9.1')
require_jar('com.microsoft.azure', 'azure-eventhubs', '2.3.2')
require_jar('com.microsoft.azure', 'qpid-proton-j-extensions', '1.2.4')
require_jar('com.microsoft.azure', 'azure-eventhubs-eph', '2.5.2')
require_jar('com.microsoft.azure', 'azure-storage', '8.6.6')
require_jar('com.google.code.gson', 'gson', '2.8.5')
require_jar('org.apache.qpid', 'proton-j', '0.33.9')
require_jar('org.apache.logging.log4j', 'log4j-api', '2.9.1')
require_jar('org.apache.logging.log4j', 'log4j-slf4j-impl', '2.9.1')

0 comments on commit 3b8783a

Please sign in to comment.