I want to copy stuff from my compiled dependencies. When I try to do that from my main build script, it works fine.
task copyStuff(type: Copy) {
from (configurations.compile) {
include "*.nar"
}
into "${buildDir}/nar/download"
}
However, within a plugin it doesn’t work. By simply copying the above code into the apply{} block and preceding it with a “project.” it gives me the error that it doesn’t know what “Copy” is. When I also try to import “org.gradle.api.tasks.Copy”, all error messages disappear, but nothing happens in terms of actually copying.
project.task('copyStuff', type: Copy) {
from (project.configurations.compile) {
include "*.nar"
}
into "${project.buildDir}/nar/download"
}
:copyStuff
Skipping task ':copyStuff' as it has no source files.
:copyStuff UP-TO-DATE
I… What? Why is this happening? Literally all I need to do is to attach a “type” to my task and suddenly it’s getting skipped due to no apparent source file.