Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Use hostname command as fallback way of getting build host name #354
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.
- 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.