Now just perform this same condition/property/test sequence for the other operating systems you want to handle, including Windows and Unix systems. The property created here named isMac will now hold a true/false boolean value that you can test with you Ant target later, like this: Here's a check I created to test for the Mac OS X operating system: Solutionįirst, create several small Ant condition tests that check the 'os family'.
You typically want/need to do this if you're going to run tasks/targets that are different for each operating system (Mac, Windows, Unix, etc.).
You're creating an Ant build script, and you need to determine the operating system the script is running on, so you can make conditional decisions within the build script.