ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: conditional fileset
Date Wed, 04 Sep 2002 15:36:32 GMT
--- Ilja_Preuß <preuss@disy.net> wrote:
> The problem I am facing is that that target should be executed
> automatically from some other targets [...] but
> *only* if the fileset is defined (obviously...).

If by "defined" you mean contains files:

  <fileset id="fs" dir="${basedir}">
    <include name="*.txt"/>
  </fileset>

  <target name="doit" if="hasFiles" depends="checkFS">
    <echo>fs = ${fs}</echo>
  </target>

  <target name="checkFS">
    <pathconvert pathsep=" " refid="fs" property="fs"/>
    <condition property="hasFiles">
      <contains string="${fs}" substring="${basedir}"/>
    </condition>
  </target>

Diane

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



__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.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