Consider the following piece of the build script:
task compile(dependsOn: 'resources') << {
if (classesDir.isDirectory()) {
println 'The class directory exists. I can operate'
}
}
The first thought that popped into my head was that dependsOn: 'resources'
is just "named parameter" like we use when we apply plugin: 'java'
that is converted to a map afterwards. But It's not true, because
task compile([dependsOn: 'resources']) << {
//etc
}
doesn't work. Error that was printed:
Could not find method compile() for arguments [{dependsOn=resources}]
but apply ([plugin: 'java'])
works fine. So what is that, then?