Skip to content

Commit 0a741a3

Browse files
committed
Upgrade to Mill 0.12
1 parent a0628d6 commit 0a741a3

File tree

19 files changed

+587
-496
lines changed

19 files changed

+587
-496
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ jobs:
2020
- name: Checks
2121
run: |
2222
git config --global user.name "CI"
23-
./mill all __.checkStyle __.docJar __.publishLocal __.test
23+
./mill __.checkStyle
24+
./mill __.test
25+
./mill __.docJar
26+
./mill __.publishLocal
2427
- name: Publish
2528
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') || github.event_name == 'release'
2629
run: |
2730
echo "${{secrets.pgp_secret_key}}" > private.key
2831
gpg --batch --yes --import private.key
2932
rm private.key
3033
31-
./mill mill.scalalib.PublishModule/publishAll --sonatypeCreds ${{secrets.sonatype_credentials}} --publishArtifacts __.publishArtifacts --awaitTimeout 600000 --release true
34+
./mill mill.scalalib.PublishModule/publishAll --sonatypeCreds ${{secrets.sonatype_credentials}} --publishArtifacts __.publishArtifacts --release true

.mill-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.10.15
1+
0.12.5
Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,26 @@
1-
import $ivy.`com.goyeau::mill-git::0.2.5`
1+
import $ivy.`com.goyeau::mill-git::0.2.6`
22
import $ivy.`com.goyeau::mill-scalafix::0.4.2`
3-
import $ivy.`de.tototec::de.tobiasroeser.mill.integrationtest::0.7.1`
43
import $ivy.`org.typelevel::scalac-options:0.1.7`
54
import com.goyeau.mill.git.{GitVersionModule, GitVersionedPublishModule}
65
import com.goyeau.mill.scalafix.StyleModule
7-
import de.tobiasroeser.mill.integrationtest._
86
import mill._
97
import mill.scalalib._
108
import mill.scalalib.api.ZincWorkerUtil.scalaNativeBinaryVersion
119
import mill.scalalib.publish.{Developer, License, PomSettings, VersionControl}
1210
import org.typelevel.scalacoptions.ScalacOptions._
1311
import org.typelevel.scalacoptions.{ScalaVersion, ScalacOptions}
1412

15-
val millVersions = Seq("0.10.12", "0.11.1", "0.12.4")
16-
def millBinaryVersion(millVersion: String) = scalaNativeBinaryVersion(millVersion)
13+
val millVersions = Seq("0.12.0")
1714

18-
object `mill-git` extends Cross[MillGitCross](millVersions: _*)
19-
class MillGitCross(millVersion: String)
20-
extends CrossModuleBase
21-
with StyleModule
22-
with GitVersionedPublishModule {
23-
override def crossScalaVersion = "2.13.10"
15+
object `mill-git` extends Cross[MillGitCross](millVersions)
16+
trait MillGitCross extends Cross.Module[String] with StyleModule with GitVersionedPublishModule {
17+
val millVersion = crossValue
18+
override def scalaVersion = "2.13.15"
2419
override def scalacOptions = super.scalacOptions() ++ ScalacOptions.tokensForVersion(
2520
ScalaVersion.unsafeFromString(scalaVersion()),
2621
ScalacOptions.default + source3 ++ fatalWarningOptions
2722
)
28-
override def artifactSuffix = s"_mill${millBinaryVersion(millVersion)}" + super.artifactSuffix()
23+
override def artifactName = s"mill-git_mill${scalaNativeBinaryVersion(millVersion)}"
2924

3025
override def compileIvyDeps = super.compileIvyDeps() ++ Agg(
3126
ivy"com.lihaoyi::mill-main:$millVersion",
@@ -34,6 +29,25 @@ class MillGitCross(millVersion: String)
3429
)
3530
override def ivyDeps = super.ivyDeps() ++ Agg(ivy"org.eclipse.jgit:org.eclipse.jgit:6.10.0.202406032230-r")
3631

32+
object test extends ScalaTests with TestModule.Munit {
33+
override def ivyDeps = Agg(
34+
ivy"org.scalameta::munit::1.0.3",
35+
ivy"com.lihaoyi::mill-testkit:$millVersion"
36+
)
37+
override def forkEnv = Map("MILL_EXECUTABLE_PATH" -> millExecutable.assembly().path.toString)
38+
39+
// Create a Mill executable configured for testing our plugin
40+
object millExecutable extends JavaModule {
41+
override def ivyDeps = Agg(ivy"com.lihaoyi:mill-dist:$millVersion")
42+
override def mainClass = Some("mill.runner.client.MillClientMain")
43+
override def resources = T {
44+
val p = Task.dest / "mill/local-test-overrides" / s"com.lihaoyi-${MillGitCross.this.artifactId()}"
45+
os.write(p, MillGitCross.this.localClasspath().map(_.path).mkString("\n"), createFolders = true)
46+
Seq(PathRef(T.dest))
47+
}
48+
}
49+
}
50+
3751
override def publishVersion = GitVersionModule.version(withSnapshotSuffix = true)()
3852
def pomSettings = PomSettings(
3953
description = "A git version plugin for Mill build tool",
@@ -44,21 +58,3 @@ class MillGitCross(millVersion: String)
4458
developers = Seq(Developer("joan38", "Joan Goyeau", "https://github.com/joan38"))
4559
)
4660
}
47-
48-
object itest extends Cross[ITestCross](millVersions: _*)
49-
class ITestCross(millVersion: String) extends MillIntegrationTestModule {
50-
override def millSourcePath = super.millSourcePath / os.up
51-
override def millTestVersion = millVersion
52-
override def pluginsUnderTest = Seq(`mill-git`(millVersion))
53-
override def testInvocations = testCases().map(
54-
_ -> Seq(
55-
TestInvocation.Targets(Seq("uncommittedChanges")),
56-
TestInvocation.Targets(Seq("commitWithoutTag")),
57-
TestInvocation.Targets(Seq("uncommittedChangesAfterCommitWithoutTag")),
58-
TestInvocation.Targets(Seq("headTagged")),
59-
TestInvocation.Targets(Seq("uncommittedChangesAfterTag")),
60-
TestInvocation.Targets(Seq("commitAfterTag")),
61-
TestInvocation.Targets(Seq("uncommittedChangesAfterTagAndCommit"))
62-
)
63-
)
64-
}

itest/src/custom/build.sc

Lines changed: 0 additions & 134 deletions
This file was deleted.

0 commit comments

Comments
 (0)