Skip to content

Commit 3760396

Browse files
committed
Upgrade dependencies
1 parent ab44d7e commit 3760396

File tree

10 files changed

+37
-47
lines changed

10 files changed

+37
-47
lines changed

.scalafmt.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
version = 3.9.6
2-
runner.dialect = scala213source3
3-
fileOverride."glob:**.mill".runner.dialect = scala3Future
4-
project.git = true
1+
version = 3.10.3
2+
runner.dialect = scala3
53
maxColumn = 120
64
align.preset = more
75
assumeStandardLibraryStripMargin = true
86
rewrite.rules = [AvoidInfix, RedundantBraces, RedundantParens, SortModifiers, Imports]
97
rewrite.redundantBraces.stringInterpolation = true
108
rewrite.imports.sort = original
9+
rewrite.scala3.convertToNewSyntax = true
10+
rewrite.scala3.removeOptionalBraces = oldSyntaxToo

build.mill

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
//| mill-version: 1.0.1-native
1+
//| mill-version: 1.0.6-native
22
//| mill-jvm-version: 17
33
//| repositories:
44
//| - https://central.sonatype.com/repository/maven-snapshots
55
//| - https://oss.sonatype.org/content/repositories/snapshots
66
//| mvnDeps:
7-
//| - com.goyeau::mill-git::0.3.0
7+
//| - com.goyeau::mill-git::0.3.2
88
//| - com.goyeau::mill-scalafix::0.6.0
99
//| - org.typelevel::scalac-options:0.1.7
1010

@@ -24,7 +24,7 @@ trait MillGitCross
2424
with GitVersionedPublishModule
2525
with SonatypeCentralPublishModule:
2626
val millVersion = crossValue
27-
override def scalaVersion = "3.7.1"
27+
override def scalaVersion = "3.7.4"
2828
override def scalacOptions = super.scalacOptions() ++ ScalacOptions.tokensForVersion(
2929
ScalaVersion.unsafeFromString(scalaVersion()),
3030
ScalacOptions.default + source3 ++ fatalWarningOptions
@@ -34,20 +34,18 @@ trait MillGitCross
3434
mvn"com.lihaoyi::mill-libs-scalalib:$millVersion",
3535
mvn"com.lihaoyi::mill-contrib-docker:$millVersion"
3636
)
37-
override def mvnDeps = super.mvnDeps() ++ Seq(mvn"org.eclipse.jgit:org.eclipse.jgit:7.1.0.202411261347-r")
37+
override def mvnDeps = super.mvnDeps() ++ Seq(mvn"org.eclipse.jgit:org.eclipse.jgit:7.5.0.202512021534-r")
3838

39-
object test extends ScalaTests with TestModule.Munit:
39+
object test extends ScalaTests with TestModule.Munit with StyleModule:
4040
override def mvnDeps = Seq(
41-
mvn"org.scalameta::munit::1.1.0",
41+
mvn"org.scalameta::munit::1.2.1",
4242
mvn"com.lihaoyi::mill-testkit:$millVersion"
4343
)
4444
override def forkEnv = Map("MILL_EXECUTABLE_PATH" -> millExecutable.assembly().path.toString)
4545

4646
// Create a Mill executable configured for testing our plugin
4747
object millExecutable extends JavaModule:
48-
override def mvnDeps = millVersion match
49-
case version if version.startsWith("1.0") => Seq(mvn"com.lihaoyi:mill-runner-launcher_3:$millVersion")
50-
case _ => Seq(mvn"com.lihaoyi:mill-dist:$millVersion")
48+
override def mvnDeps = Seq(mvn"com.lihaoyi:mill-runner-launcher_3:$millVersion")
5149
override def mainClass = Some("mill.launcher.MillLauncherMain")
5250
end test
5351

@@ -65,5 +63,5 @@ end MillGitCross
6563

6664
def millBinaryVersion(millVersion: String) = millVersion match
6765
case version if version.startsWith("0.12") => "0.11" // 0.12.x is binary compatible with 0.11.x
68-
case version if version.startsWith("1.0") => "1"
66+
case version if version.startsWith("1.") => "1"
6967
case _ => throw IllegalArgumentException(s"Unsupported Mill version: $millVersion")

mill-git/src/com/goyeau/mill/git/GitTaggedDockerModule.scala

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ import mill.*
44
import mill.contrib.docker.DockerModule
55
import mill.scalalib.JavaModule
66

7-
trait GitTaggedDockerModule extends DockerModule { outer: JavaModule =>
8-
trait GitTaggedDocker extends DockerConfig {
9-
def tagLatest: T[Boolean] = false
7+
trait GitTaggedDockerModule extends DockerModule:
8+
outer: JavaModule =>
9+
trait GitTaggedDocker extends DockerConfig:
10+
def tagLatest: T[Boolean] = false
1011
override def tags: T[Seq[String]] =
1112
super.tags().map(tag => s"$tag:${GitVersionModule.version()()}") ++
12-
(if (tagLatest()) super.tags().map(tag => s"$tag:latest") else Seq.empty)
13-
}
14-
}
13+
(if tagLatest() then super.tags().map(tag => s"$tag:latest") else Seq.empty)

mill-git/src/com/goyeau/mill/git/GitVersionModule.scala

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import scala.util.Failure as TryFailure
1313
import scala.util.Success as TrySuccess
1414
import scala.util.Try
1515

16-
object GitVersionModule extends ExternalModule {
16+
object GitVersionModule extends ExternalModule:
1717

1818
/** Version derived from git.
1919
*/
@@ -26,36 +26,34 @@ object GitVersionModule extends ExternalModule {
2626
val git = Git.open(gitRoot.toIO)
2727
val status = git.status().call()
2828
val isDirty = status.hasUncommittedChanges || !status.getUntracked.isEmpty
29-
val snapshotSuffix = if (withSnapshotSuffix) "-SNAPSHOT" else ""
29+
val snapshotSuffix = if withSnapshotSuffix then "-SNAPSHOT" else ""
3030
def uncommitted() = s"${uncommittedHash(git, hashLength)}$snapshotSuffix"
3131

3232
val describeResult = Try(git.describe().setTags(true).setMatch("v[0-9]*").setAlways(true).call())
3333

34-
describeResult match {
35-
case TryFailure(_) => Result.Success(uncommitted())
34+
describeResult match
35+
case TryFailure(_) => Result.Success(uncommitted())
3636
case TrySuccess(description) =>
3737
val taggedRegex = """v(\d.*?)(?:-(\d+)-g([\da-f]+))?""".r
3838
val untaggedRegex = """([\da-f]+)""".r
3939

40-
description match {
40+
description match
4141
case taggedRegex(tag, distance, hash) =>
4242
val distanceHash = Option(distance).fold {
43-
if (isDirty) s"-1-${uncommitted()}"
43+
if isDirty then s"-1-${uncommitted()}"
4444
else ""
4545
} { distance =>
46-
if (isDirty) s"-${distance.toInt + 1}-${uncommitted()}"
46+
if isDirty then s"-${distance.toInt + 1}-${uncommitted()}"
4747
else s"-$distance-${hash.take(hashLength)}$snapshotSuffix"
4848
}
4949
Result.Success(s"$tag$distanceHash")
5050
case untaggedRegex(hash) =>
51-
if (isDirty) Result.Success(uncommitted())
51+
if isDirty then Result.Success(uncommitted())
5252
else Result.Success(s"${hash.take(hashLength)}$snapshotSuffix")
5353
case _ => Result.Failure(s"Unexpected git describe output: $description")
54-
}
55-
}
5654
}
5755

58-
private def uncommittedHash(git: Git, hashLength: Int): String = {
56+
private def uncommittedHash(git: Git, hashLength: Int): String =
5957
val indexCopy = os.temp.dir() / "index"
6058
val _ = Try(copy(pwd / ".git" / "index", indexCopy, replaceExisting = true, createFolders = true))
6159

@@ -69,7 +67,5 @@ object GitVersionModule extends ExternalModule {
6967
)
7068
val cache = altGit.add().addFilepattern(".").call()
7169
cache.writeTree(altGit.getRepository.newObjectInserter()).abbreviate(hashLength).name()
72-
}
7370

7471
override lazy val millDiscover = Discover[this.type]
75-
}

mill-git/src/com/goyeau/mill/git/GitVersionedPublishModule.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ package com.goyeau.mill.git
33
import mill.*
44
import mill.scalalib.PublishModule
55

6-
trait GitVersionedPublishModule extends PublishModule {
6+
trait GitVersionedPublishModule extends PublishModule:
77
def publishVersion: T[String] = GitVersionModule.version()()
8-
}

mill-git/test/src/com/goyeau/mill/git/CustomProjectIntegrationTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package com.goyeau.mill.git
22

33
import munit.FunSuite
4+
45
import scala.concurrent.duration.*
56

6-
class CustomProjectIntegrationTests extends FunSuite {
7+
class CustomProjectIntegrationTests extends FunSuite:
78
override val munitTimeout: Duration = 2.minute
89

910
test("Uncommitted changes") {
@@ -101,4 +102,3 @@ class CustomProjectIntegrationTests extends FunSuite {
101102
s"${result.out} is not a version and distance from it, followed by a 7 chars hash"
102103
)
103104
}
104-
}

mill-git/test/src/com/goyeau/mill/git/DockerProjectIntegrationTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package com.goyeau.mill.git
22

33
import munit.FunSuite
4+
45
import scala.concurrent.duration.*
56

6-
class DockerProjectIntegrationTests extends FunSuite {
7+
class DockerProjectIntegrationTests extends FunSuite:
78
override val munitTimeout: Duration = 2.minute
89

910
test("Uncommitted changes") {
@@ -130,4 +131,3 @@ class DockerProjectIntegrationTests extends FunSuite {
130131
s"${result.out} is not a version and distance from it, followed by a 7 chars hash"
131132
)
132133
}
133-
}

mill-git/test/src/com/goyeau/mill/git/ExampleTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ package com.goyeau.mill.git
22

33
import mill.testkit.ExampleTester
44
import munit.FunSuite
5+
56
import scala.concurrent.duration.*
67

7-
class ExampleTests extends FunSuite {
8+
class ExampleTests extends FunSuite:
89
override val munitTimeout: Duration = 2.minute
910

1011
test("Custom example") {
@@ -15,4 +16,3 @@ class ExampleTests extends FunSuite {
1516
millExecutable = os.Path(sys.env("MILL_EXECUTABLE_PATH"))
1617
)
1718
}
18-
}

mill-git/test/src/com/goyeau/mill/git/PublishProjectIntegrationTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package com.goyeau.mill.git
22

33
import munit.FunSuite
4+
45
import scala.concurrent.duration.*
56

6-
class PublishProjectIntegrationTests extends FunSuite {
7+
class PublishProjectIntegrationTests extends FunSuite:
78
override val munitTimeout: Duration = 2.minute
89

910
test("Uncommitted changes") {
@@ -101,4 +102,3 @@ class PublishProjectIntegrationTests extends FunSuite {
101102
s"${result.out} is not a version and distance from it, followed by a 7 chars hash"
102103
)
103104
}
104-
}

mill-git/test/src/com/goyeau/mill/git/Tester.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ package com.goyeau.mill.git
33
import mill.testkit.IntegrationTester
44
import os.RelPath
55

6-
object Tester {
7-
def create(project: RelPath) = {
6+
object Tester:
7+
def create(project: RelPath) =
88
val resourceFolder = os.Path(sys.env("MILL_TEST_RESOURCE_DIR"))
99
new IntegrationTester(
1010
daemonMode = true,
1111
workspaceSourcePath = resourceFolder / project,
1212
millExecutable = os.Path(sys.env("MILL_EXECUTABLE_PATH"))
1313
)
14-
}
15-
}

0 commit comments

Comments
 (0)