You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Javier Pavier <ja...@hotmail.com> on 2006/01/23 15:19:50 UTC

RE: Convert fileset into command-line args, allowing for spaces in directori

Hi,

>hmm, dont know what this stuff should do. But if it works for you,
>I can skip that ...

It just creates fileset of the files I need. It works :-)

> ><pathconvert pathsep=";" property="theCommandLineFiles"
> >refid="my.files"/> which will semicolon separate my files for
> >me ... ok, but how do I then get these as command line args on
> >a <java> task ?
>
>One string will be passed to main(String[]) when using <arg line> have
>to have a look what <arg path> would do.

I don't want one string. I want each file to be passed as a separate command 
line arg.
The application cannot be changed. It takes args in and each file should be 
a separate arg.

If I use <arg line="..."> I get the problems with spaces being used for 
separating the files and so Ant splits the files at incorrect places.

If I use <arg path="..."> it passes a single command line arg.

Lets give an example, if my FileSet has
/my/file/with a space/file1
/my/file/withoutaspace/file2

I want these both passed in as they are there as 2 separate commandline 
args.


Thanks for your response.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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


Re: Convert fileset into command-line args, allowing for spaces in directori

Posted by Dominique Devienne <dd...@gmail.com>.
On 1/23/06, Javier Pavier <ja...@hotmail.com> wrote:
> >Lets give an example, if my FileSet has
> >/my/file/with a space/file1
> >/my/file/withoutaspace/file2
> >
> >I want these both passed in as they are there as 2 separate commandline
> >args.
>
> I managed to achieve this at last since I'm using a Jelly file and so can
> use a Jelly tokenizer to split the path apart and iterate through it. Still
> no idea how people are supposed to do this with Ant!

<apply> with its 'parallel' attribute might be what you want. It forks
a separate process though, so would work only if you are using <exec>
or <java fork="true">.

--DD

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


RE: Convert fileset into command-line args, allowing for spaces in directori

Posted by Javier Pavier <ja...@hotmail.com>.
>Lets give an example, if my FileSet has
>/my/file/with a space/file1
>/my/file/withoutaspace/file2
>
>I want these both passed in as they are there as 2 separate commandline 
>args.

I managed to achieve this at last since I'm using a Jelly file and so can 
use a Jelly tokenizer to split the path apart and iterate through it. Still 
no idea how people are supposed to do this with Ant!

Thanks anyway

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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