aboutsummaryrefslogtreecommitdiff
path: root/stage2
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2016-03-14 23:29:09 -0400
committerChristopher Vogt <oss.nsp@cvogt.org>2016-03-19 21:13:49 -0400
commita5f4db210aa2878eb8e15a6d9fe5235199d4aee6 (patch)
tree62ee3ddd75578f340a6c36f99188fae413585b4e /stage2
parent35a96fea9336dfcac8aac75824450cbf7dc4ae1a (diff)
downloadcbt-a5f4db210aa2878eb8e15a6d9fe5235199d4aee6.tar.gz
cbt-a5f4db210aa2878eb8e15a6d9fe5235199d4aee6.tar.bz2
cbt-a5f4db210aa2878eb8e15a6d9fe5235199d4aee6.zip
replace two level classloader with hierarchy
replace two level classloader (one for non-cachable dependencies with a cached parent one for cachable ones) with a hierachy of classloaders corresponding this should eventually allow re-using CBT's classloader between stage1 and stage2 this change breaks the ScalaTest support for now
Diffstat (limited to 'stage2')
-rw-r--r--stage2/BuildBuild.scala6
-rw-r--r--stage2/mixins.scala3
2 files changed, 5 insertions, 4 deletions
diff --git a/stage2/BuildBuild.scala b/stage2/BuildBuild.scala
index 639154c..9746d8c 100644
--- a/stage2/BuildBuild.scala
+++ b/stage2/BuildBuild.scala
@@ -11,7 +11,11 @@ class BuildBuild(context: Context) extends Build(context){
exportedClasspath,
classOf[BuildBuild].getClassLoader // FIXME: this looks wrong. Should be ClassLoader.getSystemClassLoader but that crashes
)
- lib.create( lib.buildClassName )( managedContext )( cl ).asInstanceOf[Build]
+ cl
+ .loadClass(lib.buildClassName)
+ .getConstructor(classOf[Context])
+ .newInstance(managedContext)
+ .asInstanceOf[Build]
}
override def triggerLoopFiles = super.triggerLoopFiles ++ managedBuild.triggerLoopFiles
override def finalBuild = managedBuild.finalBuild
diff --git a/stage2/mixins.scala b/stage2/mixins.scala
index 753ee60..c3a57da 100644
--- a/stage2/mixins.scala
+++ b/stage2/mixins.scala
@@ -20,9 +20,6 @@ trait ScalaTest extends Build with Test{
"org.scalatest" %% "scalatest" % scalaTestVersion
) ++ super.dependencies
- // workaround probable ScalaTest bug throwing away the outer classloader. Not caching doesn't nest them.
- override def cacheDependencyClassLoader = false
-
override def run: ExitCode = {
val discoveryPath = compile.toString++"/"
context.logger.lib("discoveryPath: " ++ discoveryPath)