Skip to content

Commit 8026068

Browse files
authored
Switch to 'runtimeClasspath' instead of resolve 'implementation' configuration (#433)
In PR #432 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 #432
1 parent f18e4a3 commit 8026068

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
@@ -56,14 +56,12 @@ task run (type: JavaExec, dependsOn: classes){
5656
}
5757

5858
task generateGemJarRequiresFile {
59-
configurations.implementation.canBeResolved = true
60-
6159
doLast {
6260
File jars_file = file('lib/logstash-input-beats_jars.rb')
6361
jars_file.newWriter().withWriter { w ->
6462
w << "# AUTOGENERATED BY THE GRADLE SCRIPT. DO NOT EDIT.\n\n"
6563
w << "require \'jar_dependencies\'\n"
66-
configurations.implementation.allDependencies.each {
64+
configurations.runtimeClasspath.allDependencies.each {
6765
w << "require_jar(\'${it.group}\', \'${it.name}\', \'${it.version}\')\n"
6866
}
6967
w << "require_jar(\'${project.group}\', \'${project.name}\', \'${project.version}\')\n"
@@ -74,8 +72,8 @@ task generateGemJarRequiresFile {
7472
task vendor {
7573
doLast {
7674
String vendorPathPrefix = "vendor/jar-dependencies"
77-
configurations.implementation.allDependencies.each { dep ->
78-
File f = configurations.implementation.filter { it.absolutePath.contains("${dep.group}/${dep.name}/${dep.version}") }.singleFile
75+
configurations.runtimeClasspath.allDependencies.each { dep ->
76+
File f = configurations.runtimeClasspath.filter { it.absolutePath.contains("${dep.group}/${dep.name}/${dep.version}") }.singleFile
7977
String groupPath = dep.group.replaceAll('\\.', '/')
8078
File newJarFile = file("${vendorPathPrefix}/${groupPath}/${dep.name}/${dep.version}/${dep.name}-${dep.version}.jar")
8179
newJarFile.mkdirs()

0 commit comments

Comments
 (0)