Skip to content

Commit 683d3e0

Browse files
authored
Switch to 'runtimeClasspath' instead of resolve 'implementation' configuration (#70)
In PR #69 the build.gradle was updated to run on Gradle 7, part of the change consisted in forcing the resolution of 'implementation' configuration to use it in the listing of dependencies. This could be assolved by the 'runtimeClasspath' without forcing the resolution which smells like a trick. Relates #69
1 parent 3b8783a commit 683d3e0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

build.gradle

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,23 @@ dependencies {
2828

2929

3030
task generateGemJarRequiresFile {
31-
configurations.implementation.canBeResolved = true
3231
doLast {
3332
File jars_file = file('lib/logstash-input-azure_event_hubs.rb')
3433
jars_file.newWriter().withWriter { w ->
3534
w << "# AUTOGENERATED BY THE GRADLE SCRIPT. DO NOT EDIT.\n\n"
3635
w << "require \'jar_dependencies\'\n"
37-
configurations.implementation.allDependencies.each {
36+
configurations.runtimeClasspath.allDependencies.each {
3837
w << "require_jar(\'${it.group}\', \'${it.name}\', \'${it.version}\')\n"
3938
}
4039
}
4140
}
4241
}
4342

4443
task vendor {
45-
configurations.implementation.canBeResolved = true
4644
doLast {
4745
String vendorPathPrefix = "vendor/jar-dependencies"
48-
configurations.implementation.allDependencies.each { dep ->
49-
File f = configurations.implementation.filter { it.absolutePath.contains("${dep.group}" + File.separator + "${dep.name}" + File.separator + "${dep.version}") }.singleFile
46+
configurations.runtimeClasspath.allDependencies.each { dep ->
47+
File f = configurations.runtimeClasspath.filter { it.absolutePath.contains("${dep.group}" + File.separator + "${dep.name}" + File.separator + "${dep.version}") }.singleFile
5048
String groupPath = dep.group.replaceAll('\\.', '/')
5149
File newJarFile = file("${vendorPathPrefix}" + File.separator + "${groupPath}" + File.separator + "${dep.name}"+ File.separator + "${dep.version}" + File.separator + "${dep.name}-${dep.version}.jar")
5250
newJarFile.mkdirs()

0 commit comments

Comments
 (0)