aboutsummaryrefslogtreecommitdiff
path: root/stage1/Stage1.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 /stage1/Stage1.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 'stage1/Stage1.scala')
-rw-r--r--stage1/Stage1.scala22
1 files changed, 15 insertions, 7 deletions
diff --git a/stage1/Stage1.scala b/stage1/Stage1.scala
index 48d0ae9..e419e67 100644
--- a/stage1/Stage1.scala
+++ b/stage1/Stage1.scala
@@ -42,7 +42,8 @@ class Stage2Args(
val cache: File,
val cbtHome: File,
val compatibilityTarget: File,
- val stage2sourceFiles: Seq[File]
+ val stage2sourceFiles: Seq[File],
+ val loop: Boolean
)(
implicit val transientCache: java.util.Map[AnyRef,AnyRef], val classLoaderCache: ClassLoaderCache, val logger: Logger
){
@@ -60,7 +61,9 @@ object Stage1{
val (_, cbtLastModified, classLoader) = buildStage2(
buildStage1,
context.cbtHome,
- context.cache
+ context.cache,
+ context.cwd,
+ context.loop
)(context.transientCache, new ClassLoaderCache( context.persistentCache ), logger)
classLoader
@@ -75,7 +78,7 @@ object Stage1{
}
def buildStage2(
- buildStage1: BuildStage1Result, cbtHome: File, cache: File
+ buildStage1: BuildStage1Result, cbtHome: File, cache: File, cwd: File, loop: Boolean
)(
implicit transientCache: java.util.Map[AnyRef,AnyRef], classLoaderCache: ClassLoaderCache, logger: Logger
): (Seq[File], Long, ClassLoader) = {
@@ -99,6 +102,8 @@ object Stage1{
)
logger.stage1("Compiling stage2 if necessary")
+ if(loop)
+ lib.addLoopFiles( cwd, stage2sourceFiles.toSet )
val Some( stage2LastModified ) = compile(
buildStage1.stage1LastModified,
stage2sourceFiles, stage2Target, stage2StatusFile,
@@ -158,6 +163,7 @@ object Stage1{
_args: Array[String],
cache: File,
cbtHome: File,
+ loop: Boolean,
buildStage1: BuildStage1Result,
persistentCache: java.util.Map[AnyRef,AnyRef]
): Int = {
@@ -168,17 +174,19 @@ object Stage1{
implicit val transientCache: java.util.Map[AnyRef,AnyRef] = new java.util.HashMap
implicit val classLoaderCache = new ClassLoaderCache( persistentCache )
- val (stage2sourceFiles, stage2LastModified, classLoader) = buildStage2( buildStage1, cbtHome, cache )
+ val cwd = new File( args.args(0) )
+ val (stage2sourceFiles, stage2LastModified, classLoader) = buildStage2( buildStage1, cbtHome, cache, cwd, loop )
val stage2Args = new Stage2Args(
- new File( args.args(0) ),
- args.args.drop(1).toVector,
+ cwd,
+ args.args.drop(2).toVector,
// launcher changes cause entire nailgun restart, so no need for them here
stage2LastModified = stage2LastModified,
cache,
cbtHome,
new File(buildStage1.compatibilityClasspath),
- stage2sourceFiles
+ stage2sourceFiles,
+ loop
)
logger.stage1(s"Run Stage2")