Merge pull request #2374 from dwijnand/fport/disable-task-pre-port-checks

FPORT: Fixes #2302. Don't check pre and post conditions in sbt.Execute by default.
This commit is contained in:
eugene yokota 2016-01-16 14:51:45 -05:00
commit fbfb8ec04d
1 changed files with 4 additions and 4 deletions

View File

@ -22,6 +22,8 @@ private[sbt] object Execute {
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 val checkPreAndPostConditions = sys.props.get("sbt.execute.extrachecks").exists(java.lang.Boolean.parseBoolean)
}
sealed trait Completed {
def process(): Unit
@ -342,8 +344,6 @@ private[sbt] final class Execute[A[_] <: AnyRef](config: Config, triggers: Trigg
def added(d: A[_]) = state contains d
def complete = state.values.forall(_ == Done)
import scala.annotation.elidable
import elidable._
@elidable(ASSERTION) def pre(f: => Unit) = f
@elidable(ASSERTION) def post(f: => Unit) = f
def pre(f: => Unit) = if (checkPreAndPostConditions) f
def post(f: => Unit) = if (checkPreAndPostConditions) f
}