Skip to content

Commit

Permalink
Add guard to POSIXUtil, JNA doesn't work on Apple Silicon
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielThomas committed Dec 11, 2020
1 parent 4049b2b commit 9bca856
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,19 @@ abstract class AbstractContinuousIntegrationProvider implements ContinuousIntegr
if (currentOs.isWindows()) {
try {
return Kernel32Util.getComputerName()
} catch (Throwable ignored) {
} catch (Throwable t) {
// with variations in Gradle versions and JVMs, this can sometimes break
log.log(Level.WARNING, "Unable to determine the host name on this Windows instance")
return 'localhost'
log.log(Level.WARNING, "Unable to determine the host name on this Windows instance", t)
}
} else if (currentOs.isUnix()) {
return POSIXUtil.getHostName()
try {
return POSIXUtil.getHostName()
} catch (Throwable t) {
log.log(Level.WARNING, "Unable to determine the host name", t)
}
} else {
log.log(Level.WARNING, "Unknown operating system $currentOs, could not detect hostname")
return 'localhost'
}
return 'localhost'
}
}

0 comments on commit 9bca856

Please sign in to comment.