diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2017-12-04 10:17:25 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2017-12-04 10:17:25 -0800 |
commit | a9ed3b67cc1d0b0a755159013b28766f436e866a (patch) | |
tree | 443b7c785359905983640499df724f75a53aee10 /scalaplugin/src | |
parent | 7238d7340744a5eda74acb6970c2cbf7bedea0e7 (diff) | |
download | mill-a9ed3b67cc1d0b0a755159013b28766f436e866a.tar.gz mill-a9ed3b67cc1d0b0a755159013b28766f436e866a.tar.bz2 mill-a9ed3b67cc1d0b0a755159013b28766f436e866a.zip |
Flesh out `bridges` pre-compilation in Mill build, getting the cross-minor-version `AcyclicTests` running using the `mill` test runner
Fixed `Discovered` to only pick up public `Target`s, which makes it skip things like the `super$compile` of an overriden `compile` target.
Split up `sources` and `allSources`
TBD how to properly switch the `compilerBridgeJar` between the different output paths of SBT's compile-dir and Mill's compile-dir, and eventually to a maven-central artifact too
Diffstat (limited to 'scalaplugin/src')
-rw-r--r-- | scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala b/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala index 27aefb12..3d194190 100644 --- a/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala +++ b/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala @@ -34,7 +34,7 @@ object ScalaModule{ val compilerCache = new CompilerCache(2) def compileScala(scalaVersion: String, - sources: Path, + sources: Seq[Path], compileClasspath: Seq[Path], compilerClasspath: Seq[Path], compilerBridge: Seq[Path], @@ -54,7 +54,8 @@ object ScalaModule{ val compilerJars = compilerClasspath.toArray.map(_.toIO) val compilerBridgeJar = new java.io.File( - s"bridge/${scalaVersion.replace('.', '_')}/target/scala-$binaryScalaVersion/mill-bridge_$scalaVersion-0.1-SNAPSHOT.jar" +// s"bridge/${scalaVersion.replace('.', '_')}/target/scala-$binaryScalaVersion/mill-bridge_$scalaVersion-0.1-SNAPSHOT.jar" + s"out/bridges/$scalaVersion/compile/classes" ) val zincClassLoader = new URLClassLoader(compilerJars.map(_.toURI.toURL), null){ @@ -110,7 +111,7 @@ object ScalaModule{ val newResult = ic.compile( ic.inputs( classpath = classesDir +: compileClasspathFiles, - sources = ls.rec(sources).filter(_.isFile).map(_.toIO).toArray, + sources = sources.flatMap(ls.rec).filter(x => x.isFile && x.ext == "scala").map(_.toIO).toArray, classesDirectory = classesDir, scalacOptions = scalacOptions.toArray, javacOptions = javacOptions.toArray, @@ -334,10 +335,11 @@ trait ScalaModule extends Module with TaskModule{ outer => def sources = T.source{ basePath / 'src } def resources = T.source{ basePath / 'resources } + def allSources = T{ Seq(sources()) } def compile = T.persistent{ compileScala( scalaVersion(), - sources().path, + allSources().map(_.path), compileDepClasspath().map(_.path), scalaCompilerClasspath().map(_.path), compilerBridgeClasspath().map(_.path), |