gradle/gradle — pull request #354 by mizdebsk (2014-11-20 10:49:10+00:00)
Title: Use hostname command as fallback way of getting build host name

- getHostName() may fail for number of reasons, for example when
networking is disabled or network is down.
- hostname command is a portable way of determining host name,
which doesn't depend on networking to be available.

For more details, see: http://stackoverflow.com/a/7800008

For example, Fedora build servers don't have networking available, not even local loopback interface (localhost). As a result host name in Gradle build is always set to "unknown". This patch fixes the problem.