summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2017-11-26 07:15:12 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2017-11-26 07:15:12 -0800
commit4306f94c080f48bb8e4333af06ea8bc158beb219 (patch)
tree3703fa786aeca6d11eb70771e3605614113043ba
parent302008684d51e49f0ce70516f283f15d41ea3831 (diff)
parent35f65823dddf571f749ed235fd133785c8b8c908 (diff)
downloadmill-4306f94c080f48bb8e4333af06ea8bc158beb219.tar.gz
mill-4306f94c080f48bb8e4333af06ea8bc158beb219.tar.bz2
mill-4306f94c080f48bb8e4333af06ea8bc158beb219.zip
Merge branch 'master' of github.com:lihaoyi/mill
-rw-r--r--scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala13
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 a9c136d6..96716fff 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,