Skip to content

Commit 02b3cb8

Browse files
committed
WIP
1 parent 98ba509 commit 02b3cb8

File tree

8 files changed

+354
-300
lines changed

8 files changed

+354
-300
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
@@ -1455,7 +1455,7 @@ jobs:
14551455
- name: Check native-image config format
14561456
run: ./mill -i __.checkNativeImageConfFormat
14571457
- name: Check Ammonite availability
1458-
run: ./mill -i 'dummy.amm[_].resolvedRunIvyDeps'
1458+
run: ./mill -i 'dummy.amm[_].resolvedRunMvnDeps'
14591459
- name: Check for cross Scala version conflicts
14601460
run: .github/scripts/check-cross-version-deps.sc
14611461
- name: Scalafix check

.mill-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.12.16
1+
1.0.6

build.mill.scala

Lines changed: 265 additions & 230 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

project/deps/package.mill.scala

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

67
object Cli {
78
def runnerScala30LegacyVersion =
@@ -115,7 +116,7 @@ object TestDeps {
115116

116117
object InternalDeps {
117118
object Versions {
118-
def mill: String = _root_.mill.main.BuildInfo.millVersion
119+
def mill: String = BuildInfo.millVersion
119120
def lefouMillwRef = "166bcdf5741de8569e0630e18c3b2ef7e252cd96"
120121
}
121122
}

project/publish/package.mill.scala

Lines changed: 27 additions & 21 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:7.3.0.202506031305-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
@@ -140,16 +142,20 @@ trait ScalaCliPublishModule extends SonatypeCentralPublishModule with PublishLoc
140142
)
141143
)
142144
override def publishVersion: T[String] = finalPublishVersion()
143-
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-
)
145+
146+
override def sourceJar: T[PathRef] = Task {
147+
PathRef {
148+
import mill.util.Jvm.createJar
149+
val allSources0 = allSources().map(_.path).filter(os.exists)
150+
createJar(
151+
jar = Task.dest / "out.jar",
152+
inputPaths = allSources0 ++ resources().map(_.path).filter(os.exists),
153+
manifest = manifest(),
154+
fileFilter = (input, relPath) =>
155+
!allSources0.toSet(input) ||
156+
(!relPath.segments.contains(".scala") && !relPath.segments.contains(workspaceDirName))
157+
)
158+
}
153159
}
154160
}
155161

@@ -211,7 +217,7 @@ def publishSonatype(
211217
publisher.publishAll(
212218
publishingType = publishingType,
213219
singleBundleName = finalBundleName,
214-
artifacts = artifacts: _*
220+
artifacts = artifacts*
215221
)
216222
}
217223

@@ -235,7 +241,7 @@ def setShouldPublish() = Task.Command {
235241
val charSet = Charset.defaultCharset()
236242
val nl = System.lineSeparator()
237243
os.write.append(
238-
os.Path(envFile, Task.workspace),
244+
os.Path(envFile, BuildCtx.workspaceRoot),
239245
s"SHOULD_PUBLISH=${shouldPublish()}$nl".getBytes(charSet)
240246
)
241247
}

0 commit comments

Comments
 (0)