diff options
author | Paul Phillips <paulp@improving.org> | 2011-01-27 23:26:19 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-01-27 23:26:19 +0000 |
commit | 4bc1fae32f8e1ae640e85ed15a577c557e18e385 (patch) | |
tree | db254d3d71020d9b999d33360974a2259b58867d /project/build/Compilation.scala | |
parent | 1c537ba1b3b68007e613a6c90d27cdae3f262c77 (diff) | |
download | scala-4bc1fae32f8e1ae640e85ed15a577c557e18e385.tar.gz scala-4bc1fae32f8e1ae640e85ed15a577c557e18e385.tar.bz2 scala-4bc1fae32f8e1ae640e85ed15a577c557e18e385.zip |
A bunch of work on the sbt build. No review.
Diffstat (limited to 'project/build/Compilation.scala')
-rw-r--r-- | project/build/Compilation.scala | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/project/build/Compilation.scala b/project/build/Compilation.scala index 116a25d979..9a313cab07 100644 --- a/project/build/Compilation.scala +++ b/project/build/Compilation.scala @@ -9,7 +9,6 @@ import FileUtilities._ trait Compilation { self : ScalaBuildProject with BuildInfoEnvironment => - def lastUsedCompilerVersion = layerEnvironment.lastCompilerVersion def instantiationCompilerJar: Path @@ -31,14 +30,10 @@ trait Compilation { instanceScope[Option[String]]{ scala => lazy val analyzing = new AnalyzingCompiler(scala, componentManager, xsbt.ClasspathOptions.manual, log) - def compilerVersionHasChanged: Boolean ={ - val lastVersion = lastUsedCompilerVersion.value - !(lastVersion.compareTo(scala.actualVersion) == 0) - - } + def compilerVersionHasChanged = lastUsedCompilerVersion.value != scala.actualVersion def checkAndClean(cleanFunction:() => Option[String]): Option[String] ={ - if (compilerVersionHasChanged){ + if (compilerVersionHasChanged) { log.info("The compiler version used to build this layer has changed since last time or this is a clean build.") lastUsedCompilerVersion.update(scala.actualVersion) layerEnvironment.saveEnvironment @@ -49,16 +44,17 @@ trait Compilation { } } - def compile0(steps: List[Step]): Option[String] = steps match { - case x :: xs => x match { - case c: CompilationStep => { + def compile0(steps: List[Step]): Option[String] = { + steps foreach { + case c: CompilationStep => val conditional = new CompileConditional(c, analyzing) log.info("") - conditional.run orElse copy(c) orElse earlyPackaging(c) orElse compile0(xs) - } - case _ => compile0(xs) + val res = conditional.run orElse copy(c) orElse earlyPackaging(c) + if (res.isDefined) + return res + case _ => () } - case Nil => None + None } /** @@ -104,8 +100,5 @@ trait LayerCompilation extends Compilation { */ lazy val compilation = task {compile(allSteps, cleanCompilation _)} - def externalCompilation: Option[String] = { - val runner = new ExternalTaskRunner(projectRoot, this.name, compilation.name, "Error during external compilation", log) - runner.runTask - } + def externalCompilation: Option[String] = maybeFork(compilation) } |