mirror of https://github.com/sbt/sbt.git
Fix triggered execution
git-svn-id: https://simple-build-tool.googlecode.com/svn/trunk@1009 d89573ee-9141-11dd-94d4-bdf5e562f29c
This commit is contained in:
parent
edead65a2b
commit
7cfcf44bf3
|
|
@ -585,7 +585,7 @@ object Main
|
|||
private def compileContinuously(project: Project) = executeContinuously(project, "test-compile")
|
||||
private def executeContinuously(project: Project, action: String)
|
||||
{
|
||||
def shouldTerminate: Boolean = (System.in.available > 0) && project.terminateWatch(System.in.read()) || shouldTerminate
|
||||
def shouldTerminate: Boolean = (System.in.available > 0) && (project.terminateWatch(System.in.read()) || shouldTerminate)
|
||||
if(checkAction(project, action))
|
||||
{
|
||||
SourceModificationWatch.watchUntil(project, ContinuousCompilePollDelaySeconds)(shouldTerminate)
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ trait Project extends TaskManager with Dag[Project] with BasicEnvironment
|
|||
/** A `PathFinder` that determines the files watched when an action is run with a preceeding ~ when this is the current
|
||||
* project. This project does not need to include the watched paths for projects that this project depends on.*/
|
||||
def watchPaths: PathFinder = Path.emptyPathFinder
|
||||
def terminateWatch(key: Int): Boolean = key == 10
|
||||
def terminateWatch(key: Int): Boolean = key == 10 || key == 13
|
||||
|
||||
protected final override def parentEnvironment = info.parent
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,7 @@ object SourceModificationWatch
|
|||
{
|
||||
def watchUntil(project: Project, pollDelaySec: Int)(terminationCondition: => Boolean)(onSourcesModified: => Unit)
|
||||
{
|
||||
def sourceFiles: Iterable[java.io.File] =
|
||||
sourcesFinder.get.map(Path.relativize(project.info.projectPath, _)).filter(_.isDefined).map(_.get.asFile)
|
||||
def sourceFiles: Iterable[java.io.File] = sourcesFinder.get.map(_.asFile)
|
||||
def sourcesFinder: PathFinder = (Path.emptyPathFinder /: project.topologicalSort)(_ +++ _.watchPaths)
|
||||
def loop(lastCallbackCallTime: Long, previousFileCount: Int)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue