ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Satish Jeejula" <>
Subject Cross-Platform Exec Task
Date Thu, 28 Oct 2004 23:45:04 GMT
Hi All,
I am trying to write a target that calls an different executable
depending upon the operating system it is running on. For example, this
is my intention.
<target name="runExecutable">
            <!-on windows 2000 or XP -->
        <exec executable="executable.bat" />
            <!-on UNIX Solaris or AIX -->
        <exec executable="" />
I can't include element "os" in the "exec" .
if I have to use 'os' attribute in the 'exec', I have provide correct
value to it and redundant code is the result. This is what I am doing
right now.
<target name="runExecutable">
            <!-on windows 2000 -->
        <exec executable="executable.bat" os="Windows XP" />
            <!-on windows XP -->
        <exec executable="executable.bat"  os="Windows 2000"/>
            <!-on UNIX Solaris -->
        <exec executable="" os="SunOS"/>
            <!-on UNIX AIX -->
        <exec executable="" os="Aix"/>
 Is there any way to generalize it?

The information contained in this message is privileged and intended only
for the recipients named. If the reader is not a representative of the
intended recipient, any review, dissemination or copying of this message or
the information it contains is prohibited. If you have received this
message in error, please immediately notify the sender, and delete the
original message and attachments.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message