This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Detecting the platform is easy - all of the JRE environment variables defined in java.System properties are available to Ant. I've run scripts that knew whether they were running Windows or Unix and, if Unix, whether Linux or Solaris.
Exporting out of Ant is a little more challenging.
An IDE is no substitute for an Intelligent Developer.