Closed kilink closed 3 years ago
We guarded that call up one level already, I've been running on an M1 Mac for the last month:
Released back in December, updated the tag now so it appears properly in the sidebar:
https://github.com/nebula-plugins/gradle-info-plugin/releases/tag/v9.1.2
Nice, I missed that commit somehow. Only nitpick is that the test fails for me, as hostname
returns something other than localhost
for me, although in practice it shouldn't matter.
The way POSIXUtil initialized the JNA Native library in a static field meant if the call failed, the class itself would fail to initialize. To handle this case more gracefully, move the JNA call to a static initializer which catches any exceptions.
Additionally, add a fallback to getHostName that shells out to /bin/hostname when JNA fails.
JNA currently does not support Apple silicon (see this PR), so attempting to build projects that use Nebula results in failures like the following:
Could not initialize class nebula.plugin.info.ci.POSIXUtil
The exception that is thrown while POSIXUtil is being initialized is as follows: