Skip to content

Commit 3bd051b

Browse files
committed
Bump Mill to 1.0.4 (was 0.12.15)
1 parent 5febcb8 commit 3bd051b

File tree

10 files changed

+370
-334
lines changed

10 files changed

+370
-334
lines changed

.github/scripts/check-cross-version-deps.sc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ val modules =
1111

1212
for { module <- modules } {
1313
println(s"Checking for $module...")
14-
val depRegex = "\\[\\d+]\\s+[│└├─\\S\\s]+\\s([\\w.-]+):([\\w.-]+):([\\w\\s\\S.-]+)".r
14+
val depRegex = "[│└├─\\S\\s]+\\s([\\w.-]+):([\\w.-]+):([\\w\\s\\S.-]+)".r
1515
val scalaDepSuffixRegex = "^(.+?)(_[23](?:\\.\\d{2})?)?$".r
16-
val deps = os.proc(os.pwd / "mill", "-i", s"$module.ivyDepsTree")
16+
val deps = os.proc(os.pwd / "mill", "-i", s"$module.showMvnDepsTree")
1717
.call(cwd = os.pwd)
1818
.out
1919
.lines()

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,7 @@ jobs:
15141514
- name: Check native-image config format
15151515
run: ./mill -i __.checkNativeImageConfFormat
15161516
- name: Check Ammonite availability
1517-
run: ./mill -i 'dummy.amm[_].resolvedRunIvyDeps'
1517+
run: ./mill -i 'dummy.amm[_].resolvedRunMvnDeps'
15181518
- name: Check for cross Scala version conflicts
15191519
run: .github/scripts/check-cross-version-deps.sc
15201520
- name: Scalafix check

.mill-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.12.15
1+
1.0.4

build.mill.scala

Lines changed: 235 additions & 219 deletions
Large diffs are not rendered by default.

mill

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM=false
8484
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
8585

8686
if [[ $IS_WINDOWS ]]; then
87-
exec "$DIR/millw" "$@"
87+
exec "$DIR/mill.bat" "$@"
8888
else
8989
exec "$DIR/millw" $COMMAND
9090
fi

mill.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ rem setlocal seems to be unavailable on Windows 95/98/ME
3434
rem but I don't think we need to support them in 2019
3535
setlocal enabledelayedexpansion
3636

37-
if [!DEFAULT_MILL_VERSION!]==[] ( set "DEFAULT_MILL_VERSION=0.12.15" )
37+
if [!DEFAULT_MILL_VERSION!]==[] ( set "DEFAULT_MILL_VERSION=1.0.4" )
3838

3939
if [!MILL_GITHUB_RELEASE_CDN!]==[] ( set "MILL_GITHUB_RELEASE_CDN=" )
4040

millw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if [ "$1" = "--setup-completions" ] ; then
3939
fi
4040

4141
if [ -z "${DEFAULT_MILL_VERSION}" ] ; then
42-
DEFAULT_MILL_VERSION=0.12.15
42+
DEFAULT_MILL_VERSION=1.0.4
4343
fi
4444

4545

project/deps/package.mill.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package build.project.deps
2-
import mill._
3-
import scalalib._
2+
3+
import mill.*
4+
import mill.api.BuildInfo
5+
import scalalib.*
46

57
object Cli {
68
def runnerLegacyVersion = "1.7.1" // last runner version to support pre-LTS Scala 3 versions
@@ -99,7 +101,7 @@ object TestDeps {
99101

100102
object InternalDeps {
101103
object Versions {
102-
def mill: String = _root_.mill.main.BuildInfo.millVersion
104+
def mill: String = BuildInfo.millVersion
103105
def lefouMillwRef = "166bcdf5741de8569e0630e18c3b2ef7e252cd96"
104106
}
105107
}

project/publish/package.mill.scala

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
package build.project.publish
2-
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0`
3-
import $ivy.`org.eclipse.jgit:org.eclipse.jgit:6.8.0.202311291450-r`
2+
43
import build.project.settings
54
import com.lumidion.sonatype.central.client.core.{PublishingType, SonatypeCredentials}
65
import settings.{PublishLocalNoFluff, workspaceDirName}
7-
import de.tobiasroeser.mill.vcs.version._
8-
import mill._
6+
import mill.*
97
import mill.javalib.publish.Artifact
10-
import scalalib._
8+
import mill.util.{Tasks, VcsVersion}
9+
import scalalib.*
1110
import org.eclipse.jgit.api.Git
11+
import mill.api.{BuildCtx, ModuleCtx, Task}
1212

1313
import java.nio.charset.Charset
14-
import scala.concurrent.duration._
15-
import scala.jdk.CollectionConverters._
14+
import scala.concurrent.duration.*
15+
import scala.jdk.CollectionConverters.*
1616

17-
lazy val (ghOrg: String, ghName: String) = {
17+
def gh: (ghOrg: String, ghName: String) = {
1818
def default = ("VirtusLab", "scala-cli")
1919
val isCI = System.getenv("CI") != null
2020
if (isCI) {
@@ -62,7 +62,9 @@ lazy val (ghOrg: String, ghName: String) = {
6262
default
6363
}
6464

65-
private def computePublishVersion(state: VcsState, simple: Boolean): String =
65+
lazy val (ghOrg: String, ghName: String) = gh
66+
67+
private def computePublishVersion(state: VcsVersion.State, simple: Boolean): String =
6668
if (state.commitsSinceLastTag > 0)
6769
if (simple) {
6870
val versionOrEmpty = state.lastTag
@@ -141,15 +143,18 @@ trait ScalaCliPublishModule extends SonatypeCentralPublishModule with PublishLoc
141143
)
142144
override def publishVersion: T[String] = finalPublishVersion()
143145
override def sourceJar: T[PathRef] = Task {
144-
import mill.util.Jvm.createJar
145-
val allSources0 = allSources().map(_.path).filter(os.exists).toSet
146-
createJar(
147-
allSources0 ++ resources().map(_.path).filter(os.exists),
148-
manifest(),
149-
(input, relPath) =>
150-
!allSources0(input) ||
151-
(!relPath.segments.contains(".scala") && !relPath.segments.contains(workspaceDirName))
152-
)
146+
PathRef {
147+
import mill.util.Jvm.createJar
148+
val allSources0 = allSources().map(_.path).filter(os.exists)
149+
createJar(
150+
jar = Task.dest / "out.jar",
151+
inputPaths = allSources0 ++ resources().map(_.path).filter(os.exists),
152+
manifest = manifest(),
153+
fileFilter = (input, relPath) =>
154+
!allSources0.toSet(input) ||
155+
(!relPath.segments.contains(".scala") && !relPath.segments.contains(workspaceDirName))
156+
)
157+
}
153158
}
154159
}
155160

@@ -211,7 +216,7 @@ def publishSonatype(
211216
publisher.publishAll(
212217
publishingType = publishingType,
213218
singleBundleName = finalBundleName,
214-
artifacts = artifacts: _*
219+
artifacts = artifacts*
215220
)
216221
}
217222

@@ -235,7 +240,7 @@ def setShouldPublish() = Task.Command {
235240
val charSet = Charset.defaultCharset()
236241
val nl = System.lineSeparator()
237242
os.write.append(
238-
os.Path(envFile, Task.workspace),
243+
os.Path(envFile, BuildCtx.workspaceRoot),
239244
s"SHOULD_PUBLISH=${shouldPublish()}$nl".getBytes(charSet)
240245
)
241246
}

0 commit comments

Comments
 (0)