You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Judy Anderson <JA...@rocketsoftware.com> on 2008/01/24 21:11:21 UTC
Variable numbers of s to
One of our steps involves calling a Java program which takes a number of arguments, and the last few are varargs, for lack of a better description. I have a list, e.g., "foo,bar,baz", in a property, which should be mapped to foo.jar, bar.jar, and baz.jar as the final arguments. I spent a little time trying to figure out how to make some kind of a mapper get the ".jar" appended (unsuccessfully, if someone wants to help me decode the documentation about those), but then I suddenly had the realization that I wasn't going to be able to pass them to Java in the end, because I don't have a way to construct an unknown number of <arg> elements.
Or do I and I just haven't found it?
Judy Anderson
Rocket Software
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: Variable numbers of s to
Posted by Judy Anderson <JA...@rocketsoftware.com>.
YES! Where would I have learned about the line="xxx" format of <arg>? The only examples under <java> are value="xxx". Oh, I see if I drill down hard enough I find an example that isn't about running java but apparently uses the same structure. Well, thanks for finding it for me, sorry to be a bother... I kind of wish there was an index for these nested elements like there is for tasks so I could look them up by name rather than happening upon their definitions by chance. Or not, as in this case ;-)
-----Original Message-----
From: David Jackman [mailto:David.Jackman@fastsearch.com]
Sent: Thursday, January 24, 2008 4:34 PM
To: Ant Users List
Subject: RE: Variable numbers of <arg>s to <java>
Does
<java ...>
<arg line="positional-args ${mymappedlist}" />
</java>
do what you want (without the warnings)?
-----Original Message-----
From: Judy Anderson [mailto:JAnderson@rocketsoftware.com]
Sent: Thursday, January 24, 2008 2:24 PM
To: user@ant.apache.org
Subject: Re: Variable numbers of <arg>s to <java>
Replying to my own message: I found an example of a mapper that did
what I
wanted to create a string "foo.jar bar.jar baz.jar". Then I was cooking
with gas, and I used the DEPRECATED form
<java args="positional-args ${mymappedlist}">
It's pretty ugly because in addition to the mapped list there are
several
positional arguments that have to be specified...
Please undeprecate this usage. Now I get a warning in my build. But I
can't see how else to do it.
Judy Anderson wrote:
>
> One of our steps involves calling a Java program which takes a number
of
> arguments, and the last few are varargs, for lack of a better
description.
> I have a list, e.g., "foo,bar,baz", in a property, which should be
mapped
> to foo.jar, bar.jar, and baz.jar as the final arguments. I spent a
little
> time trying to figure out how to make some kind of a mapper get the
".jar"
> appended (unsuccessfully, if someone wants to help me decode the
> documentation about those), but then I suddenly had the realization
that I
> wasn't going to be able to pass them to Java in the end, because I
don't
> have a way to construct an unknown number of <arg> elements.
>
> Or do I and I just haven't found it?
>
> Judy Anderson
> Rocket Software
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>
--
View this message in context:
http://www.nabble.com/Variable-numbers-of-%3Carg%3Es-to-%3Cjava%3E-tp150
73853p15075373.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: Variable numbers of s to
Posted by David Jackman <Da...@fastsearch.com>.
Does
<java ...>
<arg line="positional-args ${mymappedlist}" />
</java>
do what you want (without the warnings)?
-----Original Message-----
From: Judy Anderson [mailto:JAnderson@rocketsoftware.com]
Sent: Thursday, January 24, 2008 2:24 PM
To: user@ant.apache.org
Subject: Re: Variable numbers of <arg>s to <java>
Replying to my own message: I found an example of a mapper that did
what I
wanted to create a string "foo.jar bar.jar baz.jar". Then I was cooking
with gas, and I used the DEPRECATED form
<java args="positional-args ${mymappedlist}">
It's pretty ugly because in addition to the mapped list there are
several
positional arguments that have to be specified...
Please undeprecate this usage. Now I get a warning in my build. But I
can't see how else to do it.
Judy Anderson wrote:
>
> One of our steps involves calling a Java program which takes a number
of
> arguments, and the last few are varargs, for lack of a better
description.
> I have a list, e.g., "foo,bar,baz", in a property, which should be
mapped
> to foo.jar, bar.jar, and baz.jar as the final arguments. I spent a
little
> time trying to figure out how to make some kind of a mapper get the
".jar"
> appended (unsuccessfully, if someone wants to help me decode the
> documentation about those), but then I suddenly had the realization
that I
> wasn't going to be able to pass them to Java in the end, because I
don't
> have a way to construct an unknown number of <arg> elements.
>
> Or do I and I just haven't found it?
>
> Judy Anderson
> Rocket Software
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>
--
View this message in context:
http://www.nabble.com/Variable-numbers-of-%3Carg%3Es-to-%3Cjava%3E-tp150
73853p15075373.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Variable numbers of s to
Posted by Judy Anderson <JA...@rocketsoftware.com>.
Replying to my own message: I found an example of a mapper that did what I
wanted to create a string "foo.jar bar.jar baz.jar". Then I was cooking
with gas, and I used the DEPRECATED form
<java args="positional-args ${mymappedlist}">
It's pretty ugly because in addition to the mapped list there are several
positional arguments that have to be specified...
Please undeprecate this usage. Now I get a warning in my build. But I
can't see how else to do it.
Judy Anderson wrote:
>
> One of our steps involves calling a Java program which takes a number of
> arguments, and the last few are varargs, for lack of a better description.
> I have a list, e.g., "foo,bar,baz", in a property, which should be mapped
> to foo.jar, bar.jar, and baz.jar as the final arguments. I spent a little
> time trying to figure out how to make some kind of a mapper get the ".jar"
> appended (unsuccessfully, if someone wants to help me decode the
> documentation about those), but then I suddenly had the realization that I
> wasn't going to be able to pass them to Java in the end, because I don't
> have a way to construct an unknown number of <arg> elements.
>
> Or do I and I just haven't found it?
>
> Judy Anderson
> Rocket Software
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Variable-numbers-of-%3Carg%3Es-to-%3Cjava%3E-tp15073853p15075373.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Variable numbers of s to
Posted by Dominique Devienne <dd...@gmail.com>.
On Jan 24, 2008 2:11 PM, Judy Anderson <JA...@rocketsoftware.com> wrote:
> One of our steps involves calling a Java program which takes a number of arguments, and the last few are varargs, for lack of a better description. I have a list, e.g., "foo,bar,baz", in a property, which should be mapped to foo.jar, bar.jar, and baz.jar as the final arguments. I spent a little time trying to figure out how to make some kind of a mapper get the ".jar" appended (unsuccessfully, if someone wants to help me decode the documentation about those), but then I suddenly had the realization that I wasn't going to be able to pass them to Java in the end, because I don't have a way to construct an unknown number of <arg> elements.
Sorry, but this sounds a bit unusual. Can you detail what you are
trying to achieve at a higher level? And after that, provide maybe
examples of the command line you are trying to replicate with Ant, and
why it must be generated from a single property?
Sometimes by taking a step back and showing us the big picture, we see
a completely different way to something. Thanks, --DD
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org