You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You want to customize onLoad. But you need to get information about the current project, therefore using Project.extract(state).
The first time you reload your build, you'll find out that your build load doesn't end because it's stuck in a recursive load. This happens because Project.extract invokes the load hooks recursively, never ending the recursion.
The solution to it is to define your own attribute and add/remove it appropriately.
An example on how to do this can be found in this build. The previous StackOverflow thread also shows how to do it.
expectation
Sbt handle this use case gracefully, without requiring me to short-circuit the recursion manually.
onLoad is becoming popular, and most of the times that users want to modify the state they want to get information from Extracted. I expect people to hit this problem often.
sbt version: all sbt versions
The text was updated successfully, but these errors were encountered:
problem
You want to customize
onLoad
. But you need to get information about the current project, therefore usingProject.extract(state)
.The first time you reload your build, you'll find out that your build load doesn't end because it's stuck in a recursive load. This happens because
Project.extract
invokes the load hooks recursively, never ending the recursion.There is precedent of people being confused by this: https://stackoverflow.com/questions/27760279/how-can-i-apply-setting-changes-on-onload-hook-in-sbt.
The solution to it is to define your own attribute and add/remove it appropriately.
An example on how to do this can be found in this build. The previous StackOverflow thread also shows how to do it.
expectation
Sbt handle this use case gracefully, without requiring me to short-circuit the recursion manually.
onLoad
is becoming popular, and most of the times that users want to modify the state they want to get information fromExtracted
. I expect people to hit this problem often.sbt version: all sbt versions
The text was updated successfully, but these errors were encountered: