Matt:

Thanks for the quick and prompt reply :)

I considered using targets but was hoping that was not necessary (mostly because I dint want to see the extra target(s) listed and printed - just being anal).

I'm not sure why the source behind Path.java is coded to raise and exception if the directory is not there...or more to the point why I can't simply specify to <path> something like "ignore-non-existants"

Anyway, I can try the target solution...thanks :D

Matt Benson wrote:

--- "Scot P. Floess" <[EMAIL PROTECTED]> 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


--
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087      (home)
919-319-1099 x117 (work)

Chief Architect JPlate  http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim

Reply via email to