diff options
-rw-r--r-- | libraries/readme.txt | 3 | ||||
-rw-r--r-- | stage1/Stage1.scala | 17 | ||||
-rw-r--r-- | stage1/Stage1Lib.scala | 2 | ||||
-rw-r--r-- | stage2/Scaffold.scala | 3 | ||||
-rw-r--r-- | stage2/ToolsTasks.scala | 2 | ||||
-rw-r--r-- | stage2/plugins/Dotty.scala | 5 | ||||
-rw-r--r-- | stage2/plugins/Frege.scala | 5 |
7 files changed, 18 insertions, 19 deletions
diff --git a/libraries/readme.txt b/libraries/readme.txt new file mode 100644 index 0000000..5514b49 --- /dev/null +++ b/libraries/readme.txt @@ -0,0 +1,3 @@ +This folder contains libraries used by cbt and it's plugins. +They are separated so they can be published and used separately +from cbt itself. diff --git a/stage1/Stage1.scala b/stage1/Stage1.scala index 60f0ad9..714ed65 100644 --- a/stage1/Stage1.scala +++ b/stage1/Stage1.scala @@ -40,12 +40,11 @@ class Stage2Args( val cwd: File, val args: Seq[String], val stage2LastModified: Long, - val logger: Logger, val cache: File, val cbtHome: File, val compatibilityTarget: File )( - implicit val transientCache: java.util.Map[AnyRef,AnyRef], val classLoaderCache: ClassLoaderCache + implicit val transientCache: java.util.Map[AnyRef,AnyRef], val classLoaderCache: ClassLoaderCache, val logger: Logger ){ val persistentCache = classLoaderCache.hashMap } @@ -61,9 +60,8 @@ object Stage1{ val (cbtLastModified, classLoader) = buildStage2( buildStage1, context.cbtHome, - context.cache, - logger - )(context.transientCache, new ClassLoaderCache( context.persistentCache )) + context.cache + )(context.transientCache, new ClassLoaderCache( context.persistentCache ), logger) classLoader .loadClass("cbt.Stage2") @@ -77,8 +75,8 @@ object Stage1{ } def buildStage2( - buildStage1: BuildStage1Result, cbtHome: File, cache: File, logger: Logger - )(implicit transientCache: java.util.Map[AnyRef,AnyRef], classLoaderCache: ClassLoaderCache): (Long, ClassLoader) = { + buildStage1: BuildStage1Result, cbtHome: File, cache: File + )(implicit transientCache: java.util.Map[AnyRef,AnyRef], classLoaderCache: ClassLoaderCache, logger: Logger): (Long, ClassLoader) = { import buildStage1._ @@ -162,20 +160,19 @@ object Stage1{ persistentCache: java.util.Map[AnyRef,AnyRef] ): Int = { val args = Stage1ArgsParser(_args.toVector) - val logger = new Logger(args.enabledLoggers, buildStage1.start) + implicit val logger = new Logger(args.enabledLoggers, buildStage1.start) logger.stage1(s"Stage1 start") implicit val transientCache: java.util.Map[AnyRef,AnyRef] = new java.util.HashMap implicit val classLoaderCache = new ClassLoaderCache( persistentCache ) - val (stage2LastModified, classLoader) = buildStage2( buildStage1, cbtHome, cache, logger ) + val (stage2LastModified, classLoader) = buildStage2( buildStage1, cbtHome, cache ) val stage2Args = new Stage2Args( new File( args.args(0) ), args.args.drop(1).dropWhile(_ == "direct").toVector, // launcher changes cause entire nailgun restart, so no need for them here stage2LastModified = stage2LastModified, - logger = logger, cache, cbtHome, new File(buildStage1.compatibilityClasspath) diff --git a/stage1/Stage1Lib.scala b/stage1/Stage1Lib.scala index 79df450..7f8f600 100644 --- a/stage1/Stage1Lib.scala +++ b/stage1/Stage1Lib.scala @@ -34,7 +34,7 @@ class BaseLib{ class Stage1Lib( logger: Logger ) extends BaseLib{ lib => - implicit val implicitLogger: Logger = logger + implicit protected val implicitLogger: Logger = logger def libMajorVersion(libFullVersion: String) = libFullVersion.split("\\.").take(2).mkString(".") diff --git a/stage2/Scaffold.scala b/stage2/Scaffold.scala index 68a966b..4420866 100644 --- a/stage2/Scaffold.scala +++ b/stage2/Scaffold.scala @@ -62,7 +62,7 @@ object Main{ createFile(projectDirectory, lib.buildDirectoryName++"/"++lib.buildFileName, s"""package cbt_build.${packageFromDirectory(projectDirectory)} import cbt._ class Build(val context: Context) extends BaseBuild{ - override def dependencies = + override def dependencies = ( super.dependencies ++ // don't forget super.dependencies here for scala-library, etc. Seq( // source dependency @@ -78,6 +78,7 @@ class Build(val context: Context) extends BaseBuild{ // "com.lihaoyi" %% "ammonite-ops" % "0.5.5" // "com.lihaoyi" % "ammonite-ops_2.11" % "0.5.5" ) + ) } """ ) diff --git a/stage2/ToolsTasks.scala b/stage2/ToolsTasks.scala index 943f096..0cfd501 100644 --- a/stage2/ToolsTasks.scala +++ b/stage2/ToolsTasks.scala @@ -30,7 +30,7 @@ class ToolsTasks( args(1).split(",").toVector.map{ d => val v = d.split(":") - Resolver(mavenCentral).bindOne(MavenDependency(v(0),v(1),v(2))).classpath + Resolver(mavenCentral, sonatypeSnapshots).bindOne(MavenDependency(v(0),v(1),v(2))).classpath } ) } diff --git a/stage2/plugins/Dotty.scala b/stage2/plugins/Dotty.scala index 9de2218..c96dbcb 100644 --- a/stage2/plugins/Dotty.scala +++ b/stage2/plugins/Dotty.scala @@ -16,7 +16,7 @@ trait Dotty extends BaseBuild{ override def dependencies: Seq[Dependency] = Seq( dottyLibrary ) private lazy val dottyLib = new DottyLib( - logger, context.cbtLastModified, context.paths.mavenCache, dottyCompiler + context.cbtLastModified, context.paths.mavenCache, dottyCompiler ) def compileJavaFirst: Boolean = false @@ -69,11 +69,10 @@ object Dotty{ } class DottyLib( - logger: Logger, cbtLastModified: Long, mavenCache: File, dottyCompiler: DependencyImplementation -)(implicit transientCache: java.util.Map[AnyRef,AnyRef], classLoaderCache: ClassLoaderCache){ +)(implicit transientCache: java.util.Map[AnyRef,AnyRef], classLoaderCache: ClassLoaderCache, logger: Logger){ val lib = new Lib(logger) import lib._ diff --git a/stage2/plugins/Frege.scala b/stage2/plugins/Frege.scala index ae82f6b..3598d08 100644 --- a/stage2/plugins/Frege.scala +++ b/stage2/plugins/Frege.scala @@ -20,7 +20,7 @@ trait Frege extends BaseBuild{ override def scalaTarget: File = target ++ s"/frege-$fregeVersion" private lazy val fregeLib = new FregeLib( - logger, context.cbtLastModified, context.paths.mavenCache, + context.cbtLastModified, context.paths.mavenCache, fregeVersion = fregeVersion, classifier = classifier, fregeDependencies = fregeDependencies, fregeTarget = fregeTarget ) @@ -40,14 +40,13 @@ trait Frege extends BaseBuild{ } class FregeLib( - logger: Logger, cbtLastModified: Long, mavenCache: File, fregeVersion: String, classifier: Option[String], fregeDependencies: Seq[Dependency], fregeTarget: String -)(implicit transientCache: java.util.Map[AnyRef,AnyRef], classLoaderCache: ClassLoaderCache){ +)(implicit transientCache: java.util.Map[AnyRef,AnyRef], classLoaderCache: ClassLoaderCache, logger: Logger){ val lib = new Lib(logger) import lib._ |