diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-02 19:59:16 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-02 20:09:42 -0400 |
commit | 107f62303794fa14b05c211d52dddc1f50f14886 (patch) | |
tree | b691ca3ff428ff0d91b973c93aa590fc50431b72 /stage1 | |
parent | ef08ce94aa537c50651f5c18b8cdf1d6313ff208 (diff) | |
download | cbt-107f62303794fa14b05c211d52dddc1f50f14886.tar.gz cbt-107f62303794fa14b05c211d52dddc1f50f14886.tar.bz2 cbt-107f62303794fa14b05c211d52dddc1f50f14886.zip |
propagate info if cbt has changed across builds, so they can be re-compiled
Diffstat (limited to 'stage1')
-rw-r--r-- | stage1/Stage1.scala | 10 | ||||
-rw-r--r-- | stage1/Stage1Lib.scala | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/stage1/Stage1.scala b/stage1/Stage1.scala index e8245c4..368a459 100644 --- a/stage1/Stage1.scala +++ b/stage1/Stage1.scala @@ -50,7 +50,7 @@ object Stage1{ a.lastModified > b.lastModified } - def run(_args: Array[String], classLoader: ClassLoader, stage1SourcesChanged: java.lang.Boolean): Int = { + def run(_args: Array[String], classLoader: ClassLoader, _cbtChanged: java.lang.Boolean): Int = { val args = Stage1ArgsParser(_args.toVector) val logger = new Logger(args.enabledLoggers) logger.stage1(s"Stage1 start") @@ -68,11 +68,11 @@ object Stage1{ val classLoaderCache = new ClassLoaderCache(logger) - val stage2SourcesChanged = lib.needsUpdate(sourceFiles, stage2StatusFile) + val cbtHasChanged = _cbtChanged || lib.needsUpdate(sourceFiles, stage2StatusFile) logger.stage1("Compiling stage2 if necessary") val scalaXml = JavaDependency("org.scala-lang.modules","scala-xml_"+constants.scalaMajorVersion,constants.scalaXmlVersion) compile( - stage2SourcesChanged, + cbtHasChanged, sourceFiles, stage2Target, stage2StatusFile, nailgunTarget +: stage1Target +: Dependencies(deps, scalaXml).classpath, Seq("-deprecation"), classLoaderCache, @@ -80,7 +80,7 @@ object Stage1{ ) logger.stage1(s"[$now] calling CbtDependency.classLoader") - if(NailgunLauncher.stage2classLoader == null){ + if(cbtHasChanged){ NailgunLauncher.stage2classLoader = CbtDependency().classLoader(classLoaderCache) } @@ -96,7 +96,7 @@ object Stage1{ new File( args.args(0) ), args.args.drop(1).toVector, // launcher changes cause entire nailgun restart, so no need for them here - cbtHasChanged = stage1SourcesChanged || stage2SourcesChanged, + cbtHasChanged = cbtHasChanged, logger ) ) match { diff --git a/stage1/Stage1Lib.scala b/stage1/Stage1Lib.scala index 105fe3e..39310b9 100644 --- a/stage1/Stage1Lib.scala +++ b/stage1/Stage1Lib.scala @@ -31,7 +31,7 @@ object CatchTrappedExitCode{ } } -case class Context( cwd: File, args: Seq[String], logger: Logger, classLoaderCache: ClassLoaderCache ) +case class Context( cwd: File, args: Seq[String], logger: Logger, cbtHasChanged: Boolean, classLoaderCache: ClassLoaderCache ) class BaseLib{ def realpath(name: File) = new File(Paths.get(name.getAbsolutePath).normalize.toString) |