ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: Problem converting path to property when a fileset's dir does not exist
Date Wed, 19 Oct 2005 18:22:49 GMT
--- "Scot P. Floess" <floess@mindspring.com> wrote:

> I was wondering if anyone can please help me?  I am
> having trouble 
> converting a path to a property when a fileset's dir
> does not exist.  
[SNIP]

You will have to check for the directory's existence
before adding the offending fileset to the path.  I
assume your expectation of pathconvert results for a
fileset with no matching files (including when the
directory does not exist) is "".

Example:

<project default="foo">

  <path id="base">
    <fileset dir="a" />
    <fileset dir="b" />
    <fileset dir="c" />
  </path>

  <path id="p" refid="base" />

  <target name="check">
    <available file="z" type="dir" property="found" />
  </target>

  <target name="modify" if="found">
    <path id="p">
      <path refid="base" />
      <fileset dir="z" />
    </path>
  </target>

  <target name="foo" depends="check,modify">
    <pathconvert property="result" refid="p"
                 pathsep="${line.separator}" />
    <echo>$${result}=${result}</echo>
  </target>

</project>

HTH,
Matt


	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.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