ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gath" <gat...@bltbd.com>
Subject Re: How to list files to console or file.
Date Wed, 08 Dec 2004 21:50:42 GMT
Thanks everyone for the help.  I was able to do pretty much what I want by
using...

      <pathconvert property="resource_list_tmp" pathsep="${line.separator}">
         <path>
         <fileset dir="${classes_dir}" casesensitive="no">
            <patternset refid="resources_id"/>
         </fileset>
         </path>
         <map from="${classes_dir}${file.separator}" to=""/>
      </pathconvert>
      <echo message="${resource_list_tmp}" file="${resource_list_fn}"/>

This gave me results that looked like...

foobar\app\images\frame.gif
foobar\app\images\splash.jpg
foobar\app\images\workspace_toolbar.gif
foobar\lib\images\add.gif
foobar\lib\images\edit.gif
...etc.

I used the <map> element in order to remove the fileset's basedir.  I
would have also liked to replace the '\' with '/' but couldn't figure out
how to do that.  The <map> element only works for matching prefixes. 
<mapper> wasn't a valid element for either <pathconvert> or <fileset>. 
Is
there any other way?

It's not absolutely necessary since the code that reads in the file can do
the character translation itself, but it'd be nice if Ant could do it.

Brian


<quote who="Matt Benson">
> Or ${line.separator}.
>
> -Matt
>
> --- Daniel Blaukopf <daniel.blaukopf@sun.com> wrote:
>
>> probably with
>>
>> pathsep="
> "
>>
>> if you want each file on its own line.
>>
>> Daniel
>>
>> Matt Benson wrote:
>>
>> ><pathconvert> is your friend.
>> >
>> >-Matt
>> >
>> >--- gath29@bltbd.com wrote:
>> >
>> >
>> >
>> >>I have a need to create a text file that lists all
>> >>.gif, .jpg, etc. files.
>> >>It's simple to create a fileset that contains the
>> >>files I need but what's
>> >>the best way to output this list into a text file?
>> >>
>> >>I could use <foreach> from ant-contrib but that
>> >>requires an <antcall> for
>> >>each file which is slow and tedious.  I
>> >>unfortunately can't use the newer
>> >><for> task since it rquires Ant 1.6+ which in turn
>> >>requires Java 1.2+ but
>> >>I must remain compatible with 1.1 (doing applet
>> >>work).
>> >>
>> >>I wrote my own small task to do this but I'd
>> rather
>> >>use a 'standard'
>> >>task(s) if it's possible.  If not possible, and if
>> >>anyone is interested in
>> >>my task, <listfiles>, I'd be happy to submit it to
>> >>Ant developement.
>> >>
>> >>Brian DeWeese
>> >>
>> >>
>> >>
>> >>
>>
>>---------------------------------------------------------------------
>> >
>> >
>> >>To unsubscribe, e-mail:
>> >>user-unsubscribe@ant.apache.org
>> >>For additional commands, e-mail:
>> >>user-help@ant.apache.org
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>> >
>> >
>> >__________________________________
>> >Do you Yahoo!?
>> >The all-new My Yahoo! - Get yours free!
>> >http://my.yahoo.com
>> >
>> >
>> >
>>
>>---------------------------------------------------------------------
>> >To unsubscribe, e-mail:
>> user-unsubscribe@ant.apache.org
>> >For additional commands, e-mail:
>> user-help@ant.apache.org
>> >
>> >
>> >
>>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> user-unsubscribe@ant.apache.org
>> For additional commands, e-mail:
>> user-help@ant.apache.org
>>
>>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - Easier than ever with enhanced search. Learn more.
> http://info.mail.yahoo.com/mail_250
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


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


Mime
View raw message