Skip to content

Commit e2b668b

Browse files
committed
feat: add support for the mill wrapper
1 parent b7d2682 commit e2b668b

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

scip-java/src/main/scala/com/sourcegraph/scip_java/buildtools/MillBuildTool.scala

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package com.sourcegraph.scip_java.buildtools
22

33
import java.nio.file.Files
4+
import java.nio.file.Path
45
import java.nio.file.StandardCopyOption
56

67
import scala.jdk.CollectionConverters._
8+
import scala.util.Properties
79

810
import com.sourcegraph.scip_java.BuildInfo
911
import com.sourcegraph.scip_java.commands.IndexCommand
@@ -38,14 +40,25 @@ class MillBuildTool(index: IndexCommand) extends BuildTool("mill", index) {
3840
private val rawOutput = index.output.toString
3941

4042
private def unconditionallyGenerateScip(): Int = {
43+
val millWrapper: Path = index
44+
.workingDirectory
45+
.resolve(
46+
if (Properties.isWin)
47+
"millw.bat"
48+
else
49+
"millw"
50+
)
4151
val localMill =
4252
Files.isRegularFile(millFile) && Files.isExecutable(millFile)
43-
val command =
44-
if (localMill) {
53+
val command: String =
54+
if (Files.isRegularFile(millWrapper) && Files.isExecutable(millWrapper))
55+
millWrapper.toString
56+
else if (localMill) {
4557
"./mill"
4658
} else {
4759
"mill"
4860
}
61+
4962
val millProcess = index.process(
5063
List(
5164
command,

0 commit comments

Comments
 (0)