@@ -12,11 +12,12 @@ import mill.contrib.bloop.Bloop
1212import mill .define .Command
1313import mill .main .Tasks
1414import mill .scalalib ._
15- import mill .scalalib .publish ._
1615import mill .scalalib .api .ZincWorkerUtil ._
16+ import mill .scalalib .publish ._
1717import mill .testrunner .TestResult
18- import scala .util .chaining .scalaUtilChainingOps
1918import scala .concurrent .{Await , ExecutionContext , Future , duration }
19+ import scala .util .chaining .scalaUtilChainingOps
20+ import scala .util .control .NonFatal
2021
2122val ghOrg = " com-lihaoyi"
2223val ghRepo = " Ammonite"
@@ -34,15 +35,15 @@ val isPublishableCommit =
3435 publishBranches.exists(suffix => x.endsWith(s " / ${suffix}" ))
3536 )
3637
37- val latestTaggedVersion = os.proc(" git" , " describe" , " --abbrev=0" , " --tags" ).call().out.trim
38+ val latestTaggedVersion = os.proc(" git" , " describe" , " --abbrev=0" , " --tags" ).call().out.trim()
3839
39- val gitHead = os.proc(" git" , " rev-parse" , " HEAD" ).call().out.trim
40+ val gitHead = os.proc(" git" , " rev-parse" , " HEAD" ).call().out.trim()
4041
4142val commitsSinceTaggedVersion = {
4243 os.proc(" git" , " rev-list" , gitHead, " --not" , latestTaggedVersion, " --count" )
4344 .call()
4445 .out
45- .trim
46+ .trim()
4647 .toInt
4748}
4849
@@ -69,10 +70,10 @@ val (buildVersion, unstable) = scala.util.Try(
6970 os.proc(" git" , " describe" , " --exact-match" , " --tags" , " --always" , gitHead)
7071 .call()
7172 .out
72- .trim
73+ .trim()
7374).toOption match {
7475 case None =>
75- val gitHash = os.proc(" git" , " rev-parse" , " --short" , " HEAD" ).call().out.trim
76+ val gitHash = os.proc(" git" , " rev-parse" , " --short" , " HEAD" ).call().out.trim()
7677 (s " $latestTaggedVersion- $commitsSinceTaggedVersion- $gitHash" , true )
7778 case Some (tagName) => (tagName, false )
7879}
@@ -286,7 +287,7 @@ trait AmmDependenciesResourceFileModule extends JavaModule {
286287 def dependencyResourceFileName : String
287288 def dependencyFileResources = T {
288289 val deps0 = compileIvyDeps().map(bindDependency()) ++ transitiveIvyDeps()
289- val (_, res) = mill.modules .Jvm .resolveDependenciesMetadata(
290+ val (_, res) = mill.util .Jvm .resolveDependenciesMetadata(
290291 repositoriesTask(),
291292 deps0.map(_.dep), // .map(resolveCoursierDependency().apply(_)),
292293 deps0.filter(_.force).map(_.dep), // .map(resolveCoursierDependency().apply(_)),
@@ -407,7 +408,7 @@ object amm extends Cross[MainModule](fullCrossScalaVersions) {
407408 val outDir = T .ctx().dest
408409 val javadocDir = outDir / " javadoc"
409410 os.makeDir.all(javadocDir)
410- mill.api.Result .Success (mill.modules .Jvm .createJar(Agg (javadocDir))(outDir))
411+ mill.api.Result .Success (mill.util .Jvm .createJar(Agg (javadocDir))(outDir))
411412 }
412413 else super .docJar
413414 def constantsSourceDir = T {
@@ -511,7 +512,7 @@ object amm extends Cross[MainModule](fullCrossScalaVersions) {
511512 amm.repl.api().exposedClassPath() ++
512513 amm.compiler().exposedClassPath() ++
513514 Seq (compile().classes) ++
514- resolveDeps(T .task { compileIvyDeps().map(bindDependency()) ++ transitiveIvyDeps() })()
515+ resolveDeps(T .task { this . compileIvyDeps().map(bindDependency()) ++ transitiveIvyDeps() })()
515516 )
516517 }
517518
@@ -564,7 +565,7 @@ trait MainModule extends AmmModule {
564565 externalSources()
565566
566567 def prependShellScript = T {
567- mill.modules .Jvm .launcherUniversalScript(
568+ mill.util .Jvm .launcherUniversalScript(
568569 mainClass().get,
569570 Agg (" $0" ),
570571 Agg (" %~dpnx0" ),
@@ -657,7 +658,7 @@ def generateApiWhitelist(replApiCp: Seq[PathRef])(implicit ctx: mill.api.Ctx.Des
657658 val thinClasspathEntries = replApiCp.map(_.path).flatMap { cpRoot =>
658659 if (os.isFile(cpRoot) && cpRoot.ext == " jar" ) {
659660 val zip = new java.util.zip.ZipFile (cpRoot.toIO)
660- import collection . JavaConverters ._
661+ import scala . jdk . CollectionConverters ._
661662 for (e <- zip.entries().asScala) yield e.getName
662663 } else if (os.isDir(cpRoot)) {
663664 for (sub <- os.walk(cpRoot)) yield sub.relativeTo(cpRoot).toString
@@ -891,7 +892,7 @@ def publishDocs(skipDeploy: Boolean = false): Command[Unit] = {
891892 )
892893 )
893894 } catch {
894- case e =>
895+ case NonFatal (e) =>
895896 println(e)
896897 e.printStackTrace()
897898 throw e
@@ -1019,7 +1020,7 @@ def publishSonatype(
10191020 ),
10201021 readTimeout = 600000 ,
10211022 connectTimeout = 600000 ,
1022- log = T .ctx(). log,
1023+ log = T .log,
10231024 workspace = T .workspace,
10241025 env = T .env,
10251026 awaitTimeout = 600000 ,
0 commit comments