I’m working on my first Gradle plugin and I’m running into an issue here.
The plugin should copy all dependencies to the lib directory.
When I implemented this directly in the build script it works fine.
task<Copy>("copyToLibs") {
dependsOn("cleanLibs")
from(compile)
into("lib")
}
I would like to put this into a Gradle plugin.
open class CopyToLibTask : Copy() {
init {
group = "myFirstPlugin"
}
override fun copy() {
from(????) // What should be put here?
into("lib")
}
}
I tried to just use compile
, but that didn’t work.
On other pages I found something like configurations.runtime
, but that doesn’t work either, since it doesn’t know configurations
Finally I tried project.configurations.runtime
. Here I got as far as project.configurations
, but runtime is not known.
Could someone help me out here?