diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2017-10-18 21:54:37 -0700 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2017-10-18 21:54:37 -0700 |
commit | 738104aafa8ac0f0dd09e9ef015d909b3f016158 (patch) | |
tree | 63fcba527489f1ee69913745dd69336c1c58ad0d /src/main/scala/hbt/Args.scala | |
parent | 538b5ac28b80285953dbea08651cf5c5afa7c0f9 (diff) | |
download | mill-738104aafa8ac0f0dd09e9ef015d909b3f016158.tar.gz mill-738104aafa8ac0f0dd09e9ef015d909b3f016158.tar.bz2 mill-738104aafa8ac0f0dd09e9ef015d909b3f016158.zip |
- Add a configurable workspace to `evaluateTargetGraph`
- Break up `Hbt.scala` into `Args.scala` `Target.scala` and `Evaluator.scala`
Diffstat (limited to 'src/main/scala/hbt/Args.scala')
-rw-r--r-- | src/main/scala/hbt/Args.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/scala/hbt/Args.scala b/src/main/scala/hbt/Args.scala new file mode 100644 index 00000000..c87ec96b --- /dev/null +++ b/src/main/scala/hbt/Args.scala @@ -0,0 +1,11 @@ +package hbt + +import java.nio.{file => jnio} + +class Args(val args: IndexedSeq[_], val dest: jnio.Path){ + def length = args.length + def apply[T](index: Int): T = { + if (index >= 0 && index < args.length) args(index).asInstanceOf[T] + else throw new IndexOutOfBoundsException(s"Index $index outside of range 0 - ${args.length}") + } +} |