mirror of https://github.com/sbt/sbt.git
Move sys props related things to SysProp
This commit is contained in:
parent
0557171930
commit
c0b6b97990
|
|
@ -167,17 +167,7 @@ object Defaults extends BuildCommon {
|
|||
fileOutputExcludeFilter :== NothingFilter.toNio,
|
||||
inputFileStamper :== sbt.nio.FileStamper.Hash,
|
||||
outputFileStamper :== sbt.nio.FileStamper.LastModified,
|
||||
onChangedBuildSource :== {
|
||||
val sysPropKey = "sbt.build.onchange"
|
||||
sys.props.getOrElse(sysPropKey, "warn") match {
|
||||
case "reload" => sbt.nio.Keys.ReloadOnSourceChanges
|
||||
case "warn" => sbt.nio.Keys.WarnOnSourceChanges
|
||||
case "ignore" => sbt.nio.Keys.IgnoreSourceChanges
|
||||
case unknown =>
|
||||
System.err.println(s"Unknown $sysPropKey: $unknown.\nUsing warn.")
|
||||
sbt.nio.Keys.WarnOnSourceChanges
|
||||
}
|
||||
},
|
||||
onChangedBuildSource :== SysProp.onChangedBuildSource,
|
||||
clean := { () },
|
||||
unmanagedFileStampCache :=
|
||||
state.value.get(persistentFileStampCache).getOrElse(new sbt.nio.FileStamp.Cache),
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import scala.util.control.NonFatal
|
|||
import scala.concurrent.duration._
|
||||
import sbt.internal.util.{ Terminal => ITerminal }
|
||||
import sbt.internal.util.complete.SizeParser
|
||||
import sbt.nio.Keys._
|
||||
|
||||
// See also BuildPaths.scala
|
||||
// See also LineReader.scala
|
||||
|
|
@ -162,4 +163,17 @@ object SysProp {
|
|||
case None => true
|
||||
}
|
||||
}
|
||||
|
||||
def onChangedBuildSource: WatchBuildSourceOption = {
|
||||
val sysPropKey = "sbt.build.onchange"
|
||||
sys.props.getOrElse(sysPropKey, "warn") match {
|
||||
case "reload" => ReloadOnSourceChanges
|
||||
case "warn" => WarnOnSourceChanges
|
||||
case "ignore" => IgnoreSourceChanges
|
||||
case unknown =>
|
||||
System.err.println(s"Unknown $sysPropKey: $unknown.\nUsing warn.")
|
||||
sbt.nio.Keys.WarnOnSourceChanges
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue