Workaround mapped value before task completed error for excluded task#576
Conversation
When using provider.map, Gradle has checks that can fail if the provider is used too early. For example: > Querying the mapped value of provider(interface java.util.Set) before > task ':p1:compileScala' has completed is not supported However, it seems those checks can also fire even if the incomplete task is a properly registered dependency and only when accessed from an action. This is possible when using -x to exclude a task. This deserves a Gradle bug, but let's workaround it in the meantime. Fixes google#550
|
I think we should not depend on We are currently requesting an artifact with the following attributes: Actually is not a solution for the bug, it's a bit change for plugin logic. |
I'm fuzzy on how that is plumbed, but I agree. Right now if you try to add directories generated by GenerateProtoTask to SourceSet.java then you get an infinite loop. |
|
gradle/gradle#21179 is bug I filed with Gradle. We'll see where that leads. |
|
See details about compile task here #578 |
When using provider.map, Gradle has checks that can fail if the provider
is used too early. For example:
However, it seems those checks can also fire even if the incomplete task
is a properly registered dependency and only when accessed from an
action. This is possible when using -x to exclude a task. This deserves
a Gradle bug, but let's workaround it in the meantime.
Fixes #550
CC @rougsig, @Thrillpool
This will workaround whatever problem @Toldry experienced, but I expect that was a different issue compared to that seen by Thrillpool. There's a strong risk that there was a legitimate issue in Toldry's build that now will be silent. But without a reproduction not much we can do for something this nuanced.