aboutsummaryrefslogtreecommitdiff
path: root/stage1/Stage1Lib.scala
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2017-02-14 00:07:57 -0500
committerChristopher Vogt <oss.nsp@cvogt.org>2017-02-14 00:34:48 -0500
commit92b26f394460aa609f9d073ea044776e7d8c46fb (patch)
treecb6deceebc0313e2186e686680b51187ddfd0095 /stage1/Stage1Lib.scala
parentdfde369b30bcde1c60add172e0e91caeb51e541b (diff)
downloadcbt-92b26f394460aa609f9d073ea044776e7d8c46fb.tar.gz
cbt-92b26f394460aa609f9d073ea044776e7d8c46fb.tar.bz2
cbt-92b26f394460aa609f9d073ea044776e7d8c46fb.zip
implicitly pass classloader, might make code easier
and prepares for allowing `run` and `runFlat` at Dependency instead of Build level
Diffstat (limited to 'stage1/Stage1Lib.scala')
-rw-r--r--stage1/Stage1Lib.scala11
1 files changed, 5 insertions, 6 deletions
diff --git a/stage1/Stage1Lib.scala b/stage1/Stage1Lib.scala
index 5a2f05d..67c1f4e 100644
--- a/stage1/Stage1Lib.scala
+++ b/stage1/Stage1Lib.scala
@@ -192,11 +192,10 @@ class Stage1Lib( logger: Logger ) extends BaseLib{
dependencies: Seq[Dependency],
mavenCache: File,
scalacOptions: Seq[String] = Seq(),
- classLoaderCache: ClassLoaderCache,
zincVersion: String,
scalaVersion: String
)(
- implicit transientCache: java.util.Map[AnyRef, AnyRef]
+ implicit transientCache: java.util.Map[AnyRef, AnyRef], classLoaderCache: ClassLoaderCache
): Option[Long] = {
val d = Dependencies(dependencies)
val classpath = d.classpath
@@ -259,7 +258,7 @@ class Stage1Lib( logger: Logger ) extends BaseLib{
dualArgs ++ singleArgs ++ (
if(cp.isEmpty) Nil else Seq("-cp", cp)
) ++ sourceFiles.map(_.toString),
- zinc.classLoader(classLoaderCache)
+ zinc.classLoader
)
} catch {
case scala.util.control.NonFatal(e) =>
@@ -413,20 +412,20 @@ ${sourceFiles.sorted.mkString(" \\\n")}
case d => d
}
- def classLoaderRecursion( dependency: Dependency, latest: Map[(String,String),Dependency], cache: ClassLoaderCache)(implicit transientCache: java.util.Map[AnyRef,AnyRef] ): ClassLoader = {
+ def classLoaderRecursion( dependency: Dependency, latest: Map[(String,String),Dependency])(implicit transientCache: java.util.Map[AnyRef,AnyRef], cache: ClassLoaderCache): ClassLoader = {
// FIXME: shouldn't we be using KeyLockedLazyCache instead of hashmap directly here?
val dependencies = dependency.dependencies
val dependencyClassLoader: ClassLoader = {
if( dependency.dependencies.isEmpty ){
NailgunLauncher.jdkClassLoader
} else if( dependencies.size == 1 ){
- classLoaderRecursion( dependencies.head, latest, cache )
+ classLoaderRecursion( dependencies.head, latest )
} else{
val lastModified = dependencies.map( _.lastModified ).max
val cp = dependency.dependencyClasspath.string
val cl =
new MultiClassLoader(
- dependencies.map( classLoaderRecursion(_, latest, cache) )
+ dependencies.map( classLoaderRecursion(_, latest) )
)
if(dependency.isInstanceOf[BuildInterface])
cl // Don't cache builds right now. We need to fix invalidation first.