aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--stage1/Stage1.scala5
-rw-r--r--stage1/Stage1Lib.scala20
-rw-r--r--stage2/Stage2.scala12
-rw-r--r--test/simple-fixed/build/build.scala2
4 files changed, 18 insertions, 21 deletions
diff --git a/stage1/Stage1.scala b/stage1/Stage1.scala
index 2a826e5..e501300 100644
--- a/stage1/Stage1.scala
+++ b/stage1/Stage1.scala
@@ -111,10 +111,7 @@ object Stage1{
classLoaderCache.persistent.remove( cbtDependency.classpath.string )
}
- val stage2ClassLoader = classLoaderCache.persistent.get(
- cbtDependency.classpath.string,
- cbtDependency.classLoader(classLoaderCache)
- )
+ val stage2ClassLoader = cbtDependency.classLoader(classLoaderCache)
{
// a few classloader sanity checks
diff --git a/stage1/Stage1Lib.scala b/stage1/Stage1Lib.scala
index 5fd19a8..7b09be2 100644
--- a/stage1/Stage1Lib.scala
+++ b/stage1/Stage1Lib.scala
@@ -343,19 +343,19 @@ ${files.sorted.mkString(" \\\n")}
if( dependencies.exists(_.needsUpdate) && cache.persistent.containsKey(cp) ){
cache.persistent.remove(cp)
}
- cache.persistent.get(
- cp,
- new MultiClassLoader(
- dependencies.map( classLoaderRecursion(_, latest, cache) )
- )
- )
+ def cl = new MultiClassLoader( dependencies.map( classLoaderRecursion(_, latest, cache) ) )
+ if(d.isInstanceOf[BuildInterface])
+ cl // Don't cache builds right now. We need to fix invalidation first.
+ else
+ cache.persistent.get( cp, cl )
}
}
val a = actual( dependency, latest )
- cache.persistent.get(
- a.classpath.string,
- new cbt.URLClassLoader( a.exportedClasspath, dependencyClassLoader(latest, cache) )
- )
+ def cl = new cbt.URLClassLoader( a.exportedClasspath, dependencyClassLoader(latest, cache) )
+ if(d.isInstanceOf[BuildInterface])
+ cl
+ else
+ cache.persistent.get( a.classpath.string, cl )
}
}
diff --git a/stage2/Stage2.scala b/stage2/Stage2.scala
index 83b660e..417808d 100644
--- a/stage2/Stage2.scala
+++ b/stage2/Stage2.scala
@@ -52,13 +52,13 @@ object Stage2 extends Stage2Base{
val first = lib.loadRoot( context )
val build = first.finalBuild
- def call(build: BuildInterface) = {
+ def call(build: BuildInterface): ExitCode = {
if(cross){
- build.crossScalaVersions.foreach{
+ build.crossScalaVersions.map{
v => new lib.ReflectBuild(
build.copy(context.copy(scalaVersion = Some(v)))
).callNullary(task)
- }
+ }.filter(_ != ExitCode.Success).headOption getOrElse ExitCode.Success
} else {
new lib.ReflectBuild(build).callNullary(task)
}
@@ -85,9 +85,9 @@ object Stage2 extends Stage2Base{
call(build)
}
} else {
- call(build)
+ val code = call(build)
+ logger.stage2(s"Stage2 end")
+ System.exit(code.integer)
}
-
- logger.stage2(s"Stage2 end")
}
}
diff --git a/test/simple-fixed/build/build.scala b/test/simple-fixed/build/build.scala
index 88b80e3..b72393c 100644
--- a/test/simple-fixed/build/build.scala
+++ b/test/simple-fixed/build/build.scala
@@ -2,7 +2,7 @@ import cbt._
import scala.collection.immutable.Seq
import java.io.File
-// cbt:file:///Users/chris/code/cbt/#bdd6d905807a8cee7655d436401e76196ec4fe67
+// cbt:https://github.com/cvogt/cbt.git#bdd6d905807a8cee7655d436401e76196ec4fe67
class Build(context: cbt.Context) extends BasicBuild(context){
override def dependencies = (
super.dependencies