Skip to content

Commit cca3bbc

Browse files
committed
fixes #42
1 parent 6587270 commit cca3bbc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

plugin/src/main/groovy/org/stoyicker/androidcheck/CommonCheck.groovy

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,13 @@ abstract class CommonCheck<Config extends CommonConfig> {
6464
if (errorCount) {
6565
String errorMessage = getErrorMessage(errorCount, htmlReportFile)
6666
if (abortOnError) {
67-
Desktop.getDesktop().browse(new URI("file://"+htmlReportFile.absolutePath))
67+
if (Desktop.isDesktopSupported()) {
68+
Desktop.getDesktop().browse(new URI("file://"+htmlReportFile.absolutePath))
69+
} else {
70+
target.logger.warn "Your system does not support java.awt.Desktop. " +
71+
"Not opening report automatically. " +
72+
"See https://github.com/stoyicker/android-check-2/issues/42"
73+
}
6874
throw new GradleException(errorMessage)
6975
} else {
7076
target.logger.warn errorMessage

0 commit comments

Comments
 (0)