You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Amnon Khen <Am...@unipier.com> on 2004/10/19 15:45:57 UTC

complex arguments and the task

Hello Ant folk,

 

I am trying to use the <apply> task to apply some tool on a set of
files. The problem that the tool accepts its arguments in the format
-arg=file (i.e. a single argument without a space between "-arg" and the
filename that follows it), and I haven't found a way to generate this
type of argument.

 

This is the task I'm trying to execute:

<apply executable="my_tool" dir="working_dir"...>

            <fileset .../>

            <targetfile/>

<mapper type="regexp" from="^.*$" to="-arg=\0"/>

</apply>

 

I though that using the mapper to prefix the target file with "-arg"
would do the trick, but what actually happens is that Ant prefixes the
argument with the task's working directory. The generated command is:
"my_tool working_dir/-arg=file". What I need, is " my_tool -arg=file".

I though of writing my own mapper, but I understand that prefixing of
the working directory doesn't happen in the mapper.

 

Has anyone tried something like this before?

Does anyone have an idea how to solve this problem?

 

Thanks for your time and consideration,

            Amnon

 

------------------------------------------------------------------------
---------------------------

            Amnon Khen

            Configuration Management, Unipier LTD. (formerly Cash-u)

            mobile: +972-54-4922394, web: http://www.unipier.com
<http://www.unipier.com/> 

 


Re: complex arguments and the task

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 19 Oct 2004, Amnon Khen <Am...@unipier.com> wrote:

> I though that using the mapper to prefix the target file with "-arg"
> would do the trick,

Yes, definitively a nice idea.

> but what actually happens is that Ant prefixes the argument with the
> task's working directory.

have you tried relative="true"?  Untested, but I'd expect it to work.

Stefan

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