mirror of https://github.com/sbt/sbt.git
Support a system property for onChangedBuildSource
Resolve the issue https://github.com/sbt/sbt/issues/5679
This commit is contained in:
parent
b911bad4ee
commit
5bdba54a3c
|
|
@ -167,7 +167,17 @@ object Defaults extends BuildCommon {
|
|||
fileOutputExcludeFilter :== NothingFilter.toNio,
|
||||
inputFileStamper :== sbt.nio.FileStamper.Hash,
|
||||
outputFileStamper :== sbt.nio.FileStamper.LastModified,
|
||||
onChangedBuildSource :== sbt.nio.Keys.WarnOnSourceChanges,
|
||||
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
|
||||
}
|
||||
},
|
||||
clean := { () },
|
||||
unmanagedFileStampCache :=
|
||||
state.value.get(persistentFileStampCache).getOrElse(new sbt.nio.FileStamp.Cache),
|
||||
|
|
|
|||
Loading…
Reference in New Issue