ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: gnoob question: if
Date Tue, 19 Mar 2002 19:06:31 GMT
--- stephan beal <stephan@einsurance.de> wrote:
> On Monday 18 March 2002 20:00 pm, Diane Holt wrote:
> > --- Michael Laccetti <michael@is-inc.ca> wrote:
> > > It's a bit more in depth than that.  I actually was looking for
> > > something embedded within a target block.  I pass in a parameter,
> > > and based on it's value, I want to copy certain files only.
> > > Anything fit the bill?
> >
> > The <include> and <exclude> tags also allow for if/unless.
> 
> But be aware that those won't do "exactly" what you're asking - to do 
> something based on the VALUE of a property. if/unless work if (unless)
> the property is set to ANY value (including false).

True. If you're needing to test on the actual value, then you'll have to
pass your "parameter" through <condition> first to set/not-set a property,
then use that property in your <include>/<exclude>.

For example:
  <target name="copyfiles">
    <condition property="excludeFoofiles" value="true">
      <equals arg1="${parameter}" arg2="needed.value"/>
    </condition>
    <copy todir="${dest.dir}">
      <fileset dir="${src.dir}">
        <exclude name="**/*foo*" if="excludeFoofiles"/>
      </fileset>
    </copy>
  </target>

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

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


Mime
View raw message