From 7cfcf44bf35b530d592db943ce0e3d7547843c4d Mon Sep 17 00:00:00 2001 From: dmharrah Date: Sat, 12 Sep 2009 14:30:49 +0000 Subject: [PATCH] Fix triggered execution git-svn-id: https://simple-build-tool.googlecode.com/svn/trunk@1009 d89573ee-9141-11dd-94d4-bdf5e562f29c --- src/main/scala/sbt/Main.scala | 2 +- src/main/scala/sbt/Project.scala | 2 +- src/main/scala/sbt/SourceModificationWatch.scala | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/scala/sbt/Main.scala b/src/main/scala/sbt/Main.scala index 536e2db64..8a74e37bf 100644 --- a/src/main/scala/sbt/Main.scala +++ b/src/main/scala/sbt/Main.scala @@ -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) diff --git a/src/main/scala/sbt/Project.scala b/src/main/scala/sbt/Project.scala index d6f62f46a..36e91752b 100644 --- a/src/main/scala/sbt/Project.scala +++ b/src/main/scala/sbt/Project.scala @@ -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 diff --git a/src/main/scala/sbt/SourceModificationWatch.scala b/src/main/scala/sbt/SourceModificationWatch.scala index 9e737f70c..cc050efb2 100644 --- a/src/main/scala/sbt/SourceModificationWatch.scala +++ b/src/main/scala/sbt/SourceModificationWatch.scala @@ -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) {