Skip to content

Commit c6c6833

Browse files
committed
Return non-zero exit code when missing SemanticDB files
Previously, `lsif-java index` would occasionally return a successful exit code even if it didn't produce a `dump.lsif` file. Now, it should return the exit code 1 instead in these scenarios.
1 parent 8848cf4 commit c6c6833

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

lsif-java/src/main/scala/com/sourcegraph/lsif_java/buildtools/LsifBuildTool.scala

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -160,18 +160,20 @@ class LsifBuildTool(index: IndexCommand) extends BuildTool("LSIF", index) {
160160
.isDirectory(targetroot.resolve("META-INF"))
161161
if (errors.nonEmpty && !isSemanticdbGenerated) {
162162
CommandResult(1, Nil)
163-
} else if (errors.nonEmpty && isSemanticdbGenerated) {
164-
index
165-
.app
166-
.reporter
167-
.info(
168-
"Some SemanticDB files got generated even if there were compile errors. " +
169-
"In most cases, this means that lsif-java managed to index everything " +
170-
"except the locations that had compile errors and you can ignore the compile errors." +
171-
errors.mkString("\n")
172-
)
163+
} else {
164+
if (errors.nonEmpty && isSemanticdbGenerated) {
165+
index
166+
.app
167+
.reporter
168+
.info(
169+
"Some SemanticDB files got generated even if there were compile errors. " +
170+
"In most cases, this means that lsif-java managed to index everything " +
171+
"except the locations that had compile errors and you can ignore the compile errors." +
172+
errors.mkString("\n")
173+
)
174+
}
175+
CommandResult(0, Nil)
173176
}
174-
CommandResult(0, Nil)
175177
}
176178

177179
private def compileScalaFiles(

0 commit comments

Comments
 (0)