summaryrefslogtreecommitdiff
path: root/build.sc
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2017-11-22 20:41:35 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2017-11-22 20:41:35 -0800
commit3a87314737bea39b5d194ad2a9e7a88085011755 (patch)
tree26efb3ae3326df423376c675913a3a5bed359103 /build.sc
parentc73413a6ce30ba78f6dd34081bdd3d9bb8f2099d (diff)
downloadmill-3a87314737bea39b5d194ad2a9e7a88085011755.tar.gz
mill-3a87314737bea39b5d194ad2a9e7a88085011755.tar.bz2
mill-3a87314737bea39b5d194ad2a9e7a88085011755.zip
Targets living in cross modules can now be properly discovered, run and cached.
Try out the following commands on our Mill `build.sc` file to exercise this functionality - `scalaplugin/target/mill run Core.cross[jarA].jar` - `scalaplugin/target/mill run Core.cross[jarB].jar` - `scalaplugin/target/mill run Core.cross[jarC].jar`
Diffstat (limited to 'build.sc')
-rwxr-xr-xbuild.sc11
1 files changed, 9 insertions, 2 deletions
diff --git a/build.sc b/build.sc
index 86c5d636..08a5f3b9 100755
--- a/build.sc
+++ b/build.sc
@@ -22,10 +22,17 @@ object Core extends ScalaModule {
override def sources = pwd/'core/'src/'main/'scala
val cross =
- for(c <- mill.define.Cross("a", "b", "c"))
+ for(jarLabel <- mill.define.Cross("jarA", "jarB", "jarC"))
yield new mill.Module{
def printIt() = T.command{
- println("PRINTING IT: " + c)
+ println("PRINTING IT: " + jarLabel)
+ }
+ def jar = T{
+ val dest = T.ctx().dest
+ ammonite.ops.mkdir(dest/ammonite.ops.up)
+ ammonite.ops.cp(Core.jar().path, dest)
+
+ PathRef(dest)
}
}
}