ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ford, Robert" <>
Subject OS Attribute in Copy Task
Date Wed, 01 Aug 2001 14:55:36 GMT

Are there any plans to include the OS attribute (found in the exec task)
into the copy task?  I have several scripts that need to copy a different
set of files depending on the operating system that the task is running
under.  It seems to me that it would be very helpful to be able to have
something like:

<target name="dist">
  <copy todir="dist/lib" os="Windows 2000">
    <fileset dir="directoryA/lib" includes="*.dll">

  <copy todir="dist/lib" os="SunOS">
    <fileset dir="directoryA/lib" includes="*.so">

Thus, .dll files would only get copied to ./dist/lib under Windows 2000 and
the .so files would only get copied to ./dist/lib under SunOS.

Up to this point, the only way I have made this work is to dedicate an
entire task to a particular OS and have that task use "IF" and "UNLESS"
attributes to detect environment variables like "windir" (that will exist if
the os is windows) to control execution.

Is there a better way to do this or am I missing something here?

Rob Ford

View raw message