Skip to content

Commit

Permalink
feat: introduce crossbuilding
Browse files Browse the repository at this point in the history
  • Loading branch information
ckipp01 committed Apr 28, 2023
1 parent eaa8a33 commit 9fe8897
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ jobs:

- name: Test
run:
./mill -i --debug itest
./mill -i --debug itest.[_].test
20 changes: 14 additions & 6 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@ import de.tobiasroeser.mill.vcs.version.VcsVersion
import io.kipp.mill.ci.release.CiReleaseModule
import io.kipp.mill.ci.release.SonatypeHost

val millVersion = "0.10.12"
val millVersions = Seq("0.10.12", "0.11.0-M8")
val millBinaryVersions = millVersions.map(scalaNativeBinaryVersion)
val scala213 = "2.13.8"
val artifactBase = "mill-github-dependency-graph"

def millBinaryVersion(millVersion: String) = scalaNativeBinaryVersion(
millVersion
)

def millVersion(binaryVersion: String) =
millVersions.find(v => millBinaryVersion(v) == binaryVersion).get

trait Common
extends ScalaModule
with CiReleaseModule
Expand Down Expand Up @@ -57,14 +61,15 @@ object domain extends Common {
override def artifactName = "github-dependency-graph-domain"
}

object plugin extends Common with BuildInfo {
object plugin extends Cross[Plugin](millBinaryVersions: _*)
class Plugin(millBinaryVersion: String) extends Common with BuildInfo {

override def artifactName =
s"${artifactBase}_mill${millBinaryVersion(millVersion)}"
s"${artifactBase}_mill${millBinaryVersion}"

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

override def ivyDeps = super.ivyDeps() ++ Agg(
Expand All @@ -84,11 +89,14 @@ object plugin extends Common with BuildInfo {
)
}

object itest extends MillIntegrationTestModule {
object itest extends Cross[ItestCross](millVersions: _*)
class ItestCross(millVersion: String) extends MillIntegrationTestModule {

override def millSourcePath = super.millSourcePath / os.up

def millTestVersion = millVersion

def pluginsUnderTest = Seq(plugin)
def pluginsUnderTest = Seq(plugin(millBinaryVersion(millVersion)))

def testBase = millSourcePath / "src"

Expand Down

0 comments on commit 9fe8897

Please sign in to comment.