ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Fix <jakob....@gmail.com>
Subject Re: apply task trouble for command using < and >
Date Thu, 24 Nov 2005 14:20:22 GMT
Jan,

On 24/11/05, Jan.Materne@rzf.fin-nrw.de <Jan.Materne@rzf.fin-nrw.de> wrote:
> < and > mean redirection of STDIN and STDOUT from/to file.
> So I would have a look at nested <redirector>s.

I was hoping never being required to use this element in my ant
scripts, because they look so fiendishly difficult to use.  Now, I've
played around with them (after having to upgrade from 1.6.1 to 1.6.5),
but I can't get my head around its usage.  Apparently, only one
redirector can be specified, but I have really no idea at which point
inside the <apply> task, with which attributes, nested elements, etc. 
No examples are given in the documentation
http://ant.apache.org/manual/CoreTypes/redirector.html

I tried to add

<redirector>
  <inputmapper type="identity">
  <outputmapper type="identity"/>
</redirector>

inside the <apply> container, but am not seeing any light at the end
of the tunnel.  Please help! :-)

> Jan


--
cheers,
Jakob.


> >-----Urspr√ľngliche Nachricht-----
> >Von: Jakob Fix [mailto:jakob.fix@gmail.com]
> >Gesendet: Donnerstag, 24. November 2005 13:53
> >An: Ant Users List
> >Betreff: apply task trouble for command using < and >
> >
> >Hello,
> >
> >I have the following command line (see [1] for jsmin):
> >
> >  jsmin < bigfile.js > smallfile.js "prefix file with this comment"
> >
> >To do this for an entire directory I created this task:
> >
> ><target name="jsmin">
> >  <apply executable="jsmin.exe" failonerror="true" dest="${dir.out}">
> >    <arg value=" &lt; "/>
> >    <srcfile/>
> >    <arg value=" &gt; "/>
> >    <targetfile/>
> >    <arg value="${comment}"/>
> >    <fileset dir="${dir.in}" includes="*.js"/>
> >    <mapper type="identity"/>
> >  </apply>
> ></target>
> >
> >This runs, but the result is not at all satisfactory:
> >- No output is produced,
> >- Only four lines are written to standard output as javascript
> >comments (as jsmin would do with everything after the outfile
> >argument).
> >
> >My suspicion is that the problem may be caused by the "<" and ">"
> >characters in the command line.  Could it be that they are ignored?
> >
> >Thanks for any idea to get this resolved.
> >
> >
> >The -v output of this is:
> >
> >jsmin:
> >    [apply] Current OS is Windows XP
> >    [apply] DyApplication.js added as DyApplication.js doesn't exist.
> >    [apply] Executing
> >'D:\Projects\dy\tests\JSMinAnt\jsmin.exe' with arguments:
> >    [apply] ' < '
> >    [apply] 'D:\Projects\dy\tests\JSMinAnt\in\DyApplication.js'
> >    [apply] ' > '
> >    [apply] 'D:\Projects\dy\tests\JSMinAnt\out\DyApplication.js'
> >    [apply] 'prefix file with this comment'
> >    [apply]
> >    [apply] The ' characters around the executable and arguments are
> >    [apply] not part of the command.
> >    [apply] //  <
> >    [apply] // D:\Projects\dy\tests\JSMinAnt\in\DyApplication.js
> >    [apply] //  >
> >    [apply] // D:\Projects\dy\tests\JSMinAnt\out\DyApplication.js
> >    [apply] // prefix file with this comment
> >
> >    [apply] Applied D:\Projects\dy\tests\JSMinAnt\jsmin.exe to
> >1 file and 0 directories.
> >
> >
> >--
> >cheers,
> >Jakob.
> >
> >[1] http://www.crockford.com/javascript/jsmin.html

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


Mime
View raw message