From 1f97e90aa09f85a05e4b5ce289ea63048c50b557 Mon Sep 17 00:00:00 2001 From: Tobias Roeser Date: Fri, 1 Mar 2024 10:44:13 +0100 Subject: [PATCH 1/6] Update Mill from 0.10.15 to 0.11.7 Some changes are wild guesses. And it does not compile all modules. Here is one error: ``` amm.compiler[2.12.8].compile java.io.IOError: java.lang.RuntimeException: /packages cannot be represented as URI ``` --- .mill-version | 2 +- build.sc | 102 ++++++++++++++++++++++++++------------------------ ci/upload.sc | 2 +- 3 files changed, 56 insertions(+), 50 deletions(-) diff --git a/.mill-version b/.mill-version index ba788384c..b80f98e66 100644 --- a/.mill-version +++ b/.mill-version @@ -1 +1 @@ -0.10.15 +0.11.7 diff --git a/build.sc b/build.sc index 92f4db717..cd39ad22d 100644 --- a/build.sc +++ b/build.sc @@ -4,10 +4,9 @@ import $ivy.`io.get-coursier::coursier-launcher:2.1.0-RC1` import $file.ci.upload // imports import java.util.concurrent.atomic.AtomicInteger -import scala.concurrent.{Await, ExecutionContext, Future, duration} -import scala.util.chaining.scalaUtilChainingOps import coursier.mavenRepositoryString import mill._ +import mill.api.Lazy import mill.api.Result import mill.contrib.bloop.Bloop import mill.define.Command @@ -15,7 +14,9 @@ import mill.main.Tasks import mill.scalalib._ import mill.scalalib.publish._ import mill.scalalib.api.ZincWorkerUtil._ -import mill.testrunner.TestRunner +import mill.testrunner.TestResult +import scala.util.chaining.scalaUtilChainingOps +import scala.concurrent.{Await, ExecutionContext, Future, duration} val ghOrg = "com-lihaoyi" val ghRepo = "Ammonite" @@ -166,11 +167,12 @@ trait AmmInternalModule extends CrossSbtModule with Bloop.Module { ivy"$scalaO:scala-library:$scalaV" ) } - trait AmmTests extends super.Tests with TestModule.Utest { + trait AmmTests extends CrossSbtModuleTests with TestModule.Utest { def ivyDeps = super.ivyDeps() ++ Agg(Deps.utest) def forkArgs = Seq("-Xmx2g", "-Dfile.encoding=UTF8") } - def allIvyDeps = T { transitiveIvyDeps() ++ scalaLibraryIvyDeps() } + // why is this here? +// def allIvyDeps = T { transitiveIvyDeps() ++ scalaLibraryIvyDeps() } def sources = T.sources { val sv = scalaVersion() val extraDir = @@ -221,11 +223,13 @@ trait AmmInternalModule extends CrossSbtModule with Bloop.Module { super.sources() ++ extraDir ++ extraDir2 ++ extraDir3 ++ extraDir4 ++ extraDir5 } def externalSources = T { - resolveDeps(allIvyDeps, sources = true)() + resolveDeps(transitiveIvyDeps, sources = true)() + } + def repositoriesTask = T.task { + super.repositoriesTask() ++ Seq( + mvn"https://scala-ci.typesafe.com/artifactory/scala-integration" + ) } - def repositories = super.repositories ++ Seq( - mvn"https://scala-ci.typesafe.com/artifactory/scala-integration" - ) override implicit def crossSbtModuleResolver: mill.define.Cross.Resolver[CrossModuleBase] = new mill.define.Cross.Resolver[CrossModuleBase] { def resolve[V <: CrossModuleBase](c: Cross[V]): V = { @@ -237,14 +241,14 @@ trait AmmInternalModule extends CrossSbtModule with Bloop.Module { } .flatMap(prefix => c.items - .map(_._2) + .map(_.module.value) .find(_.crossScalaVersion.split('.').startsWith(prefix)) ) .collectFirst { case x => x } .getOrElse { throw new Exception( s"Unable to find compatible cross version between $crossScalaVersion and " + - c.items.map(_._2.crossScalaVersion).mkString(",") + c.items.map(_.module.value.crossScalaVersion).mkString(",") ) } @@ -265,13 +269,13 @@ trait AmmModule extends AmmInternalModule with PublishModule { ) def transitiveJars: T[Agg[PathRef]] = T { - mill.define.Target.traverse(this +: moduleDeps)(m => + mill.define.Target.traverse(transitiveModuleDeps)(m => T.task { m.jar() } )() } def transitiveSourceJars: T[Agg[PathRef]] = T { - mill.define.Target.traverse(this +: moduleDeps)(m => + mill.define.Target.traverse(transitiveModuleDeps)(m => T.task { m.sourceJar() } )() } @@ -281,11 +285,12 @@ trait AmmModule extends AmmInternalModule with PublishModule { trait AmmDependenciesResourceFileModule extends JavaModule { def dependencyResourceFileName: String def dependencyFileResources = T { - val deps0 = T.task { compileIvyDeps() ++ transitiveIvyDeps() }() +// val deps0 = T.task { compileIvyDeps() ++ transitiveIvyDeps() }() + val deps0 = transitiveCompileIvyDeps() val (_, res) = mill.modules.Jvm.resolveDependenciesMetadata( repositoriesTask(), - deps0.map(resolveCoursierDependency().apply(_)), - deps0.filter(_.force).map(resolveCoursierDependency().apply(_)), + deps0.map(_.dep), // .map(resolveCoursierDependency().apply(_)), + deps0.filter(_.force).map(_.dep), // .map(resolveCoursierDependency().apply(_)), mapDependencies = Some(mapDependencies()) ) @@ -300,8 +305,8 @@ trait AmmDependenciesResourceFileModule extends JavaModule { } } -object terminal extends Cross[TerminalModule](binCrossScalaVersions: _*) -class TerminalModule(val crossScalaVersion: String) extends AmmModule { +object terminal extends Cross[TerminalModule](binCrossScalaVersions) +trait TerminalModule extends AmmModule { def ivyDeps = T { super.ivyDeps() ++ Agg( Deps.fansi, @@ -313,9 +318,9 @@ class TerminalModule(val crossScalaVersion: String) extends AmmModule { } } -object amm extends Cross[MainModule](fullCrossScalaVersions: _*) { - object util extends Cross[UtilModule](binCrossScalaVersions: _*) - class UtilModule(val crossScalaVersion: String) extends AmmModule { +object amm extends Cross[MainModule](fullCrossScalaVersions) { + object util extends Cross[UtilModule](binCrossScalaVersions) + trait UtilModule extends AmmModule { def moduleDeps = Seq() def ivyDeps = T { super.ivyDeps() ++ Agg( @@ -330,8 +335,8 @@ object amm extends Cross[MainModule](fullCrossScalaVersions: _*) { (if (isScala3(crossScalaVersion)) Agg.empty[Dep] else Agg(Deps.scalaReflect(scalaVersion()))) } - object runtime extends Cross[RuntimeModule](fullCrossScalaVersions: _*) - class RuntimeModule(val crossScalaVersion: String) extends AmmModule { + object runtime extends Cross[RuntimeModule](fullCrossScalaVersions) + trait RuntimeModule extends AmmModule { def moduleDeps = Seq(amm.util(), interp.api(), amm.repl.api()) def isCrossFullScalaVersion = true def ivyDeps = super.ivyDeps() ++ Agg( @@ -343,9 +348,9 @@ object amm extends Cross[MainModule](fullCrossScalaVersions: _*) { ) } - object compiler extends Cross[CompilerModule](fullCrossScalaVersions: _*) { - object interface extends Cross[CompilerInterfaceModule](fullCrossScalaVersions: _*) - class CompilerInterfaceModule(val crossScalaVersion: String) extends AmmModule { + object compiler extends Cross[CompilerModule](fullCrossScalaVersions) { + object interface extends Cross[CompilerInterfaceModule](fullCrossScalaVersions) + trait CompilerInterfaceModule extends AmmModule { def isCrossFullScalaVersion = true def moduleDeps = Seq(amm.util()) def exposedClassPath = T { @@ -356,7 +361,7 @@ object amm extends Cross[MainModule](fullCrossScalaVersions: _*) { } } } - class CompilerModule(val crossScalaVersion: String) extends AmmModule { + trait CompilerModule extends AmmModule { def supports3 = true def moduleDeps = Seq(amm.compiler.interface(), amm.util(), amm.repl.api()) def isCrossFullScalaVersion = true @@ -389,9 +394,9 @@ object amm extends Cross[MainModule](fullCrossScalaVersions: _*) { object test extends AmmTests } - object interp extends Cross[InterpModule](fullCrossScalaVersions: _*) { - object api extends Cross[InterpApiModule](fullCrossScalaVersions: _*) - class InterpApiModule(val crossScalaVersion: String) extends AmmModule + object interp extends Cross[InterpModule](fullCrossScalaVersions) { + object api extends Cross[InterpApiModule](fullCrossScalaVersions) + trait InterpApiModule extends AmmModule with AmmDependenciesResourceFileModule { def moduleDeps = Seq(amm.compiler.interface(), amm.util()) def isCrossFullScalaVersion = true @@ -424,7 +429,7 @@ object amm extends Cross[MainModule](fullCrossScalaVersions: _*) { super.generatedSources() ++ Seq(constantsSourceDir()) } } - class InterpModule(val crossScalaVersion: String) extends AmmModule { + trait InterpModule extends AmmModule { def moduleDeps = Seq(amm.util(), amm.runtime(), amm.compiler.interface()) def isCrossFullScalaVersion = true def ivyDeps = super.ivyDeps() ++ Agg( @@ -449,10 +454,10 @@ object amm extends Cross[MainModule](fullCrossScalaVersions: _*) { // ) // } - object repl extends Cross[ReplModule](fullCrossScalaVersions: _*) { + object repl extends Cross[ReplModule](fullCrossScalaVersions) { - object api extends Cross[ReplApiModule](fullCrossScalaVersions: _*) - class ReplApiModule(val crossScalaVersion: String) extends AmmModule + object api extends Cross[ReplApiModule](fullCrossScalaVersions) + trait ReplApiModule extends AmmModule with AmmDependenciesResourceFileModule { def isCrossFullScalaVersion = true def dependencyResourceFileName = "amm-dependencies.txt" @@ -478,7 +483,7 @@ object amm extends Cross[MainModule](fullCrossScalaVersions: _*) { } } - class ReplModule(val crossScalaVersion: String) extends AmmModule { + trait ReplModule extends AmmModule { def isCrossFullScalaVersion = true def moduleDeps = Seq( amm.util(), @@ -507,7 +512,7 @@ object amm extends Cross[MainModule](fullCrossScalaVersions: _*) { amm.repl.api().exposedClassPath() ++ amm.compiler().exposedClassPath() ++ Seq(compile().classes) ++ - resolveDeps(T.task { compileIvyDeps() ++ transitiveIvyDeps() })() + resolveDeps(T.task { compileIvyDeps().map(bindDependency()) ++ transitiveIvyDeps() })() ) } @@ -519,7 +524,7 @@ object amm extends Cross[MainModule](fullCrossScalaVersions: _*) { (super.resources() ++ ReplModule.this.sources() ++ ReplModule.this.externalSources() ++ - resolveDeps(ivyDeps, sources = true)()).distinct + resolveDeps(T.task { ivyDeps().map(bindDependency()) }, sources = true)()).distinct } def ivyDeps = super.ivyDeps() ++ amm.compiler().ivyDeps() ++ Agg( Deps.scalazCore @@ -528,7 +533,7 @@ object amm extends Cross[MainModule](fullCrossScalaVersions: _*) { } } -class MainModule(val crossScalaVersion: String) extends AmmModule { +trait MainModule extends AmmModule { def isCrossFullScalaVersion = true @@ -624,7 +629,7 @@ class MainModule(val crossScalaVersion: String) extends AmmModule { amm.repl.api().exposedClassPath() ++ amm.compiler().exposedClassPath() ++ Seq(amm.repl().test.compile().classes, compile().classes) ++ - resolveDeps(T.task { compileIvyDeps() ++ transitiveIvyDeps() })() + resolveDeps(T.task { compileIvyDeps().map(bindDependency()) ++ transitiveIvyDeps() })() ) } @@ -672,8 +677,8 @@ def generateApiWhitelist(replApiCp: Seq[PathRef])(implicit ctx: mill.api.Ctx.Des PathRef(ctx.dest) } -object integration extends Cross[IntegrationModule](fullCrossScalaVersions: _*) -class IntegrationModule(val crossScalaVersion: String) extends AmmInternalModule { +object integration extends Cross[IntegrationModule](fullCrossScalaVersions) +trait IntegrationModule extends AmmInternalModule { def moduleDeps = Seq(amm()) def ivyDeps = T { super.ivyDeps() ++ ( @@ -696,8 +701,8 @@ class IntegrationModule(val crossScalaVersion: String) extends AmmInternalModule } } -object sshd extends Cross[SshdModule](fullCrossScalaVersions: _*) -class SshdModule(val crossScalaVersion: String) extends AmmModule { +object sshd extends Cross[SshdModule](fullCrossScalaVersions) +trait SshdModule extends AmmModule { def moduleDeps = Seq(amm()) def isCrossFullScalaVersion = true def ivyDeps = super.ivyDeps() ++ Agg( @@ -719,18 +724,19 @@ class SshdModule(val crossScalaVersion: String) extends AmmModule { * Selects all cross module instances, that match the given predicate. * In Mill 0.11, this can be hopefully replaced with a simple filter on the `crossValue`. */ -def selectCrossPrefix[T <: Module, V]( +def selectCrossPrefix[T <: Cross.Module[_], V]( crossModule: Cross[T], predicate: String => Boolean )(accessor: T => V): Seq[V] = crossModule.items.collect { - case (List(key: String), mod) if predicate(key) => accessor(mod) + case item if predicate(item.crossSegments.head) => accessor(item.module.value) +// case (List(key: String), mod) if predicate(key) => accessor(mod) } .tap { mods => if (mods.isEmpty) sys.error(s"No matching cross-instances found in ${crossModule}") } -def unitTest(scalaBinaryVersion: String = ""): Command[Seq[(String, Seq[TestRunner.Result])]] = { +def unitTest(scalaBinaryVersion: String = ""): Command[Seq[(String, Seq[TestResult])]] = { val pred = (_: String).startsWith(scalaBinaryVersion) val tests = Seq( selectCrossPrefix(terminal, pred)(_.test), @@ -762,7 +768,7 @@ def generateConstantsFile( oldCurlUrls: Seq[(String, String)] = Nil, oldUnstableCurlUrls: Seq[(String, String)] = Nil, returnDirectory: Boolean = true -)(implicit ctx: mill.util.Ctx.Dest) = { +)(implicit ctx: mill.api.Ctx.Dest) = { val versionTxt = s""" package ammonite object Constants{ @@ -790,7 +796,7 @@ def generateConstantsFile( } def generateDependenciesFile(fileName: String, deps: Seq[coursier.Dependency])(implicit - ctx: mill.util.Ctx.Dest + ctx: mill.api.Ctx.Dest ) = { val dir = ctx.dest / "extra-resources" diff --git a/ci/upload.sc b/ci/upload.sc index a7fb5e673..77fec4940 100644 --- a/ci/upload.sc +++ b/ci/upload.sc @@ -1,6 +1,6 @@ #!/usr/bin/env amm -@main +@mainargs.main def apply( uploadedFile: os.Path, tagName: String, From 9c29de0e8c1d01d99bb5132fee11847a697827d5 Mon Sep 17 00:00:00 2001 From: Tobias Roeser Date: Tue, 5 Mar 2024 16:29:10 +0100 Subject: [PATCH 2/6] Revert some changes --- build.sc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.sc b/build.sc index cd39ad22d..48b7485f1 100644 --- a/build.sc +++ b/build.sc @@ -172,7 +172,7 @@ trait AmmInternalModule extends CrossSbtModule with Bloop.Module { def forkArgs = Seq("-Xmx2g", "-Dfile.encoding=UTF8") } // why is this here? -// def allIvyDeps = T { transitiveIvyDeps() ++ scalaLibraryIvyDeps() } + def allIvyDeps = T { transitiveIvyDeps().map(_.toDep) } def sources = T.sources { val sv = scalaVersion() val extraDir = @@ -223,7 +223,7 @@ trait AmmInternalModule extends CrossSbtModule with Bloop.Module { super.sources() ++ extraDir ++ extraDir2 ++ extraDir3 ++ extraDir4 ++ extraDir5 } def externalSources = T { - resolveDeps(transitiveIvyDeps, sources = true)() + resolveDeps(T.task { allIvyDeps().map(bindDependency()) }, sources = true)() } def repositoriesTask = T.task { super.repositoriesTask() ++ Seq( @@ -269,13 +269,13 @@ trait AmmModule extends AmmInternalModule with PublishModule { ) def transitiveJars: T[Agg[PathRef]] = T { - mill.define.Target.traverse(transitiveModuleDeps)(m => + mill.define.Target.traverse(this +: moduleDeps)(m => T.task { m.jar() } )() } def transitiveSourceJars: T[Agg[PathRef]] = T { - mill.define.Target.traverse(transitiveModuleDeps)(m => + mill.define.Target.traverse(this +: moduleDeps)(m => T.task { m.sourceJar() } )() } From eb43cbd038a122e479e8b2821bda2fd8077f2758 Mon Sep 17 00:00:00 2001 From: Tobias Roeser Date: Tue, 5 Mar 2024 16:37:54 +0100 Subject: [PATCH 3/6] . --- build.sc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.sc b/build.sc index 48b7485f1..e477528b9 100644 --- a/build.sc +++ b/build.sc @@ -285,8 +285,7 @@ trait AmmModule extends AmmInternalModule with PublishModule { trait AmmDependenciesResourceFileModule extends JavaModule { def dependencyResourceFileName: String def dependencyFileResources = T { -// val deps0 = T.task { compileIvyDeps() ++ transitiveIvyDeps() }() - val deps0 = transitiveCompileIvyDeps() + val deps0 = compileIvyDeps().map(bindDependency()) ++ transitiveIvyDeps() val (_, res) = mill.modules.Jvm.resolveDependenciesMetadata( repositoriesTask(), deps0.map(_.dep), // .map(resolveCoursierDependency().apply(_)), From ab295f4e8dc8bbdf05e498edbfba57280aaae23c Mon Sep 17 00:00:00 2001 From: Tobias Roeser Date: Tue, 5 Mar 2024 16:50:28 +0100 Subject: [PATCH 4/6] . --- build.sc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sc b/build.sc index e477528b9..312673c18 100644 --- a/build.sc +++ b/build.sc @@ -172,7 +172,7 @@ trait AmmInternalModule extends CrossSbtModule with Bloop.Module { def forkArgs = Seq("-Xmx2g", "-Dfile.encoding=UTF8") } // why is this here? - def allIvyDeps = T { transitiveIvyDeps().map(_.toDep) } + def allIvyDeps = T { transitiveIvyDeps().map(_.toDep) ++ scalaLibraryIvyDeps() } def sources = T.sources { val sv = scalaVersion() val extraDir = From 20835297b71ac88a8ab7a7194be2c079f3deacb6 Mon Sep 17 00:00:00 2001 From: Tobias Roeser Date: Tue, 5 Mar 2024 16:51:05 +0100 Subject: [PATCH 5/6] Improve test selection --- build.sc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/build.sc b/build.sc index 312673c18..715947ad5 100644 --- a/build.sc +++ b/build.sc @@ -735,13 +735,15 @@ def selectCrossPrefix[T <: Cross.Module[_], V]( if (mods.isEmpty) sys.error(s"No matching cross-instances found in ${crossModule}") } -def unitTest(scalaBinaryVersion: String = ""): Command[Seq[(String, Seq[TestResult])]] = { - val pred = (_: String).startsWith(scalaBinaryVersion) +def unitTest(scalaVersion: String = "") = T.command { + val predBinVer = (_: String).startsWith(scalaVersion.split("[.]", 3).take(2).mkString(".")) + val predFullVer = (_: String).startsWith(scalaVersion) val tests = Seq( - selectCrossPrefix(terminal, pred)(_.test), - selectCrossPrefix(amm.repl, pred)(_.test), - selectCrossPrefix(amm, pred)(_.test), - selectCrossPrefix(sshd, pred)(_.test) + selectCrossPrefix(terminal, predBinVer)(_.test), + selectCrossPrefix(amm.compiler, predFullVer)(_.test), + selectCrossPrefix(amm.repl, predFullVer)(_.test), + selectCrossPrefix(amm, predFullVer)(_.test), + selectCrossPrefix(sshd, predFullVer)(_.test) ).flatten val log = T.task { T.log.outputStream.println(s"Testing modules: ${tests.mkString(", ")}") } From fe08431b1747398a05e5e0a3acdf76f91f699992 Mon Sep 17 00:00:00 2001 From: Tobias Roeser Date: Tue, 5 Mar 2024 18:21:41 +0100 Subject: [PATCH 6/6] Fix deprecations --- build.sc | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/build.sc b/build.sc index 715947ad5..dd294e750 100644 --- a/build.sc +++ b/build.sc @@ -12,11 +12,12 @@ import mill.contrib.bloop.Bloop import mill.define.Command import mill.main.Tasks import mill.scalalib._ -import mill.scalalib.publish._ import mill.scalalib.api.ZincWorkerUtil._ +import mill.scalalib.publish._ import mill.testrunner.TestResult -import scala.util.chaining.scalaUtilChainingOps import scala.concurrent.{Await, ExecutionContext, Future, duration} +import scala.util.chaining.scalaUtilChainingOps +import scala.util.control.NonFatal val ghOrg = "com-lihaoyi" val ghRepo = "Ammonite" @@ -34,15 +35,15 @@ val isPublishableCommit = publishBranches.exists(suffix => x.endsWith(s"/${suffix}")) ) -val latestTaggedVersion = os.proc("git", "describe", "--abbrev=0", "--tags").call().out.trim +val latestTaggedVersion = os.proc("git", "describe", "--abbrev=0", "--tags").call().out.trim() -val gitHead = os.proc("git", "rev-parse", "HEAD").call().out.trim +val gitHead = os.proc("git", "rev-parse", "HEAD").call().out.trim() val commitsSinceTaggedVersion = { os.proc("git", "rev-list", gitHead, "--not", latestTaggedVersion, "--count") .call() .out - .trim + .trim() .toInt } @@ -69,10 +70,10 @@ val (buildVersion, unstable) = scala.util.Try( os.proc("git", "describe", "--exact-match", "--tags", "--always", gitHead) .call() .out - .trim + .trim() ).toOption match { case None => - val gitHash = os.proc("git", "rev-parse", "--short", "HEAD").call().out.trim + val gitHash = os.proc("git", "rev-parse", "--short", "HEAD").call().out.trim() (s"$latestTaggedVersion-$commitsSinceTaggedVersion-$gitHash", true) case Some(tagName) => (tagName, false) } @@ -286,7 +287,7 @@ trait AmmDependenciesResourceFileModule extends JavaModule { def dependencyResourceFileName: String def dependencyFileResources = T { val deps0 = compileIvyDeps().map(bindDependency()) ++ transitiveIvyDeps() - val (_, res) = mill.modules.Jvm.resolveDependenciesMetadata( + val (_, res) = mill.util.Jvm.resolveDependenciesMetadata( repositoriesTask(), deps0.map(_.dep), // .map(resolveCoursierDependency().apply(_)), deps0.filter(_.force).map(_.dep), // .map(resolveCoursierDependency().apply(_)), @@ -407,7 +408,7 @@ object amm extends Cross[MainModule](fullCrossScalaVersions) { val outDir = T.ctx().dest val javadocDir = outDir / "javadoc" os.makeDir.all(javadocDir) - mill.api.Result.Success(mill.modules.Jvm.createJar(Agg(javadocDir))(outDir)) + mill.api.Result.Success(mill.util.Jvm.createJar(Agg(javadocDir))(outDir)) } else super.docJar def constantsSourceDir = T { @@ -511,7 +512,7 @@ object amm extends Cross[MainModule](fullCrossScalaVersions) { amm.repl.api().exposedClassPath() ++ amm.compiler().exposedClassPath() ++ Seq(compile().classes) ++ - resolveDeps(T.task { compileIvyDeps().map(bindDependency()) ++ transitiveIvyDeps() })() + resolveDeps(T.task { this.compileIvyDeps().map(bindDependency()) ++ transitiveIvyDeps() })() ) } @@ -564,7 +565,7 @@ trait MainModule extends AmmModule { externalSources() def prependShellScript = T { - mill.modules.Jvm.launcherUniversalScript( + mill.util.Jvm.launcherUniversalScript( mainClass().get, Agg("$0"), Agg("%~dpnx0"), @@ -657,7 +658,7 @@ def generateApiWhitelist(replApiCp: Seq[PathRef])(implicit ctx: mill.api.Ctx.Des val thinClasspathEntries = replApiCp.map(_.path).flatMap { cpRoot => if (os.isFile(cpRoot) && cpRoot.ext == "jar") { val zip = new java.util.zip.ZipFile(cpRoot.toIO) - import collection.JavaConverters._ + import scala.jdk.CollectionConverters._ for (e <- zip.entries().asScala) yield e.getName } else if (os.isDir(cpRoot)) { for (sub <- os.walk(cpRoot)) yield sub.relativeTo(cpRoot).toString @@ -891,7 +892,7 @@ def publishDocs(skipDeploy: Boolean = false): Command[Unit] = { ) ) } catch { - case e => + case NonFatal(e) => println(e) e.printStackTrace() throw e @@ -1019,7 +1020,7 @@ def publishSonatype( ), readTimeout = 600000, connectTimeout = 600000, - log = T.ctx().log, + log = T.log, workspace = T.workspace, env = T.env, awaitTimeout = 600000,