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 /core/src/main/scala | |
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 'core/src/main/scala')
-rw-r--r-- | core/src/main/scala/mill/define/Task.scala | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/src/main/scala/mill/define/Task.scala b/core/src/main/scala/mill/define/Task.scala index 8393acfb..d8ca8499 100644 --- a/core/src/main/scala/mill/define/Task.scala +++ b/core/src/main/scala/mill/define/Task.scala @@ -182,10 +182,12 @@ object Task { } - def traverse[T](source: Seq[Task[T]]) = { - new Traverse[T](source) + def traverse[T, V](source: Seq[T])(f: T => Task[V]) = { + new Sequence[V](source.map(f)) } - class Traverse[+T](inputs0: Seq[Task[T]]) extends Task[Seq[T]]{ + def sequence[T](source: Seq[Task[T]]) = new Sequence[T](source) + + class Sequence[+T](inputs0: Seq[Task[T]]) extends Task[Seq[T]]{ val inputs = inputs0 def evaluate(args: Ctx) = { for (i <- 0 until args.length) |