mirror of https://github.com/sbt/sbt.git
Fixes #2302. Don't check pre and post conditions in sbt.Execute by default.
The checking code has bad run time characteristics and would need to be fixed for large projects with deep task dependency chains. The code in sbt.Execute has been in production for a long time so it seems safe enough to drop the extra checks by default. To debug issues, you can set `-Dsbt.execute.extrachecks=true` to revert to the old behavior.
This commit is contained in:
parent
4e8d5e827e
commit
5beb602919
|
|
@ -21,6 +21,8 @@ private[sbt] object Execute {
|
||||||
|
|
||||||
def config(checkCycles: Boolean, overwriteNode: Incomplete => Boolean = const(false)): Config = new Config(checkCycles, overwriteNode)
|
def config(checkCycles: Boolean, overwriteNode: Incomplete => Boolean = const(false)): Config = new Config(checkCycles, overwriteNode)
|
||||||
final class Config private[sbt] (val checkCycles: Boolean, val overwriteNode: Incomplete => Boolean)
|
final class Config private[sbt] (val checkCycles: Boolean, val overwriteNode: Incomplete => Boolean)
|
||||||
|
|
||||||
|
final val checkPreAndPostConditions = sys.props.get("sbt.execute.extrachecks").exists(java.lang.Boolean.parseBoolean)
|
||||||
}
|
}
|
||||||
sealed trait Completed {
|
sealed trait Completed {
|
||||||
def process(): Unit
|
def process(): Unit
|
||||||
|
|
@ -341,8 +343,6 @@ private[sbt] final class Execute[A[_] <: AnyRef](config: Config, triggers: Trigg
|
||||||
def added(d: A[_]) = state contains d
|
def added(d: A[_]) = state contains d
|
||||||
def complete = state.values.forall(_ == Done)
|
def complete = state.values.forall(_ == Done)
|
||||||
|
|
||||||
import scala.annotation.elidable
|
def pre(f: => Unit) = if (checkPreAndPostConditions) f
|
||||||
import elidable._
|
def post(f: => Unit) = if (checkPreAndPostConditions) f
|
||||||
@elidable(ASSERTION) def pre(f: => Unit) = f
|
|
||||||
@elidable(ASSERTION) def post(f: => Unit) = f
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue