diff options
Diffstat (limited to 'stage1')
-rw-r--r-- | stage1/Stage1.scala | 16 | ||||
-rw-r--r-- | stage1/resolver.scala | 25 |
2 files changed, 18 insertions, 23 deletions
diff --git a/stage1/Stage1.scala b/stage1/Stage1.scala index 9524c45..e8245c4 100644 --- a/stage1/Stage1.scala +++ b/stage1/Stage1.scala @@ -80,21 +80,13 @@ object Stage1{ ) logger.stage1(s"[$now] calling CbtDependency.classLoader") - - val cl = /*classLoaderCache.transient.get( - (stage2Target +: deps.classpath).string,*/ - new cbt.URLClassLoader( - ClassPath(Seq(stage2Target)), - classLoaderCache.persistent.get( - deps.classpath.string, - cbt.URLClassLoader( deps.classpath, classLoader ) - ) - ) - //) + if(NailgunLauncher.stage2classLoader == null){ + NailgunLauncher.stage2classLoader = CbtDependency().classLoader(classLoaderCache) + } logger.stage1(s"[$now] Run Stage2") val exitCode = ( - cl.loadClass( + NailgunLauncher.stage2classLoader.loadClass( if(args.admin) "cbt.AdminStage2" else "cbt.Stage2" ) .getMethod( "run", classOf[Stage2Args] ) diff --git a/stage1/resolver.scala b/stage1/resolver.scala index c8d2ee4..2e8ef15 100644 --- a/stage1/resolver.scala +++ b/stage1/resolver.scala @@ -85,7 +85,7 @@ abstract class Dependency{ ) } - def actual(current: Dependency, latest: Map[(String,String),Dependency]) = current match { + private def actual(current: Dependency, latest: Map[(String,String),Dependency]) = current match { case d: ArtifactInfo => latest((d.groupId,d.artifactId)) case d => d } @@ -228,25 +228,28 @@ case class Stage1Dependency()(implicit val logger: Logger) extends Dependency{ ClassLoader.getSystemClassLoader } */ - override def exportedClasspath = ClassPath(Seq(nailgunTarget, stage1Target) ) + override def targetClasspath = exportedClasspath + override def exportedClasspath = ClassPath( Seq(nailgunTarget, stage1Target) ) override def exportedJars = ???//Seq[File]() - override def dependencies = ScalaDependencies(constants.scalaVersion).dependencies - def targetClasspath = exportedClasspath + override def dependencies = Seq( + JavaDependency("org.scala-lang","scala-library",constants.scalaVersion), + JavaDependency("org.scala-lang.modules","scala-xml_"+constants.scalaMajorVersion,"1.0.5") + ) + // FIXME: implement sanity check to prevent using incompatible scala-library and xml version on cp + override def classLoaderRecursion( latest: Map[(String,String),Dependency], cache: ClassLoaderCache ) + = getClass.getClassLoader } case class CbtDependency()(implicit val logger: Logger) extends Dependency{ + def needsUpdate = false // FIXME: think this through, might allow simplifications and/or optimizations override def canBeCached = false + override def targetClasspath = exportedClasspath override def exportedClasspath = ClassPath( Seq( stage2Target ) ) - override def exportedJars = Seq[File]() + override def exportedJars = ??? override def dependencies = Seq( Stage1Dependency(), JavaDependency("net.incongru.watchservice","barbary-watchservice","1.0"), - JavaDependency("org.eclipse.jgit", "org.eclipse.jgit", "4.2.0.201601211800-r"), - lib.ScalaDependency( - "org.scala-lang.modules","scala-xml","1.0.5", scalaVersion = constants.scalaMajorVersion - ) + JavaDependency("org.eclipse.jgit", "org.eclipse.jgit", "4.2.0.201601211800-r") ) - def needsUpdate = false // FIXME: think this through, might allow simplifications and/or optimizations - def targetClasspath = exportedClasspath } case class Classifier(name: Option[String]) |