ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scot P. Floess" <flo...@mindspring.com>
Subject Re: Outputting file sets that do not exist...
Date Fri, 12 May 2006 13:45:24 GMT
Uhm and please disregard the comment pertaining to javacc ;)  I cut 'n 
pasted into a new build.xml to hack away on the part I needed :)  I just 
noticed I left the comment in place ;)

Scot P. Floess wrote:
> Help...this is driving me nuts ;)
>
> Let's say I want to define a path - but for "whatever" reason parts of 
> the path do not exist as specified in a fileset or dirset.  Below is 
> an example (please note - I have no /foo directory on my harddrive):
>
> <project  name = "dir-test" default = "output">
>    <taskdef  resource = "net/sf/antcontrib/antlib.xml"/>
>
>    <path  id = "PATH_REF_ID">
>        <fileset  dir = "/foo">
>            <include  name = "**/**.jar"/>
>        </fileset>
>    </path>
>
>    <pathconvert property = "PATH" refid = "PATH_REF_ID"/>
>
>    <target name = "output">
>        <!--
>          -
>          - Loop through all javacc files to compile...
>          -
>          -->
>        <for  param = "path-part">
>            <path  refid = "PATH_REF_ID"/>
>
>            <sequential>
>                <echo  message = "@{path-part}"/>
>            </sequential>
>        </for>
>    </target>
> </project>
>
> Above, I actually tried two things - using a <pathconvert> as well as 
> trying to iterate over the path using <for>.  Regardless, I get 
> flagged from ant stating /foo does not exist - which it doesn't ;)  
> Really, what I am trying to figure out is, in a much larger sense, if 
> I have filesets where some portions do exist and others do not, how 
> can I output what is there.  One way was to wrap in a <try> <catch> 
> but I didn't really like that solution...as the failure arose and all 
> I could do was output a message stating "some parts do not exist"
>
> It's not any better setting a property and using refid of the path 
> either - doesn't work - same error :|
>
> Anyone have a good suggestion to the above?  It's a long story as to 
> why I want to output in this way...but I have a reason for wanting to 
> do so :)
>
> Thanks ahead of time!
>
> Scot
>

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

252-478-8087 (Home)
919-754-4592 (Work)

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


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


Mime
View raw message