Skip to content

Commit

Permalink
Ignore any other warnings when detecting Java version (#56150)
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira committed May 4, 2020
1 parent c03a3f8 commit b9ea5d5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,12 @@ class BuildPlugin implements Plugin<Project> {
result.rethrowFailure()
result.assertNormalExitValue() // assert exit value in case the failure cause is null
}
return (captureStdErr ? stderr : stdout).toString('UTF-8').trim()
String[] lines = (captureStdErr ? stderr : stdout).toString('UTF-8').trim().split('\n')
if (lines.length == 0) {
throw new GradleException("Expected command to produce output but it did not.")
}

return lines[lines.length - 1]
}

/** Return the configuration name used for finding transitive deps of the given dependency. */
Expand Down

0 comments on commit b9ea5d5

Please sign in to comment.