ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craeg K. Strong" <cstr...@arielpartners.com>
Subject Question: how to send a fileset as an argument?
Date Wed, 13 Mar 2002 21:37:15 GMT
Hello:

I am using the <style>  task to create a bunch of fo files from a 
fileset of XML files

Then I am using the renderX XEP processor to create PDF files from the 
fo files

Simple enough, right?    The renderX processor is a java class that 
operates on .fo files passed on the command line.

The problem is, I don't know how to pass a fileset as an argument

<java  classname="foo.bar.renderx.xep">
    <classpath..../>
    <arg>
      <fileset...../>               <--- No can do
   </arg>
</java>

I thought of three possible ways of dealing with this problem:

1) generate my fileset "*.fo" and create a temporary file containing the 
names of the files.
Read in this file into a property
pass the property like so:

<arg line="${my-list-of-files}"/>

2) Create a new <renderx> ant task that accepts filesets and passes them as
arguments to the renderx processor.

3) Figure out some sort of "Pipe" concept a la UNIX pipes so you could 
have chains of
tasks that operate on files:

<pipe>
   <fileset..../>
   <style..../>
   <filter..../>
   <renderx..../>
</pipe>

Number one is a horrible hack.  Yuk.

Number two sounds like the way to go.  It involves a little Java coding, 
but is easily done.

Number three is an interesting idea, but is probably not in line with 
the "zen" of Ant...?
For one thing, you would not want to mimic UNIX pipes exactly, b/c we 
don't want to
futz around with stdin and stdout.   An ant task that directly uses 
stdin or stdout is badly behaved, right?
Of course, you wouldn't _have_ to use stdin/stdout,  but then you might 
have to instrument the
tasks to have some notion of output buffer or something.

I noticed there is a <styler> task at 
http://jakarta.apache.org/ant/external.html which does enable
tasks to be "pipelined" in this kind of way, but the things flowing 
between tasks are SAX events, not
files.   Has anyone thought about this kind of approach?  

hmmm.  I think the main question is whether it could be possible to have 
some way
of buffering inputs/outputs so that you wouldn't always be writing out 
to the filesystem and reading back in.
If chains of tasks could operate on in-memory items, it could be lots 
faster.    Is this an ant2 idea?

--Craeg



--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message