summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-02-02 23:07:18 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-02-02 23:07:18 -0800
commit208b11c20643914547b9d643d1d4e6101cb17cd1 (patch)
tree543afb8819bd8d3ec60bb0ae9018ba0413db7ea4 /core
parentde2016a970b1e4bcd2f618815edc616282f7f20e (diff)
downloadmill-208b11c20643914547b9d643d1d4e6101cb17cd1.tar.gz
mill-208b11c20643914547b9d643d1d4e6101cb17cd1.tar.bz2
mill-208b11c20643914547b9d643d1d4e6101cb17cd1.zip
automatically create dest directory for targets to use
Diffstat (limited to 'core')
-rw-r--r--core/src/mill/eval/Evaluator.scala2
-rw-r--r--core/src/mill/modules/Jvm.scala2
-rw-r--r--core/src/mill/modules/Util.scala4
3 files changed, 2 insertions, 6 deletions
diff --git a/core/src/mill/eval/Evaluator.scala b/core/src/mill/eval/Evaluator.scala
index d8d690ac..0b5d372d 100644
--- a/core/src/mill/eval/Evaluator.scala
+++ b/core/src/mill/eval/Evaluator.scala
@@ -162,6 +162,8 @@ class Evaluator[T](val outPath: Path,
if (labelledNamedTask.task.flushDest) rm(paths.dest)
+ mkdir(paths.dest)
+
val (newResults, newEvaluated) = evaluateGroup(
group,
results,
diff --git a/core/src/mill/modules/Jvm.scala b/core/src/mill/modules/Jvm.scala
index fc1a1665..a22f0c77 100644
--- a/core/src/mill/modules/Jvm.scala
+++ b/core/src/mill/modules/Jvm.scala
@@ -164,7 +164,6 @@ object Jvm {
(implicit ctx: Ctx.DestCtx): PathRef = {
val outputPath = ctx.dest / "out.jar"
rm(outputPath)
- mkdir(outputPath/up)
val seen = mutable.Set.empty[RelPath]
seen.add("META-INF" / "MANIFEST.MF")
@@ -204,7 +203,6 @@ object Jvm {
rm(outputPath)
if(inputPaths.nonEmpty) {
- mkdir(outputPath/up)
val output = new FileOutputStream(outputPath.toIO)
diff --git a/core/src/mill/modules/Util.scala b/core/src/mill/modules/Util.scala
index 542f58d1..ce1203cf 100644
--- a/core/src/mill/modules/Util.scala
+++ b/core/src/mill/modules/Util.scala
@@ -7,7 +7,6 @@ import mill.util.Ctx
object Util {
def download(url: String, dest: RelPath = "download")(implicit ctx: Ctx.DestCtx) = {
- ammonite.ops.mkdir(ctx.dest)
val out = ctx.dest / dest
val website = new java.net.URI(url).toURL
@@ -27,8 +26,6 @@ object Util {
def downloadUnpackZip(url: String, dest: RelPath = "unpacked")
(implicit ctx: Ctx.DestCtx) = {
- ctx.dest
- mkdir(ctx.dest)
val tmpName = if (dest == empty / "tmp.zip") "tmp2.zip" else "tmp.zip"
val downloaded = download(url, tmpName)
@@ -37,7 +34,6 @@ object Util {
def unpackZip(src: Path, dest: RelPath = "unpacked")
(implicit ctx: Ctx.DestCtx) = {
- mkdir(ctx.dest)
val byteStream = read.getInputStream(src)
val zipStream = new java.util.zip.ZipInputStream(byteStream)