eekboom
11/25/2019, 11:22 AMget()
, because main
references a
NamedDomainObjectProvider<SourceSet>
and not an actual SourceSet:
task foo(type: JavaExec) {
classpath sourceSets.main.runtimeClasspath
has become
tasks.create<JavaExec>("foo") {
classpath = sourceSets.main.get().runtimeClasspath
Couple of questions about that:
• Have I now changed the behavior from lazy to eager configuration?
• How does groovy do this magic (i.e. why can I use runtimeClassPath on a Provider)?
• Is there any cleaner way to do this?octylFractal
11/25/2019, 5:33 PMsourceSets["main"].runtimeClasspath
insteadoctylFractal
11/25/2019, 5:33 PMeekboom
11/26/2019, 12:34 PMsourceSets.main.runtimeClasspath
in Groovy versus sourceSets.main.get().runtimeClasspath
in Kotlin.
Does the first also resolve the sourceSet eagerly?