From 4b9541d435365db023c5a629d88ab733f3fffa77 Mon Sep 17 00:00:00 2001 From: Christopher Vogt Date: Wed, 6 Apr 2016 22:23:34 -0400 Subject: caching return values parameterized methods seems just wrong --- stage1/resolver.scala | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'stage1') diff --git a/stage1/resolver.scala b/stage1/resolver.scala index e8bfc07..8eaf107 100644 --- a/stage1/resolver.scala +++ b/stage1/resolver.scala @@ -60,10 +60,9 @@ abstract class Dependency{ The implementation of this method is untested and likely buggy at this stage. */ - private object cacheExportClasspathConcurrently extends Cache[Future[ClassPath]] private def exportClasspathConcurrently( latest: Map[(String, String),ArtifactInfo]//, cache: BuildCache - )( implicit ec: ExecutionContext ): Future[ClassPath] = cacheExportClasspathConcurrently{ + )( implicit ec: ExecutionContext ): Future[ClassPath] = { Future.sequence( // trigger compilation / download of all dependencies first this.dependencies.map{ d => @@ -130,8 +129,7 @@ abstract class Dependency{ new cbt.URLClassLoader( exportedClasspath, dependencyClassLoader(latest, cache) ) } } - private object classLoaderCache extends Cache[ClassLoader] - def classLoader( cache: ClassLoaderCache ): ClassLoader = classLoaderCache{ + def classLoader( cache: ClassLoaderCache ): ClassLoader = { if( concurrencyEnabled ){ // trigger concurrent building / downloading dependencies exportClasspathConcurrently @@ -145,6 +143,7 @@ abstract class Dependency{ cache ) } + // FIXME: these probably need to update outdated as well def classpath : ClassPath = exportedClasspath ++ dependencyClasspath def dependencyJars : Seq[File] = transitiveDependencies.flatMap(_.jars) def dependencyClasspath : ClassPath = ClassPath.flatten( transitiveDependencies.map(_.exportedClasspath) ) @@ -222,16 +221,6 @@ object Dependencies{ case class Stage1Dependency()(implicit val logger: Logger) extends Dependency{ override def needsUpdate = false // FIXME: think this through, might allow simplifications and/or optimizations override def canBeCached = false - /* - private object classLoaderRecursionCache extends Cache[ClassLoader] - override def classLoaderRecursion(latest: Map[(String,String),Dependency], cache: ClassLoaderCache) = classLoaderRecursionCache{ - println(System.currentTimeMillis) - val cl = getClass.getClassLoader - println(System.currentTimeMillis) - cl - ClassLoader.getSystemClassLoader - } - */ override def targetClasspath = exportedClasspath override def exportedClasspath = ClassPath( Seq(nailgunTarget, stage1Target) ) override def exportedJars = ???//Seq[File]() -- cgit v1.2.3