Skip to content

Commit d91e4c0

Browse files
committed
Output Gradle errors during dependency resolution
1 parent 9e5086b commit d91e4c0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

shared/src/main/kotlin/org/javacs/kt/classpath/GradleClassPathResolver.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,14 @@ private fun readDependenciesViaGradleCLI(projectDirectory: Path, gradleScripts:
8989

9090
private fun findGradleCLIDependencies(command: String, projectDirectory: Path): Set<Path>? {
9191
val (result, errors) = execAndReadStdoutAndStderr(command, projectDirectory)
92-
LOG.debug(result)
9392
if ("FAILURE: Build failed" in errors) {
94-
LOG.warn("Gradle task failed: {}", errors.lines().joinToString("\n"))
93+
LOG.warn("Gradle task failed: {}", errors)
94+
} else {
95+
for (error in errors.lines()) {
96+
if ("ERROR: " in error) {
97+
LOG.warn("Gradle error: {}", error)
98+
}
99+
}
95100
}
96101
return parseGradleCLIDependencies(result)
97102
}

0 commit comments

Comments
 (0)