![]() (Mac OS X is build on top of a BSD/Mach base, so I'm assuming that's the answer, but I don't know for sure. When I run this Ant build script on my Mac OS X 10.5.7 system using Ant version 1.7.0, I get the following output:Īs I mentioned in a previous blog entry, this build script responds to both the isMac and isUnix test properties, and I'm going to dig into this and see if I can understand why. Sam Ruby GUMPvmgump: Project santuario (in module santuario) faile. in the folder where the build.xml resides run command only. It can be considered the ant equivalent of Makefile. Here's the complete source code for an Ant build script that demonstrates this process of detecting the current operating system, and then conditionally performing certain operating system specific tasks: GUMPvmgump: Project santuario (in module santuario) failed Sam Ruby GUMPvmgump: Project santuario (in module santuario) faile. The file build.xml is the default configuration file used by ant to determine target to build for a specific project. Each task element of the buildfile can have an id attribute and can later be referred to by the value supplied to this. Each buildfile contains one project and at least one (default) target. Now just perform this same condition/property/test sequence for the other operating systems you want to handle, including Windows and Unix systems. Apache Ant's buildfiles are written in XML. 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |