ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey N. Solofnenko" <A.Solofne...@mdl.com>
Subject Re: trouble passing args to <apply>
Date Thu, 13 Jul 2006 21:48:07 GMT
Can you try putting both mappers inline?

- Alexey.

Rich Goldman wrote:
> Hello, I'm really stuck here, would be very very grateful for some help.
>
> I'm using the ant core task <apply> successfully to process all the
> files in a directory, like this:
>
>     <target name="compress-css" depends="clean-css">
>         <echo message="Compressing CSS files" />
>         <mapper id="css_dir"
>                 type="glob"
>               from="*.css"
>               to="${deploy.css}/*.css"/>
>         <apply executable="${tools.bin}/csstidy-1.2" failonerror="yes"
> dest="${deploy.css}" verbose="yes">
>             <fileset dir="${web.css.home}" includes="*.css"/>
>             <mapper refid="css_dir"/>
>             <redirector>
>                 <outputmapper refid="css_dir"/>
>             </redirector>
>         </apply>
>         <antcall target="rename-css" />
>     </target>
>
>
> However, I've realized that I now need to pass an argument along to
> 'csstidy'. So instead of this:
>
>     bash$  csstidy infile.js outfile.js
>
> ...it needs to look like this:
>
>     bash$  csstidy infile.js --silent=true outfile.js
>
> I thought the following would work, but it doesn't:
>
>         <apply executable="${tools.bin}/csstidy-1.2" failonerror="yes"
> dest="${deploy.css}" verbose="yes">
>
>             <srcfile/>
>             <arg value="-silent=true"/>
>             <targetfile/>
>
>             <fileset dir="${web.css.home}" includes="*.css"/>
>             <mapper refid="css_dir"/>
>             <redirector>
>                 <outputmapper refid="css_dir"/>
>             </redirector>
>         </apply>
>
> My output files are empty when I run this. Does anyone know what I'm
> doing wrong?
>
> Muchas gracias!!
> rich
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>   

Mime
View raw message