Slackbot
03/06/2023, 12:31 PMephemient
03/06/2023, 1:39 PMprovider {}
? it doesn't carry any dependency information with itJavi
03/06/2023, 1:40 PMit doesn't carry any dependency information with itwhat do you mean with that?
ephemient
03/06/2023, 1:42 PMtasks.named("foo").flatMap { it.outputFile }
without executing anything, it carries information that it is built by :foo
provider { tasks.getByName("foo").outputFile.get() }
this doesn'tJavi
03/06/2023, 1:45 PMtask.named<Foo>("foo").configure { it.prop.set { ... } }
Vampire
03/06/2023, 3:24 PMconvention
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.