From 208b11c20643914547b9d643d1d4e6101cb17cd1 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Fri, 2 Feb 2018 23:07:18 -0800 Subject: automatically create dest directory for targets to use --- core/src/mill/eval/Evaluator.scala | 2 ++ core/src/mill/modules/Jvm.scala | 2 -- core/src/mill/modules/Util.scala | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) (limited to 'core') 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) -- cgit v1.2.3