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,
|
fileOutputExcludeFilter :== NothingFilter.toNio,
|
||||||
inputFileStamper :== sbt.nio.FileStamper.Hash,
|
inputFileStamper :== sbt.nio.FileStamper.Hash,
|
||||||
outputFileStamper :== sbt.nio.FileStamper.LastModified,
|
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 := { () },
|
clean := { () },
|
||||||
unmanagedFileStampCache :=
|
unmanagedFileStampCache :=
|
||||||
state.value.get(persistentFileStampCache).getOrElse(new sbt.nio.FileStamp.Cache),
|
state.value.get(persistentFileStampCache).getOrElse(new sbt.nio.FileStamp.Cache),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue