Skip to content
This repository was archived by the owner on May 4, 2025. It is now read-only.

Commit d0f6961

Browse files
committed
Update mill to 0.12.4
1 parent 0802653 commit d0f6961

15 files changed

Lines changed: 137 additions & 41 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
strategy:
4242
fail-fast: false
4343
matrix:
44-
java: ['8', '17']
44+
java: ['11', '17']
4545

4646
steps:
4747
- uses: actions/checkout@v4

.mill-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.11.12
1+
0.12.4

build.sc

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import $ivy.`com.goyeau::mill-scalafix::0.4.0`
1+
import $ivy.`com.goyeau::mill-scalafix::0.4.2`
22
import $ivy.`com.lihaoyi::mill-contrib-buildinfo:$MILL_VERSION`
33
import $ivy.`de.tototec::de.tobiasroeser.mill.integrationtest::0.7.1`
44
import $ivy.`io.chris-kipp::mill-ci-release::0.1.10`
@@ -17,7 +17,7 @@ import de.tobiasroeser.mill.vcs.version.VcsVersion
1717
import io.kipp.mill.ci.release.CiReleaseModule
1818
import io.kipp.mill.ci.release.SonatypeHost
1919

20-
val millVersions = Seq("0.10.15", "0.11.12")
20+
val millVersions = Seq("0.12.4", "0.11.12", "0.10.15")
2121
val millBinaryVersions = millVersions.map(scalaNativeBinaryVersion)
2222
val scala213 = "2.13.14"
2323
val artifactBase = "mill-github-dependency-graph"
@@ -102,25 +102,27 @@ trait ItestCross extends Cross.Module[String] with MillIntegrationTestModule {
102102

103103
override def testInvocations: T[Seq[(PathRef, Seq[TestInvocation.Targets])]] =
104104
T {
105+
val env = if(millTestVersion() >= "0.12")
106+
Map(
107+
"COURSIER_REPOSITORIES" -> s"central sonatype:releases ivy:file://${T.dest.toString.replaceFirst("testInvocations", "test")}/ivyRepo/local/[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
108+
)
109+
else
110+
Map.empty[String, String]
105111
Seq(
106-
PathRef(testBase / "minimal") -> Seq(
107-
TestInvocation.Targets(Seq("checkManifest"), noServer = true)
108-
),
109-
PathRef(testBase / "directRelationship") -> Seq(
110-
TestInvocation.Targets(Seq("verify"), noServer = true)
111-
),
112-
PathRef(testBase / "eviction") -> Seq(
113-
TestInvocation.Targets(Seq("verify"), noServer = true)
114-
),
115-
PathRef(testBase / "range") -> Seq(
116-
TestInvocation.Targets(Seq("verify"), noServer = true)
117-
),
118-
PathRef(testBase / "reconciledRange") -> Seq(
119-
TestInvocation.Targets(Seq("verify"), noServer = true)
120-
),
121-
PathRef(testBase / "cyclical") -> Seq(
122-
TestInvocation.Targets(Seq("checkManifest"), noServer = true)
112+
"minimal" -> "checkManifest",
113+
"directRelationship" -> "verify",
114+
"eviction" -> "verify",
115+
"range" -> "verify",
116+
"reconciledRange" -> "verify",
117+
"cyclical" -> "checkManifest"
118+
).map { case (testName, testMethod) =>
119+
PathRef(testBase / testName) -> Seq(
120+
TestInvocation.Targets(
121+
Seq(testMethod),
122+
noServer = true,
123+
env = env
124+
)
123125
)
124-
)
126+
}
125127
}
126128
}

itest/src/cyclical/build.sc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ object overflow extends ScalaModule {
2121
}
2222

2323
def checkManifest(ev: Evaluator) = T.command {
24-
val expected = ujson.read(os.read(os.pwd / "manifests.json"))
24+
val projectDir = Iterator.iterate(os.pwd)(_ / os.up).find(dir => os.exists(dir / "manifests.json")).get
25+
val expected = ujson.read(os.read(projectDir / "manifests.json"))
2526

2627
val manifestMapping = Graph.generate(ev)()
2728

itest/src/minimal/build.sc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ object minimal extends ScalaModule {
1717
}
1818

1919
def checkManifest(ev: Evaluator) = T.command {
20-
val expected = ujson.read(os.read(os.pwd / "manifests.json"))
20+
val projectDir = Iterator.iterate(os.pwd)(_ / os.up).find(dir => os.exists(dir / "manifests.json")).get
21+
val expected = ujson.read(os.read(projectDir / "manifests.json"))
2122

2223
val manifestMapping = Graph.generate(ev)()
2324

itest/src/reconciledRange/build.sc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ object minimalDep extends ScalaModule {
1010
def scalaVersion = "2.13.8"
1111

1212
def ivyDeps = Agg(
13-
ivy"com.fasterxml.jackson.core:jackson-core:2.13.3"
13+
ivy"com.fasterxml.jackson.core:jackson-core:2.12.3"
1414
)
1515
}
1616

@@ -50,7 +50,7 @@ def verify(ev: Evaluator) = T.command {
5050
// out to ensure we're not creating invalid PURLs.
5151
val expected = Set(
5252
"org.scala-lang:scala-library:2.13.8",
53-
"com.fasterxml.jackson.core:jackson-core:2.13.3",
53+
"com.fasterxml.jackson.core:jackson-core:2.12.3",
5454
// NOTICE that com.fasterxml.jackson.core:jackson-core:[2.7.0,2.12.3] is not here
5555
"com.fasterxml.jackson.core:jackson-core:2.12.3",
5656
"com.fasterxml.jackson.core:jackson-databind:2.12.3",
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package io.kipp.mill.github.dependency.graph
2+
3+
object Graph extends GraphModule {
4+
5+
import Discover._
6+
lazy val millDiscover: mill.define.Discover[this.type] =
7+
mill.define.Discover[this.type]
8+
}

plugin/src-mill0.10/io/kipp/mill/github/dependency/graph/Resolver.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ object Resolver {
2121
private[graph] def resolveModuleTrees(
2222
evaluator: Evaluator,
2323
javaModules: Seq[JavaModule]
24-
): Seq[ModuleTrees] = Evaluator.evalOrThrow(evaluator) {
24+
): Seq[ModuleTrees] = evaluator.evalOrThrow() {
2525
javaModules.map { javaModule =>
2626
T.task {
2727

@@ -40,6 +40,7 @@ object Resolver {
4040
deps = deps,
4141
mapDependencies = Some(mapDeps),
4242
customizer = custom,
43+
coursierCacheCustomizer = None,
4344
ctx = Some(T.log)
4445
)
4546

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.kipp.mill.github.dependency.graph
22

33
private[graph] object Discover {
4-
implicit def millEvaluatorTokenReader =
4+
implicit def millEvaluatorTokenReader
5+
: mainargs.TokensReader[mill.eval.Evaluator] =
56
mill.main.TokenReaders.millEvaluatorTokenReader
67
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package io.kipp.mill.github.dependency.graph
2+
3+
import scala.annotation.nowarn
4+
5+
// In here for the Discover import
6+
@nowarn("msg=Unused import")
7+
object Graph extends GraphModule {
8+
9+
import Discover._
10+
lazy val millDiscover: mill.define.Discover[this.type] =
11+
mill.define.Discover[this.type]
12+
}

0 commit comments

Comments
 (0)