Skip to content

Commit b67d98b

Browse files
authored
Merge pull request #373 from olafurpg/sbt-packge-repo
2 parents 9a74d1b + 51dd326 commit b67d98b

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ class LsifBuildTool(index: IndexCommand) extends BuildTool("LSIF", index) {
165165
return CommandResult(0, Nil)
166166
}
167167

168-
val compileAttemtps = ListBuffer.empty[Try[Unit]]
169-
compileAttemtps += compileJavaFiles(tmp, deps, config, javaFiles)
170-
compileAttemtps += compileScalaFiles(deps, scalaFiles)
171-
compileAttemtps += compileKotlinFiles(deps, config, kotlinFiles)
172-
val errors = compileAttemtps.collect { case Failure(exception) =>
168+
val compileAttempts = ListBuffer.empty[Try[Unit]]
169+
compileAttempts += compileJavaFiles(tmp, deps, config, javaFiles)
170+
compileAttempts += compileScalaFiles(deps, scalaFiles)
171+
compileAttempts += compileKotlinFiles(deps, config, kotlinFiles)
172+
val errors = compileAttempts.collect { case Failure(exception) =>
173173
exception
174174
}
175175

@@ -179,6 +179,9 @@ class LsifBuildTool(index: IndexCommand) extends BuildTool("LSIF", index) {
179179
val isSemanticdbGenerated = Files
180180
.isDirectory(targetroot.resolve("META-INF"))
181181
if (errors.nonEmpty && !isSemanticdbGenerated) {
182+
errors.foreach { error =>
183+
index.app.reporter.log(Diagnostic.exception(error))
184+
}
182185
CommandResult(1, Nil)
183186
} else {
184187
if (errors.nonEmpty && isSemanticdbGenerated) {
@@ -376,8 +379,9 @@ class LsifBuildTool(index: IndexCommand) extends BuildTool("LSIF", index) {
376379
)(fn: PresentationCompiler => T): T = {
377380
val scalaVersion = deps
378381
.classpath
379-
.headOption
382+
.iterator
380383
.flatMap(jar => ScalaVersion.inferFromJar(jar))
384+
.nextOption()
381385
.getOrElse {
382386
throw new IllegalArgumentException(
383387
s"failed to infer the Scala version from the dependencies: " +

0 commit comments

Comments
 (0)