diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2017-06-15 22:38:53 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2017-06-15 22:43:59 -0400 |
commit | 09051773461b98d374d1b46dd0a2caa57768ab30 (patch) | |
tree | d67c88d10906647c7fd56229e6e56121a9107744 /stage1/Stage1Lib.scala | |
parent | b5194aab6f1f57aff6e4538acaf91245fdf15039 (diff) | |
download | cbt-09051773461b98d374d1b46dd0a2caa57768ab30.tar.gz cbt-09051773461b98d374d1b46dd0a2caa57768ab30.tar.bz2 cbt-09051773461b98d374d1b46dd0a2caa57768ab30.zip |
add sbt-resolver like restart feature
Diffstat (limited to 'stage1/Stage1Lib.scala')
-rw-r--r-- | stage1/Stage1Lib.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/stage1/Stage1Lib.scala b/stage1/Stage1Lib.scala index ab95a41..89e52b6 100644 --- a/stage1/Stage1Lib.scala +++ b/stage1/Stage1Lib.scala @@ -417,6 +417,21 @@ ${sourceFiles.sorted.mkString(" \\\n")} StandardOpenOption.APPEND ) } + + /** + add process id to a cbt internal list of processes to kill + when looping after a file change + */ + def addProcessIdToKillList(cwd: File, processId: Int) = { + val file = cwd / "target/.cbt-kill.tmp" + file.createNewFile + lib.write( + file, + processId.toString + "\n", + StandardOpenOption.APPEND + ) + } + def cached[T]( targetDirectory: File, inputLastModified: Long )( action: () => T ): (Option[T],Long) = { val t = targetDirectory val start = System.currentTimeMillis |