@@ -12,11 +12,12 @@ import mill.contrib.bloop.Bloop
12
12
import mill .define .Command
13
13
import mill .main .Tasks
14
14
import mill .scalalib ._
15
- import mill .scalalib .publish ._
16
15
import mill .scalalib .api .ZincWorkerUtil ._
16
+ import mill .scalalib .publish ._
17
17
import mill .testrunner .TestResult
18
- import scala .util .chaining .scalaUtilChainingOps
19
18
import scala .concurrent .{Await , ExecutionContext , Future , duration }
19
+ import scala .util .chaining .scalaUtilChainingOps
20
+ import scala .util .control .NonFatal
20
21
21
22
val ghOrg = " com-lihaoyi"
22
23
val ghRepo = " Ammonite"
@@ -34,15 +35,15 @@ val isPublishableCommit =
34
35
publishBranches.exists(suffix => x.endsWith(s " / ${suffix}" ))
35
36
)
36
37
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()
38
39
39
- val gitHead = os.proc(" git" , " rev-parse" , " HEAD" ).call().out.trim
40
+ val gitHead = os.proc(" git" , " rev-parse" , " HEAD" ).call().out.trim()
40
41
41
42
val commitsSinceTaggedVersion = {
42
43
os.proc(" git" , " rev-list" , gitHead, " --not" , latestTaggedVersion, " --count" )
43
44
.call()
44
45
.out
45
- .trim
46
+ .trim()
46
47
.toInt
47
48
}
48
49
@@ -69,10 +70,10 @@ val (buildVersion, unstable) = scala.util.Try(
69
70
os.proc(" git" , " describe" , " --exact-match" , " --tags" , " --always" , gitHead)
70
71
.call()
71
72
.out
72
- .trim
73
+ .trim()
73
74
).toOption match {
74
75
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()
76
77
(s " $latestTaggedVersion- $commitsSinceTaggedVersion- $gitHash" , true )
77
78
case Some (tagName) => (tagName, false )
78
79
}
@@ -286,7 +287,7 @@ trait AmmDependenciesResourceFileModule extends JavaModule {
286
287
def dependencyResourceFileName : String
287
288
def dependencyFileResources = T {
288
289
val deps0 = compileIvyDeps().map(bindDependency()) ++ transitiveIvyDeps()
289
- val (_, res) = mill.modules .Jvm .resolveDependenciesMetadata(
290
+ val (_, res) = mill.util .Jvm .resolveDependenciesMetadata(
290
291
repositoriesTask(),
291
292
deps0.map(_.dep), // .map(resolveCoursierDependency().apply(_)),
292
293
deps0.filter(_.force).map(_.dep), // .map(resolveCoursierDependency().apply(_)),
@@ -407,7 +408,7 @@ object amm extends Cross[MainModule](fullCrossScalaVersions) {
407
408
val outDir = T .ctx().dest
408
409
val javadocDir = outDir / " javadoc"
409
410
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))
411
412
}
412
413
else super .docJar
413
414
def constantsSourceDir = T {
@@ -511,7 +512,7 @@ object amm extends Cross[MainModule](fullCrossScalaVersions) {
511
512
amm.repl.api().exposedClassPath() ++
512
513
amm.compiler().exposedClassPath() ++
513
514
Seq (compile().classes) ++
514
- resolveDeps(T .task { compileIvyDeps().map(bindDependency()) ++ transitiveIvyDeps() })()
515
+ resolveDeps(T .task { this . compileIvyDeps().map(bindDependency()) ++ transitiveIvyDeps() })()
515
516
)
516
517
}
517
518
@@ -564,7 +565,7 @@ trait MainModule extends AmmModule {
564
565
externalSources()
565
566
566
567
def prependShellScript = T {
567
- mill.modules .Jvm .launcherUniversalScript(
568
+ mill.util .Jvm .launcherUniversalScript(
568
569
mainClass().get,
569
570
Agg (" $0" ),
570
571
Agg (" %~dpnx0" ),
@@ -657,7 +658,7 @@ def generateApiWhitelist(replApiCp: Seq[PathRef])(implicit ctx: mill.api.Ctx.Des
657
658
val thinClasspathEntries = replApiCp.map(_.path).flatMap { cpRoot =>
658
659
if (os.isFile(cpRoot) && cpRoot.ext == " jar" ) {
659
660
val zip = new java.util.zip.ZipFile (cpRoot.toIO)
660
- import collection . JavaConverters ._
661
+ import scala . jdk . CollectionConverters ._
661
662
for (e <- zip.entries().asScala) yield e.getName
662
663
} else if (os.isDir(cpRoot)) {
663
664
for (sub <- os.walk(cpRoot)) yield sub.relativeTo(cpRoot).toString
@@ -891,7 +892,7 @@ def publishDocs(skipDeploy: Boolean = false): Command[Unit] = {
891
892
)
892
893
)
893
894
} catch {
894
- case e =>
895
+ case NonFatal (e) =>
895
896
println(e)
896
897
e.printStackTrace()
897
898
throw e
@@ -1019,7 +1020,7 @@ def publishSonatype(
1019
1020
),
1020
1021
readTimeout = 600000 ,
1021
1022
connectTimeout = 600000 ,
1022
- log = T .ctx(). log,
1023
+ log = T .log,
1023
1024
workspace = T .workspace,
1024
1025
env = T .env,
1025
1026
awaitTimeout = 600000 ,
0 commit comments