diff --git a/scip-java/src/main/scala/com/sourcegraph/scip_java/buildtools/MillBuildTool.scala b/scip-java/src/main/scala/com/sourcegraph/scip_java/buildtools/MillBuildTool.scala index ce9ea473..7e0b88b8 100644 --- a/scip-java/src/main/scala/com/sourcegraph/scip_java/buildtools/MillBuildTool.scala +++ b/scip-java/src/main/scala/com/sourcegraph/scip_java/buildtools/MillBuildTool.scala @@ -35,6 +35,8 @@ class MillBuildTool(index: IndexCommand) extends BuildTool("mill", index) { 1 } + private val rawOutput = index.output.toString + private def unconditionallyGenerateScip(): Int = { val localMill = Files.isRegularFile(millFile) val command = @@ -48,7 +50,9 @@ class MillBuildTool(index: IndexCommand) extends BuildTool("mill", index) { command, "--import", s"ivy:io.chris-kipp::mill-scip::${BuildInfo.millScipVersion}", - "io.kipp.mill.scip.Scip/generate" + "io.kipp.mill.scip.Scip/generate", + "--output", + rawOutput ) ) val scipFile = index @@ -60,10 +64,10 @@ class MillBuildTool(index: IndexCommand) extends BuildTool("mill", index) { .resolve("scip") .resolve("Scip") .resolve("generate.dest") - .resolve("index.scip") + .resolve(rawOutput) if (millProcess.exitCode == 0 && Files.isRegularFile(scipFile)) { - val output = index.workingDirectory.resolve("index.scip") + val output = index.workingDirectory.resolve(rawOutput) Files.copy(scipFile, output, StandardCopyOption.REPLACE_EXISTING) index.app.info(output.toString) } diff --git a/tests/buildTools/src/test/scala/tests/MillBuildToolSuite.scala b/tests/buildTools/src/test/scala/tests/MillBuildToolSuite.scala index 96e91f42..a4b71c9c 100644 --- a/tests/buildTools/src/test/scala/tests/MillBuildToolSuite.scala +++ b/tests/buildTools/src/test/scala/tests/MillBuildToolSuite.scala @@ -118,4 +118,23 @@ class MillBuildToolSuite extends BaseBuildToolSuite { initCommand = setupMill("0.10.7"), targetRoot = Some("out/io/kipp/mill/scip/Scip/generate.dest") ) + + checkBuild( + "lsif-output", + s"""|/.mill-version + |0.10.7 + |/build.sc + |import mill._, scalalib._ + |object minimal extends ScalaModule { + | def scalaVersion = "3.1.3" + |} + |/minimal/src/Main.scala + |package minimal + |@main def hello = () + |""".stripMargin, + expectedSemanticdbFiles = 1, + initCommand = setupMill("0.10.7"), + targetRoot = Some("out/io/kipp/mill/scip/Scip/generate.dest"), + extraArguments = List("--output", "dump.lsif") + ) }