Kirill Grouchnikov
08/31/2021, 2:05 AMCopy
task with subprojects.findAll { /* some condition */ }.collect { it.configurations.compileClasspath }
Kirill Grouchnikov
08/31/2021, 2:05 AMcompileClasspath
for kotlin modules in build.gradle.kts
worldGabriel Ittner
08/31/2021, 12:04 PMgetByName("compileClasspath")
in KTS https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.ConfigurationContainer.html#org.gradle.api.artifacts.ConfigurationContainer:getByName(java.lang.String)Gabriel Ittner
08/31/2021, 12:05 PMruntimeClasspath
the compile one also has compileOnly dependencies and won't include some transitive dependenciesKirill Grouchnikov
08/31/2021, 1:02 PMprintln(configurations.getByName("compileClasspath").map { file: File -> file.name })
gives me Resolving dependency configuration 'compileClasspath' is not allowed as it is defined as 'canBeResolved=false'
Kirill Grouchnikov
08/31/2021, 1:03 PMprintln(configurations.getByName("runtimeClasspath").map { file: File -> file.name })
gives me Configuration with name 'runtimeClasspath' not found.
Kirill Grouchnikov
08/31/2021, 1:09 PMtasks.register("getDependencies") {
subprojects {
println("For ${project.name}")
val myCompileClasspath by configurations.creating {
extendsFrom(configurations["compileClasspath"])
isCanBeResolved = true
isCanBeConsumed = false
}
println(myCompileClasspath.map { file: File -> file.name })
}
}
Kirill Grouchnikov
08/31/2021, 1:10 PMKirill Grouchnikov
08/31/2021, 1:10 PMRob Elliot
09/07/2021, 1:57 PMcompileClasspath
rather than runtimeClasspath
, if you want “all jars that are runtime dependencies”?
FWIW this is currently working for me in a plugin project:
val project: Project = TODO()
val runtimeClasspath: Provider<Configuration> = project.configurations.named("runtimeClasspath")
Kirill Grouchnikov
09/07/2021, 3:59 PMConfiguration with name 'runtimeClasspath' not found.