[sbt 0.13] Support sourceGenerators += Def.task { ... }#2943
[sbt 0.13] Support sourceGenerators += Def.task { ... }#2943
Conversation
This adds a macro-level hack to support += op for sourceGenerators and resourceGenerators using RHS of Initialize[Task[Seq[File]]]. When the types match up, the macro now calls `.taskValue` automatically.
|
Note that this only works for settings. The macro code to implement this looks scary. Are we sure we want to special case this for settings and @eed3si9n Can you comment on this? |
|
What we colloquially call "tasks" are See discussion in #2942 for more details. |
|
I'm well aware of those details. My comment is that this only works for setting keys (source generators) but it won't work for task keys. We're still forcing users to match the types in that case. |
|
Sure. But why would anyone wrap Task in a Task? |
This is a backport of #2942
Adds an Append instance that extracts taskValue
This adds a macro-level hack to support += op for sourceGenerators and resourceGenerators using RHS of Initialize[Task[Seq[File]]].
When the types match up, the macro now calls
.taskValueautomatically.Before:
After: