mirror of https://github.com/sbt/sbt.git
This commit finally fixes #241 by adding support for sbt to either print a warning or automatically reload the project if the metabuild sources have changed. To facilitate this, I introduce a new key, metaBuildSourceOption which has three options: 1) IgnoreSourceChanges 2) WarnOnSourceChanges 3) ReloadOnSourceChanges When the former is set, sbt will not check if the meta build sources have changed. Otherwise, sbt will use the buildStructure / fileInputs to get the ChangedFiles for the metabuild. If there are any changes, it will either warn or reload the build depending on the value of metaBuildSourceOption. The mechanism for diffing the files is that I add a step to EvaluateTask where, if the project has been loaded and metaBuildSourceOption != IgnoreSourceChanges, we evaluate the needReload task. If we need a reload, we return an error that indicates that a Reload is necessary. When that error is detected, the MainLoop will prepend "reload" to the pending commands for the state. Otherwise we just print a warning and continue. I benchmarked the overhead of this and it wasn't too bad. I generally saw it taking 5-20ms to perform the check. Since this is only done once per task evaluation run, I don't think it's a big deal. When IgnoreSourceChanges is set, there is O(10us) overhead. If performance does become a problem, we could add a global watch service and skip the needReload evaluation if no files have been modified. I removed the watchTrackMetaBuild key and made it so that the continuous builds only track the meta build when metaBuildSourceOption == ReloadOnSourceChanges |
||
|---|---|---|
| .github | ||
| core-macros/src/main/scala/sbt/internal/util/appmacro | ||
| internal | ||
| launch | ||
| licenses | ||
| main | ||
| main-actions/src | ||
| main-command/src | ||
| main-settings/src | ||
| notes | ||
| project | ||
| protocol/src/main | ||
| run | ||
| sbt/src | ||
| scripted-plugin/src/main/scala/sbt | ||
| scripted-sbt-old/src/main/scala/sbt/test | ||
| scripted-sbt-redux | ||
| src/main/conscript | ||
| tasks | ||
| tasks-standard | ||
| testing | ||
| vscode-sbt-scala | ||
| zinc-lm-integration/src | ||
| .appveyor.yml | ||
| .gitattributes | ||
| .gitignore | ||
| .java-version | ||
| .sbtopts | ||
| .scalafmt.conf | ||
| .travis.yml | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| NOTICE | ||
| PROFILING.md | ||
| README.md | ||
| SUPPORT.md | ||
| build.sbt | ||
| reset.sh | ||
| sbt-allsources.sh | ||
| server.md | ||
README.md
sbt
sbt is a build tool for Scala, Java, and more.
For general documentation, see http://www.scala-sbt.org/.
sbt 1.x
This is the 1.x series of sbt. The source code of sbt is split across several Github repositories, including this one.
- sbt/io hosts
sbt.iomodule. - sbt/util hosts a collection of internally used modules.
- sbt/librarymanagement hosts
sbt.librarymanagementmodule that wraps Ivy. - sbt/zinc hosts Zinc, an incremental compiler for Scala.
- sbt/sbt, this repository hosts modules that implements the build tool.
Other links
- Setup: Describes getting started with the latest binary release.
- FAQ: Explains how to get help and more.
- sbt/sbt-zero-seven: hosts sbt 0.7.7 and earlier versions
Issues and Pull Requests
Please read CONTRIBUTING carefully before opening a GitHub Issue.
The short version: try searching or asking on StackOverflow.
license
See LICENSE.