How to create settings with dynamic dependencies?

531 Views Asked by At

I want a setting to depend on settings of a dynamic list of other projects (well, executed at SBT setting start up, but dynamic in the sense that it is not hard-coded).

I have Def.dynTask to produce a task with a dynamic dependency on other tasks.

Is there a similar way to do this for settings, i.e. produce a setting with a dynamic dependency on other settings?


Or perhaps I misunderstand settings. FYI, my understanding is that settings are computed once at start up; tasks are computed whenever they are requested.

1

There are 1 best solutions below

1
On

Setting is actually initialized only one per sbt session. The good explanation about that can be found here

If I got your idea in right way, you can do that with TaskKeys and the sbt.Extracted.append method. Be careful, I have faced strange think like this