From 828adac48d0e08766d192c7ce01021083cfc4d67 Mon Sep 17 00:00:00 2001 From: Christopher Vogt Date: Sun, 12 Mar 2017 22:00:00 -0400 Subject: 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stage2/Stage2.scala | 37 ++++--------------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) (limited to 'stage2/Stage2.scala') 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 } -- cgit v1.2.3