aboutsummaryrefslogtreecommitdiff
path: root/stage2/Stage2.scala
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2017-03-12 22:00:00 -0400
committerChristopher Vogt <oss.nsp@cvogt.org>2017-03-12 22:34:02 -0400
commit828adac48d0e08766d192c7ce01021083cfc4d67 (patch)
tree06e19c3f9117c24e6c6a5e8a95990011a0efe4b3 /stage2/Stage2.scala
parentc14e288996d2b56b6b06a0624f4f2fca315369c7 (diff)
downloadcbt-828adac48d0e08766d192c7ce01021083cfc4d67.tar.gz
cbt-828adac48d0e08766d192c7ce01021083cfc4d67.tar.bz2
cbt-828adac48d0e08766d192c7ce01021083cfc4d67.zip
fix file watching for real
last file watching update didn’t work well enough. This now - rips out barbary watch service as it seems buggy crashing the jvm - make cbt exclusively write files to watch to a file - uses fswatch instead watching all files in that file
Diffstat (limited to 'stage2/Stage2.scala')
-rw-r--r--stage2/Stage2.scala37
1 files changed, 4 insertions, 33 deletions
diff --git a/stage2/Stage2.scala b/stage2/Stage2.scala
index 33a67ac..eaf776e 100644
--- a/stage2/Stage2.scala
+++ b/stage2/Stage2.scala
@@ -32,40 +32,11 @@ object Stage2 extends Stage2Base{
args.cbtHome,
args.compatibilityTarget,
null,
- NailgunLauncher.compatibilitySourceFiles.asScala.toArray[File]
- ++ NailgunLauncher.nailgunLauncherSourceFiles.asScala.toArray[File]
- ++ NailgunLauncher.stage1SourceFiles.asScala.toArray[File]
- ++ args.stage2sourceFiles.toArray[File]
+ args.loop
)
- def loop( code: ExitCode, files: () => Set[File] ): ExitCode = {
- code match {
- case c@ExitCode(253 | 130) => c // CBT signals loop | user pressed ctrl+C
- case c if !task.contains("loop") => c
- case c =>
- // this allows looping over broken builds
- lib.watch{ files }()
- c
- }
- }
- val code = lib.trapExitCode{
- val first = lib.loadRoot( context )
- val build = first.finalBuild( context.cwd )
- val code = lib.callReflective(build, task, context)
- if( !context.loopFile.exists ){
- loop( code, () => build.triggerLoopFiles )
- }
- code
- }
- if( context.loopFile.exists ){
- loop(
- code,
- () => {
- val files = context.loopFile.readAsString.split("\n").map(new File(_)).toSet
- logger.loop("Looping change detection over:\n - "++files.mkString("\n - "))
- files
- }
- )
- }
+ val first = lib.loadRoot( context )
+ val build = first.finalBuild( context.cwd )
+ val code = lib.callReflective(build, task, context)
logger.stage2(s"Stage2 end with exit code "+code.integer)
code
}