diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2017-12-18 00:55:39 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2017-12-18 00:55:39 -0800 |
commit | b83546cacea1292af3d4ae8e8c349f529b201ed2 (patch) | |
tree | 6ece81a3a95dd2fe38ad02914b4937f1e3517c22 /scalaplugin/src | |
parent | a66bb3e3903e5996d0e99f26b23d5f65ab748289 (diff) | |
download | mill-b83546cacea1292af3d4ae8e8c349f529b201ed2.tar.gz mill-b83546cacea1292af3d4ae8e8c349f529b201ed2.tar.bz2 mill-b83546cacea1292af3d4ae8e8c349f529b201ed2.zip |
- Swap `Task.traverse` implementation to match behavior of other `traverse` implementations, added a `Task.sequence` that does what `traverse` used to do
- Added a `test.sh` script to easily kick off self-hosted unit test runs
- Tweak `ScalaModule` to fall back to the old behavior of including the transitive classpath during compilation
Diffstat (limited to 'scalaplugin/src')
-rw-r--r-- | scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala b/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala index 1ba15061..9f9425a4 100644 --- a/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala +++ b/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala @@ -78,21 +78,18 @@ trait ScalaModule extends Module with TaskModule{ outer => def upstreamRunClasspath = T{ - Task.traverse( - for (p <- projectDeps) - yield T.task(p.runDepClasspath() ++ Seq(p.compile().classes, p.resources())) + Task.traverse(projectDeps)(p => + T.task(p.runDepClasspath() ++ Seq(p.compile().classes, p.resources())) ) } - def upstreamCompileDepClasspath = T{ - Task.traverse(projectDeps.map(_.externalCompileDepClasspath)) - } - def upstreamCompileDepSources = T{ - Task.traverse(projectDeps.map(_.externalCompileDepSources)) - } - def upstreamCompileOutput = T{ - Task.traverse(projectDeps.map(_.compile)) + Task.traverse(projectDeps)(_.compile) + } + def upstreamCompileClasspath = T{ + externalCompileDepClasspath() ++ + upstreamCompileOutput().map(_.classes) ++ + Task.traverse(projectDeps)(_.compileDepClasspath)().flatten } def resolveDeps(deps: Task[Seq[Dep]], sources: Boolean = false) = T.task{ @@ -105,13 +102,14 @@ trait ScalaModule extends Module with TaskModule{ outer => ) } def externalCompileDepClasspath: T[Seq[PathRef]] = T{ - upstreamCompileDepClasspath().flatten ++ + Task.traverse(projectDeps)(_.externalCompileDepClasspath)().flatten ++ resolveDeps( T.task{ivyDeps() ++ compileIvyDeps() ++ scalaCompilerIvyDeps(scalaVersion())} )() } + def externalCompileDepSources: T[Seq[PathRef]] = T{ - upstreamCompileDepSources().flatten ++ + Task.traverse(projectDeps)(_.externalCompileDepSources)().flatten ++ resolveDeps( T.task{ivyDeps() ++ compileIvyDeps() ++ scalaCompilerIvyDeps(scalaVersion())}, sources = true @@ -122,9 +120,8 @@ trait ScalaModule extends Module with TaskModule{ outer => * might be less than the runtime classpath */ def compileDepClasspath: T[Seq[PathRef]] = T{ - upstreamCompileOutput().map(_.classes) ++ - depClasspath() ++ - externalCompileDepClasspath() + upstreamCompileClasspath() ++ + depClasspath() } /** |