From 04276232378fb4f36ba3a00fc1fb1c5d9c030166 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Tue, 8 Oct 2024 07:17:13 +0200 Subject: [PATCH] Bump OS-Lib to 0.11.0 (#3684) --- build.mill | 2 +- main/init/src/mill/init/InitModule.scala | 5 ++--- .../worker/src/mill/scalalib/worker/ZincWorkerImpl.scala | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/build.mill b/build.mill index 412f6180546..0715d9dc3d6 100644 --- a/build.mill +++ b/build.mill @@ -149,7 +149,7 @@ object Deps { val junitInterface = ivy"com.github.sbt:junit-interface:0.13.3" val commonsIO = ivy"commons-io:commons-io:2.16.1" val log4j2Core = ivy"org.apache.logging.log4j:log4j-core:2.23.1" - val osLib = ivy"com.lihaoyi::os-lib:0.10.7" + val osLib = ivy"com.lihaoyi::os-lib:0.11.0" val pprint = ivy"com.lihaoyi::pprint:0.9.0" val mainargs = ivy"com.lihaoyi::mainargs:0.7.4" val millModuledefsVersion = "0.11.0" diff --git a/main/init/src/mill/init/InitModule.scala b/main/init/src/mill/init/InitModule.scala index 88cec0d5d6c..76b05442767 100644 --- a/main/init/src/mill/init/InitModule.scala +++ b/main/init/src/mill/init/InitModule.scala @@ -1,7 +1,6 @@ package mill.init import mainargs.{Flag, arg} -import mill.api.IO import mill.define.{Discover, ExternalModule} import mill.{Command, Module, T} @@ -54,7 +53,7 @@ trait InitModule extends Module { val extractedDirName = zipName.stripSuffix(".zip") val downloaded = os.temp(requests.get(url)) println(s"Unpacking example...") - val unpackPath = IO.unpackZip(downloaded, os.rel) + val unpackPath = os.unzip(downloaded, T.dest) val extractedPath = T.dest / extractedDirName val conflicting = for { p <- os.walk(extractedPath) @@ -81,7 +80,7 @@ trait InitModule extends Module { os.perms.set(T.workspace / "mill", "rwxrwxrwx") ( - Seq(unpackPath.path.toString()), + Seq(unpackPath.toString()), s"Example download and unpacked to [${T.workspace}]; " + "See `build.mill` for an explanation of this example and instructions on how to use it" ) diff --git a/scalalib/worker/src/mill/scalalib/worker/ZincWorkerImpl.scala b/scalalib/worker/src/mill/scalalib/worker/ZincWorkerImpl.scala index 6575b532a9a..5b7c373992a 100644 --- a/scalalib/worker/src/mill/scalalib/worker/ZincWorkerImpl.scala +++ b/scalalib/worker/src/mill/scalalib/worker/ZincWorkerImpl.scala @@ -197,18 +197,18 @@ class ZincWorkerImpl( os.makeDir.all(workingDir) os.makeDir.all(compileDest) - val sourceFolder = mill.api.IO.unpackZip(compilerBridgeSourcesJar)(workingDir) + val sourceFolder = os.unzip(compilerBridgeSourcesJar, workingDir / "unpacked") val classloader = mill.api.ClassLoader.create( compilerClasspath.iterator.map(_.path.toIO.toURI.toURL).toSeq, null )(ctx0) val (sources, resources) = - os.walk(sourceFolder.path).filter(os.isFile) + os.walk(sourceFolder).filter(os.isFile) .partition(a => a.ext == "scala" || a.ext == "java") resources.foreach { res => - val dest = compileDest / res.relativeTo(sourceFolder.path) + val dest = compileDest / res.relativeTo(sourceFolder) os.move(res, dest, replaceExisting = true, createFolders = true) }