Skip to content

Commit 9934c60

Browse files
committed
Support Mill 0.11
1 parent d3ae15b commit 9934c60

File tree

7 files changed

+220
-89
lines changed

7 files changed

+220
-89
lines changed

.mill-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.10.12

.scalafmt.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 3.3.3
1+
version = 3.7.4
22
runner.dialect = scala213source3
33
project.git = true
44
maxColumn = 120

build.sc

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import $ivy.`com.goyeau::mill-git::0.2.3`
2-
import $ivy.`com.goyeau::mill-scalafix::0.2.8`
3-
import $ivy.`de.tototec::de.tobiasroeser.mill.integrationtest::0.4.1-30-f29f55`
4-
import $ivy.`io.github.davidgregory084::mill-tpolecat::0.3.0`
1+
import $ivy.`com.goyeau::mill-git::0.2.4`
2+
import $ivy.`com.goyeau::mill-scalafix::0.3.1`
3+
import $ivy.`de.tototec::de.tobiasroeser.mill.integrationtest::0.7.1`
4+
import $ivy.`io.github.davidgregory084::mill-tpolecat::0.3.2`
55
import com.goyeau.mill.git.{GitVersionModule, GitVersionedPublishModule}
66
import com.goyeau.mill.scalafix.StyleModule
77
import de.tobiasroeser.mill.integrationtest._
@@ -11,7 +11,7 @@ import mill.scalalib._
1111
import mill.scalalib.api.Util.scalaNativeBinaryVersion
1212
import mill.scalalib.publish.{Developer, License, PomSettings, VersionControl}
1313

14-
val millVersions = Seq("0.10.0", "0.9.12")
14+
val millVersions = Seq("0.10.12", "0.11.1")
1515
def millBinaryVersion(millVersion: String) = scalaNativeBinaryVersion(millVersion)
1616

1717
object `mill-git` extends Cross[MillGitCross](millVersions: _*)
@@ -20,15 +20,15 @@ class MillGitCross(millVersion: String)
2020
with TpolecatModule
2121
with StyleModule
2222
with GitVersionedPublishModule {
23-
override def crossScalaVersion = "2.13.7"
23+
override def crossScalaVersion = "2.13.10"
2424
override def artifactSuffix = s"_mill${millBinaryVersion(millVersion)}" + super.artifactSuffix()
2525

2626
override def compileIvyDeps = super.compileIvyDeps() ++ Agg(
2727
ivy"com.lihaoyi::mill-main:$millVersion",
2828
ivy"com.lihaoyi::mill-scalalib:$millVersion",
2929
ivy"com.lihaoyi::mill-contrib-docker:$millVersion"
3030
)
31-
override def ivyDeps = super.ivyDeps() ++ Agg(ivy"org.eclipse.jgit:org.eclipse.jgit:6.3.0.202209071007-r")
31+
override def ivyDeps = super.ivyDeps() ++ Agg(ivy"org.eclipse.jgit:org.eclipse.jgit:6.6.0.202305301015-r")
3232

3333
override def publishVersion = GitVersionModule.version(withSnapshotSuffix = true)()
3434
def pomSettings = PomSettings(

itest/src/custom/build.sc

+19-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import $exec.plugins
1+
import $file.plugins
22
import com.goyeau.mill.git.GitVersionModule
33
import mill._
44
import mill.scalalib.JavaModule
@@ -10,6 +10,8 @@ object project extends JavaModule {
1010

1111
// Uncommitted changes
1212
def setupUncommittedChanges = T.input {
13+
remove.all(pwd / ".git")
14+
1315
proc("git", "init").call()
1416
}
1517
def uncommittedChanges() = T.command {
@@ -22,6 +24,8 @@ def uncommittedChanges() = T.command {
2224

2325
// Commit without tag
2426
def setupCommitWithoutTag = T.input {
27+
remove.all(pwd / ".git")
28+
2529
proc("git", "init").call()
2630
proc("git", "add", "--all").call()
2731
proc("git", "commit", "-m", "Some commit").call()
@@ -37,6 +41,9 @@ def commitWithoutTag() = T.command {
3741

3842
// Uncommitted changes after commit without tag
3943
def setupUncommittedChangesAfterCommitWithoutTag = T.input {
44+
remove.all(pwd / ".git")
45+
remove(pwd / "some-file")
46+
4047
proc("git", "init").call()
4148
proc("git", "add", "--all").call()
4249
proc("git", "commit", "-m", "Some commit").call()
@@ -48,13 +55,12 @@ def uncommittedChangesAfterCommitWithoutTag() = T.command {
4855
assert("""[\da-f]{7}""".r.findFirstIn(project.jobVersion()).isDefined)
4956
val hash = proc("git", "rev-parse", "HEAD").call().out.trim().take(7)
5057
assert(!project.jobVersion().contains(hash))
51-
52-
remove.all(pwd / ".git")
53-
remove(pwd / "some-file")
5458
}
5559

5660
// Head tagged
5761
def setupHeadTagged = T.input {
62+
remove.all(pwd / ".git")
63+
5864
proc("git", "init").call()
5965
proc("git", "add", "--all").call()
6066
proc("git", "commit", "-m", "Some commit").call()
@@ -64,12 +70,13 @@ def headTagged() = T.command {
6470
setupHeadTagged()
6571

6672
assert(project.jobVersion() == "1.0.0")
67-
68-
remove.all(pwd / ".git")
6973
}
7074

7175
// Uncommitted changes after tag
7276
def setupUncommittedChangesAfterTag = T.input {
77+
remove.all(pwd / ".git")
78+
remove(pwd / "some-file")
79+
7380
proc("git", "init").call()
7481
proc("git", "add", "--all").call()
7582
proc("git", "commit", "-m", "Some commit").call()
@@ -82,13 +89,13 @@ def uncommittedChangesAfterTag() = T.command {
8289
assert("""1\.0\.0-1-[\da-f]{7}""".r.findFirstIn(project.jobVersion()).isDefined)
8390
val hash = proc("git", "rev-parse", "HEAD").call().out.trim().take(7)
8491
assert(!project.jobVersion().contains(hash))
85-
86-
remove.all(pwd / ".git")
87-
remove(pwd / "some-file")
8892
}
8993

9094
// Commit after tag
9195
def setupCommitAfterTag = T.input {
96+
remove.all(pwd / ".git")
97+
remove(pwd / "some-file")
98+
9299
proc("git", "init").call()
93100
proc("git", "add", "--all").call()
94101
proc("git", "commit", "-m", "Some commit").call()
@@ -102,13 +109,13 @@ def commitAfterTag() = T.command {
102109

103110
val hash = proc("git", "rev-parse", "HEAD").call().out.trim().take(7)
104111
assert(project.jobVersion() == s"1.0.0-1-$hash")
105-
106-
remove.all(pwd / ".git")
107-
remove(pwd / "some-file")
108112
}
109113

110114
// Uncommitted changes after tag and after commit
111115
def setupUncommittedChangesAfterTagAndCommit = T.input {
116+
remove.all(pwd / ".git")
117+
remove(pwd / "some-file")
118+
112119
proc("git", "init").call()
113120
proc("git", "add", "--all").call()
114121
proc("git", "commit", "-m", "Some commit").call()
@@ -124,7 +131,4 @@ def uncommittedChangesAfterTagAndCommit() = T.command {
124131
assert("""1\.0\.0-2-[\da-f]{7}""".r.findFirstIn(project.jobVersion()).isDefined)
125132
val hash = proc("git", "rev-parse", "HEAD").call().out.trim().take(7)
126133
assert(!project.jobVersion().contains(hash))
127-
128-
remove.all(pwd / ".git")
129-
remove(pwd / "some-file")
130134
}

itest/src/docker/build.sc

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import $exec.plugins
1+
import $file.plugins
22
import $ivy.`com.lihaoyi::mill-contrib-docker:$MILL_VERSION`
33
import com.goyeau.mill.git.GitTaggedDockerModule
44
import mill._
@@ -14,6 +14,8 @@ object project extends JavaModule with GitTaggedDockerModule {
1414

1515
// Uncommitted changes
1616
def setupUncommittedChanges = T.input {
17+
remove.all(pwd / ".git")
18+
1719
proc("git", "init").call()
1820
}
1921
def uncommittedChanges() = T.command {
@@ -23,12 +25,12 @@ def uncommittedChanges() = T.command {
2325
assert(tags.size == 2)
2426
assert("""project:[\da-f]{7}""".r.findFirstIn(tags(0)).isDefined)
2527
assert(tags(1) == "project:latest")
26-
27-
remove.all(pwd / ".git")
2828
}
2929

3030
// Commit without tag
3131
def setupCommitWithoutTag = T.input {
32+
remove.all(pwd / ".git")
33+
3234
proc("git", "init").call()
3335
proc("git", "add", "--all").call()
3436
proc("git", "commit", "-m", "Some commit").call()
@@ -41,12 +43,13 @@ def commitWithoutTag() = T.command {
4143
assert(tags.size == 2)
4244
assert(tags(0) == s"project:$hash")
4345
assert(tags(1) == "project:latest")
44-
45-
remove.all(pwd / ".git")
4646
}
4747

4848
// Uncommitted changes after commit without tag
4949
def setupUncommittedChangesAfterCommitWithoutTag = T.input {
50+
remove.all(pwd / ".git")
51+
remove(pwd / "some-file")
52+
5053
proc("git", "init").call()
5154
proc("git", "add", "--all").call()
5255
proc("git", "commit", "-m", "Some commit").call()
@@ -61,13 +64,12 @@ def uncommittedChangesAfterCommitWithoutTag() = T.command {
6164
val hash = proc("git", "rev-parse", "HEAD").call().out.trim().take(7)
6265
assert(!tags(0).contains(hash))
6366
assert(tags(1) == "project:latest")
64-
65-
remove.all(pwd / ".git")
66-
remove(pwd / "some-file")
6767
}
6868

6969
// Head tagged
7070
def setupHeadTagged = T.input {
71+
remove.all(pwd / ".git")
72+
7173
proc("git", "init").call()
7274
proc("git", "add", "--all").call()
7375
proc("git", "commit", "-m", "Some commit").call()
@@ -80,12 +82,13 @@ def headTagged() = T.command {
8082
assert(tags.size == 2)
8183
assert(tags(0) == s"project:1.0.0")
8284
assert(tags(1) == "project:latest")
83-
84-
remove.all(pwd / ".git")
8585
}
8686

8787
// Uncommitted changes after tag
8888
def setupUncommittedChangesAfterTag = T.input {
89+
remove.all(pwd / ".git")
90+
remove(pwd / "some-file")
91+
8992
proc("git", "init").call()
9093
proc("git", "add", "--all").call()
9194
proc("git", "commit", "-m", "Some commit").call()
@@ -101,13 +104,13 @@ def uncommittedChangesAfterTag() = T.command {
101104
val hash = proc("git", "rev-parse", "HEAD").call().out.trim().take(7)
102105
assert(!tags(0).contains(hash))
103106
assert(tags(1) == "project:latest")
104-
105-
remove.all(pwd / ".git")
106-
remove(pwd / "some-file")
107107
}
108108

109109
// Commit after tag
110110
def setupCommitAfterTag = T.input {
111+
remove.all(pwd / ".git")
112+
remove(pwd / "some-file")
113+
111114
proc("git", "init").call()
112115
proc("git", "add", "--all").call()
113116
proc("git", "commit", "-m", "Some commit").call()
@@ -124,13 +127,13 @@ def commitAfterTag() = T.command {
124127
val hash = proc("git", "rev-parse", "HEAD").call().out.trim().take(7)
125128
assert(tags(0) == s"project:1.0.0-1-$hash")
126129
assert(tags(1) == "project:latest")
127-
128-
remove.all(pwd / ".git")
129-
remove(pwd / "some-file")
130130
}
131131

132132
// Uncommitted changes after tag and after commit
133133
def setupUncommittedChangesAfterTagAndCommit = T.input {
134+
remove.all(pwd / ".git")
135+
remove(pwd / "some-file")
136+
134137
proc("git", "init").call()
135138
proc("git", "add", "--all").call()
136139
proc("git", "commit", "-m", "Some commit").call()
@@ -149,7 +152,4 @@ def uncommittedChangesAfterTagAndCommit() = T.command {
149152
val hash = proc("git", "rev-parse", "HEAD").call().out.trim().take(7)
150153
assert(!tags(0).contains(hash))
151154
assert(tags(1) == "project:latest")
152-
153-
remove.all(pwd / ".git")
154-
remove(pwd / "some-file")
155155
}

itest/src/publish/build.sc

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import $exec.plugins
1+
import $file.plugins
22
import com.goyeau.mill.git.GitVersionedPublishModule
33
import mill._
44
import mill.scalalib.JavaModule
@@ -18,18 +18,20 @@ object project extends JavaModule with GitVersionedPublishModule {
1818

1919
// Uncommitted changes
2020
def setupUncommittedChanges = T.input {
21+
remove.all(pwd / ".git")
22+
2123
proc("git", "init").call()
2224
}
2325
def uncommittedChanges() = T.command {
2426
setupUncommittedChanges()
2527

2628
assert("""[\da-f]{7}""".r.findFirstIn(project.publishVersion()).isDefined)
27-
28-
remove.all(pwd / ".git")
2929
}
3030

3131
// Commit without tag
3232
def setupCommitWithoutTag = T.input {
33+
remove.all(pwd / ".git")
34+
3335
proc("git", "init").call()
3436
proc("git", "add", "--all").call()
3537
proc("git", "commit", "-m", "Some commit").call()
@@ -39,12 +41,13 @@ def commitWithoutTag() = T.command {
3941

4042
val hash = proc("git", "rev-parse", "HEAD").call().out.trim().take(7)
4143
assert(project.publishVersion() == hash)
42-
43-
remove.all(pwd / ".git")
4444
}
4545

4646
// Uncommitted changes after commit without tag
4747
def setupUncommittedChangesAfterCommitWithoutTag = T.input {
48+
remove.all(pwd / ".git")
49+
remove(pwd / "some-file")
50+
4851
proc("git", "init").call()
4952
proc("git", "add", "--all").call()
5053
proc("git", "commit", "-m", "Some commit").call()
@@ -56,13 +59,12 @@ def uncommittedChangesAfterCommitWithoutTag() = T.command {
5659
assert("""[\da-f]{7}""".r.findFirstIn(project.publishVersion()).isDefined)
5760
val hash = proc("git", "rev-parse", "HEAD").call().out.trim().take(7)
5861
assert(!project.publishVersion().contains(hash))
59-
60-
remove.all(pwd / ".git")
61-
remove(pwd / "some-file")
6262
}
6363

6464
// Head tagged
6565
def setupHeadTagged = T.input {
66+
remove.all(pwd / ".git")
67+
6668
proc("git", "init").call()
6769
proc("git", "add", "--all").call()
6870
proc("git", "commit", "-m", "Some commit").call()
@@ -72,12 +74,13 @@ def headTagged() = T.command {
7274
setupHeadTagged()
7375

7476
assert(project.publishVersion() == "1.0.0")
75-
76-
remove.all(pwd / ".git")
7777
}
7878

7979
// Uncommitted changes after tag
8080
def setupUncommittedChangesAfterTag = T.input {
81+
remove.all(pwd / ".git")
82+
remove(pwd / "some-file")
83+
8184
proc("git", "init").call()
8285
proc("git", "add", "--all").call()
8386
proc("git", "commit", "-m", "Some commit").call()
@@ -90,13 +93,13 @@ def uncommittedChangesAfterTag() = T.command {
9093
assert("""1\.0\.0-1-[\da-f]{7}""".r.findFirstIn(project.publishVersion()).isDefined)
9194
val hash = proc("git", "rev-parse", "HEAD").call().out.trim().take(7)
9295
assert(!project.publishVersion().contains(hash))
93-
94-
remove.all(pwd / ".git")
95-
remove(pwd / "some-file")
9696
}
9797

9898
// Commit after tag
9999
def setupCommitAfterTag = T.input {
100+
remove.all(pwd / ".git")
101+
remove(pwd / "some-file")
102+
100103
proc("git", "init").call()
101104
proc("git", "add", "--all").call()
102105
proc("git", "commit", "-m", "Some commit").call()
@@ -110,13 +113,13 @@ def commitAfterTag() = T.command {
110113

111114
val hash = proc("git", "rev-parse", "HEAD").call().out.trim().take(7)
112115
assert(project.publishVersion() == s"1.0.0-1-$hash")
113-
114-
remove.all(pwd / ".git")
115-
remove(pwd / "some-file")
116116
}
117117

118118
// Uncommitted changes after tag and after commit
119119
def setupUncommittedChangesAfterTagAndCommit = T.input {
120+
remove.all(pwd / ".git")
121+
remove(pwd / "some-file")
122+
120123
proc("git", "init").call()
121124
proc("git", "add", "--all").call()
122125
proc("git", "commit", "-m", "Some commit").call()
@@ -132,7 +135,4 @@ def uncommittedChangesAfterTagAndCommit() = T.command {
132135
assert("""1\.0\.0-2-[\da-f]{7}""".r.findFirstIn(project.publishVersion()).isDefined)
133136
val hash = proc("git", "rev-parse", "HEAD").call().out.trim().take(7)
134137
assert(!project.publishVersion().contains(hash))
135-
136-
remove.all(pwd / ".git")
137-
remove(pwd / "some-file")
138138
}

0 commit comments

Comments
 (0)