How do I convert the following groovy snippet
URL[] urls = sourceSets.main.runtimeClasspath.files.collect {
it.toURI().toURL()
}
to kotlin-dsl? Particularly the property sourceSets doesn't seem to available and fails to compile.
How do I access the sourceSets in a task?
There is no
sourceSet
for theruntimeClasspath
. Theclasspath
is different to thesourceSet
. But if you are interested in getting e.g. themain-sourceset
of a project with the kotlin-dsl, here is a snippet:Accessing the sourceSet from a task