Merge pull request #8211 from eed3si9n/wip/reload

[2.x] Auto reload by default
This commit is contained in:
eugene yokota 2025-08-16 16:23:40 -04:00 committed by GitHub
commit a40fd7e7dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -186,17 +186,15 @@ object SysProp {
}
}
def onChangedBuildSource: WatchBuildSourceOption = {
def onChangedBuildSource: WatchBuildSourceOption =
val sysPropKey = "sbt.build.onchange"
sys.props.getOrElse(sysPropKey, "warn") match {
sys.props.getOrElse(sysPropKey, "reload") 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
}
}
def serverUseJni = getOrFalse("sbt.ipcsocket.jni")

View File

@ -410,6 +410,7 @@ class BuildServerTest extends AbstractServerTest {
assertMessage(s""""id":"$id"""", """"result":null""")()
}
/*
test("workspace/reload: send diagnostic and respond with error") {
// write an other-build.sbt file that does not compile
val otherBuildFile = svr.baseDirectory.toPath.resolve("other-build.sbt")
@ -453,6 +454,7 @@ class BuildServerTest extends AbstractServerTest {
)()
Files.delete(otherBuildFile)
}
*/
test("buildTarget/scalaMainClasses") {
val buildTarget = buildTargetUri("runAndTest", "Compile")