diff options
author | Nikolay Tatarinov <5min4eq.unity@gmail.com> | 2017-11-26 17:59:17 +0300 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2017-11-26 06:59:17 -0800 |
commit | 35f65823dddf571f749ed235fd133785c8b8c908 (patch) | |
tree | f018c1715f9c1976d277fc1cbcd16f4029482a4b | |
parent | 5557966d2e96c1711978a8b1606bd6c20d26030c (diff) | |
download | mill-35f65823dddf571f749ed235fd133785c8b8c908.tar.gz mill-35f65823dddf571f749ed235fd133785c8b8c908.tar.bz2 mill-35f65823dddf571f749ed235fd133785c8b8c908.zip |
fix #6 include project classes to incremental compilation classpath (#20)
-rw-r--r-- | scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala b/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala index 70bb1a35..4b6b7873 100644 --- a/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala +++ b/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala @@ -33,6 +33,7 @@ object ScalaModule{ sources: Path, compileClasspath: Seq[Path], outputPath: Path): PathRef = { + val compileClasspathFiles = compileClasspath.map(_.toIO).toArray val binaryScalaVersion = scalaVersion.split('.').dropRight(1).mkString(".") def grepJar(s: String) = { compileClasspath @@ -45,7 +46,7 @@ object ScalaModule{ loader = getClass.getClassLoader, libraryJar = grepJar(s"scala-library-$scalaVersion.jar"), compilerJar = grepJar(s"scala-compiler-$scalaVersion.jar"), - allJars = compileClasspath.toArray.map(_.toIO), + allJars = compileClasspathFiles, explicitActual = None ) val scalac = ZincUtil.scalaCompiler( @@ -87,12 +88,14 @@ object ScalaModule{ println("Running Compile") println(outputPath/'zinc) println(exists(outputPath/'zinc)) - val store = FileAnalysisStore.binary((outputPath/'zinc).toIO) + val zincFile = (outputPath/'zinc).toIO + val store = FileAnalysisStore.binary(zincFile) + val classesDir = (outputPath / 'classes).toIO val newResult = ic.compile( ic.inputs( - classpath = compileClasspath.map(_.toIO).toArray, + classpath = classesDir +: compileClasspathFiles, sources = ls.rec(sources).filter(_.isFile).map(_.toIO).toArray, - classesDirectory = (outputPath / 'classes).toIO, + classesDirectory = classesDir, scalacOptions = Array(), javacOptions = Array(), maxErrors = 10, @@ -102,7 +105,7 @@ object ScalaModule{ setup = ic.setup( lookup, skip = false, - (outputPath/'zinc_cache).toIO, + zincFile, compilerCache, IncOptions.of(), reporter, |