diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-17 11:33:45 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-17 11:35:40 -0800 |
commit | e9c95bfc06ed371566a9df0890f92702a4f14c7f (patch) | |
tree | 2056847bec8453dc7b79d0782d7e076248d08b39 /scalalib/src | |
parent | a225e7650892ecc1e672bcaf95dff0d598682583 (diff) | |
download | mill-e9c95bfc06ed371566a9df0890f92702a4f14c7f.tar.gz mill-e9c95bfc06ed371566a9df0890f92702a4f14c7f.tar.bz2 mill-e9c95bfc06ed371566a9df0890f92702a4f14c7f.zip |
Resolve individual Scala files before passing them to `ScalaModule#compile`, to ensure other rubbish in the source folders (e.g. vim `.swp` files) do not trigger spurious recompiles
Diffstat (limited to 'scalalib/src')
-rw-r--r-- | scalalib/src/mill/scalalib/ScalaModule.scala | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scalalib/src/mill/scalalib/ScalaModule.scala b/scalalib/src/mill/scalalib/ScalaModule.scala index b7810246..390672c6 100644 --- a/scalalib/src/mill/scalalib/ScalaModule.scala +++ b/scalalib/src/mill/scalalib/ScalaModule.scala @@ -102,10 +102,18 @@ trait ScalaModule extends mill.Module with TaskModule { outer => def generatedSources = T{ Seq.empty[PathRef] } def allSources = T{ sources() ++ generatedSources() } + def allSourceFiles = T{ + for { + root <- allSources() + if exists(root.path) + path <- ls.rec(root.path) + if path.isFile && (path.ext == "scala" || path.ext == "java") + } yield PathRef(path) + } def compile: T[CompilationResult] = T.persistent{ mill.scalalib.ScalaWorkerApi.scalaWorker().compileScala( scalaVersion(), - allSources().map(_.path), + allSourceFiles().map(_.path), scalaCompilerBridgeSources().map(_.path), compileClasspath().map(_.path), scalaCompilerClasspath().map(_.path), |