I try to understand lazy properties as described here: Lazy Configuration
I’d like to be able to change the value of a custom task property during execution phase. As far as I understand the documentation, this should be possible:
Lazy properties are intended to be passed around and only queried when required. Usually, this will happen during the execution phase.
The property in my custom task is defined like this:
@Input
public abstract Property<String> getModeldir();
The build file:
def foo = "a"
task fubar() {
doLast {
foo = "b"
println foo
}
}
task validateData(type: MyCustomTask, dependsOn: 'fubar') {
modeldir = foo
}
In my custom task getModeldir().get()
will still output “a” and not “b” as expected. So I guess my expectation is wrong.
Thanks for any clarification.
Stefan