ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: How does <exec> interpret an empty output property
Date Wed, 10 Nov 2004 15:23:15 GMT
--- sten.rosendahl@sungard.com wrote:
[SNIP]
> I have a macrodef passing on a logfile attribute to
> exec's output
> property. If I want as default to have no logfile,
> how do write this in
> the macrodef?
[SNIP]

If you have a fairly limited number of platforms to
work on, like Un*x vs. dos-based (Windows etc.), you
could do something like this:

<target name="foo" depends="defaultlogfile">
  <!-- do something with ${logfile} -->
</target>

<target name="defaultlogfile">
  <condition property="logfile" value="/dev/null">
    <os family="unix" />
  </condition>
  <condition property="logfile" value="NUL">
    <or>
      <os family="windows" />
      <!-- should work on netware as well -->
      <os family="netware" />
    </or>
  </condition>
  <fail unless="logfile" />
</target>

> 
> Sten Rosendahl

-Matt


		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message