ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: executing task for each file in file set
Date Tue, 19 Jun 2001 05:53:38 GMT
Roger Vaughn <rogervaughn@yahoo.com> wrote:

> I have a set of targets for each OS that look like this:
> 
>   <target name="winlib" depends="compile">
>     <copy todir="${build.dll}">
>       <fileset dir="${src.dll}"/>
>     </copy>
>     <exec failonerror="yes" 
>           dir="${build.dll}" 
>           executable="make" 
>           os="Windows 2000"/>
>   </target>
> 
> Notice that I use make to actually do the C++ compiles - this saves
> a lot of headache in Ant.  However, this target does the copy task
> each time, regardless of which OS I'm on.

Hmm,

<condition property="iswindows">
  <os family="windows" />
</condition>

<target name="winlib" depends="compile" if="iswindows">
....

would do it, no?

Or with less features that are not there yet

<property name="is.${os.name}" />
<target name="winlib" depends="compile" if="is.Windows 2000">

I think your case can properly be handled by target if/unless and
setting some properties.

Stefan

Mime
View raw message