This message was deleted.
# community-support
s
This message was deleted.
e
doesn't that have the same issue as
provider {}
? it doesn't carry any dependency information with it
j
it doesn't carry any dependency information with it
what do you mean with that?
e
Copy code
tasks.named("foo").flatMap { it.outputFile }
without executing anything, it carries information that it is built by
:foo
Copy code
provider { tasks.getByName("foo").outputFile.get() }
this doesn't
j
Well, I was thinking overall for plugin extensions, but I would expect that if a task has a property it could be user in the similar way. So for setting a prop in a task
Copy code
task.named<Foo>("foo").configure { it.prop.set { ... } }
v
Not sure what you are asking about. If what you ask is, to remove
convention
and
set
methods that take a value directly and only have same-named methods that take a supplier, so that it is always caclulated lazily, then no that is not a good idea. If you have a value already, you would artificially delay it and thus add artifical totally unnecessary operation time. Besides that you then also very easily add ordering traps again without thinking about it. A user of the API has to decide whether he calculates or already has a value eagerly and set it, or whether he sets some provider that calculates it lazily and maybe also carries task dependency information.
👍 1