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

Commit 4752f1a

Browse files
authored
Merge pull request #88 from ckipp01/cross
feat: introduce crossbuilding
2 parents aca8230 + 3cf654b commit 4752f1a

File tree

13 files changed

+100
-18
lines changed

13 files changed

+100
-18
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ jobs:
5757

5858
- name: Test
5959
run:
60-
./mill -i --debug itest
60+
./mill -i --debug itest[_].test

build.sc

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,18 @@ 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 millVersion = "0.10.12"
20+
val millVersions = Seq("0.10.12", "0.11.0-M8")
21+
val millBinaryVersions = millVersions.map(scalaNativeBinaryVersion)
2122
val scala213 = "2.13.8"
2223
val artifactBase = "mill-github-dependency-graph"
2324

2425
def millBinaryVersion(millVersion: String) = scalaNativeBinaryVersion(
2526
millVersion
2627
)
2728

29+
def millVersion(binaryVersion: String) =
30+
millVersions.find(v => millBinaryVersion(v) == binaryVersion).get
31+
2832
trait Common
2933
extends ScalaModule
3034
with CiReleaseModule
@@ -57,14 +61,23 @@ object domain extends Common {
5761
override def artifactName = "github-dependency-graph-domain"
5862
}
5963

60-
object plugin extends Common with BuildInfo {
64+
object plugin extends Cross[Plugin](millBinaryVersions: _*)
65+
class Plugin(millBinaryVersion: String) extends Common with BuildInfo {
66+
67+
override def millSourcePath = super.millSourcePath / os.up
68+
69+
override def sources = T.sources {
70+
super.sources() ++ Seq(
71+
millSourcePath / s"src-mill${millVersion(millBinaryVersion).split('.').take(2).mkString(".")}"
72+
).map(PathRef(_))
73+
}
6174

6275
override def artifactName =
63-
s"${artifactBase}_mill${millBinaryVersion(millVersion)}"
76+
s"${artifactBase}_mill${millBinaryVersion}"
6477

6578
override def moduleDeps = Seq(domain)
6679
override def compileIvyDeps = super.compileIvyDeps() ++ Agg(
67-
ivy"com.lihaoyi::mill-scalalib:$millVersion"
80+
ivy"com.lihaoyi::mill-scalalib:${millVersion(millBinaryVersion)}"
6881
)
6982

7083
override def ivyDeps = super.ivyDeps() ++ Agg(
@@ -84,11 +97,14 @@ object plugin extends Common with BuildInfo {
8497
)
8598
}
8699

87-
object itest extends MillIntegrationTestModule {
100+
object itest extends Cross[ItestCross](millVersions: _*)
101+
class ItestCross(millVersion: String) extends MillIntegrationTestModule {
102+
103+
override def millSourcePath = super.millSourcePath / os.up
88104

89105
def millTestVersion = millVersion
90106

91-
def pluginsUnderTest = Seq(plugin)
107+
def pluginsUnderTest = Seq(plugin(millBinaryVersion(millVersion)))
92108

93109
def testBase = millSourcePath / "src"
94110

itest/src/cyclical/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import mill._, scalalib._
2-
import $exec.plugins
2+
import $file.plugins
33
import io.kipp.mill.github.dependency.graph.Graph
44
import io.kipp.mill.github.dependency.graph.Writers._
55
import mill.eval.Evaluator

itest/src/directRelationship/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import mill._, scalalib._
2-
import $exec.plugins
2+
import $file.plugins
33
import io.kipp.mill.github.dependency.graph.Graph
44
import mill.eval.Evaluator
55
import $ivy.`org.scalameta::munit:0.7.29`

itest/src/eviction/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import mill._, scalalib._
2-
import $exec.plugins
2+
import $file.plugins
33
import io.kipp.mill.github.dependency.graph.Graph
44
import mill.eval.Evaluator
55
import $ivy.`org.scalameta::munit:0.7.29`

itest/src/minimal/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import mill._, scalalib._
2-
import $exec.plugins
2+
import $file.plugins
33
import io.kipp.mill.github.dependency.graph.Graph
44
import io.kipp.mill.github.dependency.graph.Writers._
55
import mill.eval.Evaluator

itest/src/range/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import mill._, scalalib._
2-
import $exec.plugins
2+
import $file.plugins
33
import io.kipp.mill.github.dependency.graph.Graph
44
import mill.eval.Evaluator
55
import $ivy.`org.scalameta::munit:0.7.29`

itest/src/reconciledRange/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import mill._, scalalib._
2-
import $exec.plugins
2+
import $file.plugins
33
import io.kipp.mill.github.dependency.graph.Graph
44
import mill.eval.Evaluator
55
import $ivy.`org.scalameta::munit:0.7.29`
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+
import mill.main.EvaluatorScopt
4+
5+
private[graph] object Reader {
6+
implicit def millScoptEvaluatorReads[A]: EvaluatorScopt[A] =
7+
new EvaluatorScopt[A]()
8+
}

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

File renamed without changes.

0 commit comments

Comments
 (0)