Skip to content

Commit e463564

Browse files
committed
Ensure MappedRoots.withMillDefaults is used with named parameters
1 parent a52599f commit e463564

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

core/api/src/mill/api/MappedRoots.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package mill.api
22

3+
import mill.api.internal.NamedParameterOnlyDummy
34
import mill.constants.PathVars
45

6+
import scala.annotation.unused
57
import scala.util.DynamicVariable
68

79
type MappedRoots = Seq[(key: String, path: os.Path)]
@@ -17,6 +19,7 @@ trait MappedRootsImpl {
1719
def toMap: Map[String, os.Path] = get.map(m => (m.key, m.path)).toMap
1820

1921
def withMillDefaults[T](
22+
@unused t: NamedParameterOnlyDummy = new NamedParameterOnlyDummy,
2023
outPath: os.Path,
2124
workspacePath: os.Path = BuildCtx.workspaceRoot,
2225
homePath: os.Path = os.home

core/exec/src/mill/exec/GroupExecution.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ trait GroupExecution {
8383
executionContext: mill.api.TaskCtx.Fork.Api,
8484
exclusive: Boolean,
8585
upstreamPathRefs: Seq[PathRef]
86-
): GroupExecution.Results = MappedRoots.withMillDefaults(outPath) {
86+
): GroupExecution.Results = MappedRoots.withMillDefaults(outPath = outPath) {
8787

8888
val inputsHash = {
8989
val externalInputsHash = MurmurHash3.orderedHash(

runner/daemon/src/mill/daemon/MillBuildBootstrap.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class MillBuildBootstrap(
7070
val runnerState = evaluateRec(0)
7171

7272
for ((frame, depth) <- runnerState.frames.zipWithIndex) {
73-
MappedRoots.withMillDefaults(output) {
73+
MappedRoots.withMillDefaults(outPath = output) {
7474
os.write.over(
7575
recOut(output, depth) / millRunnerState,
7676
upickle.write(frame.loggedData, indent = 4),

runner/daemon/src/mill/daemon/MillDaemonMain.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ object MillDaemonMain {
3939
val args =
4040
Args(getClass.getName, args0).fold(err => throw IllegalArgumentException(err), identity)
4141

42-
MappedRoots.withMillDefaults(args.outDir) {
42+
MappedRoots.withMillDefaults(outPath = args.outDir) {
4343
if (Properties.isWin)
4444
// temporarily disabling FFM use by coursier, which has issues with the way
4545
// Mill manages class loaders, throwing things like

testkit/src/mill/testkit/UnitTester.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ class UnitTester(
237237
def scoped[T](tester: UnitTester => T): T = {
238238
try {
239239
BuildCtx.workspaceRoot0.withValue(module.moduleDir) {
240-
MappedRoots.withMillDefaults(outPath) {
240+
MappedRoots.withMillDefaults(outPath = outPath) {
241241
tester(this)
242242
}
243243
}

0 commit comments

Comments
 (0)