How can I provide an optional property for task?
class CustomTask extends DefaultTask {
@Input
Closure preconfig
// ...
}
This way obligates user to provide preconfig
closure as parameter when defining task with CustomTask
type.
How can I achieve declarative way other than defining methods to set properties?
class CustomTask extends DefaultTask {
@Input
Closure preconfig
def preconfig(Closure c){
this.preconfig = c
}
// ...
}
@Optional
in a build.gradle file? For example if I have something like: task npmBuild (type: Exec) { inputs.dir './src' ... , can I make this optional? – Riff