You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by D Bamud <no...@cad.delhi.nic.in> on 2003/05/24 11:00:32 UTC

ant trgjava 12

I want to give argument values to java task in one of my target. In nutshell I want to fire "ant
trgjava 12" at DOS prompt. 12 will go as the first argument to my program executed by the java task
in trgjava target. How to do this. (Note I do not want to use <arg> attribute).


Re: ant trgjava 12

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
Well, you could always tinker with your copy of ant.bat or ant[.sh] and 
make it so the second argument gets -Did= prepended to it automatically.

	Erik



On Saturday, May 24, 2003, at 05:44  AM, D Bamud wrote:
> Idea was to provide the simplest way to the developers
> to test their forms. We have many forms each having
> an ID. So if I say "ant test 12" then it starts the testing
> of form that has id 12. But now it seems that I need to
> settle at least with using it like "ant test -Did=12".
> Right! The whole idea was to convert "ant test -Did=12"
> to "ant test 12". Thanks for your comments.
>
>
>
>
> ----- Original Message -----
> From: "Erik Hatcher" <ja...@ehatchersolutions.com>
> To: "Ant Users List" <us...@ant.apache.org>
> Sent: Saturday, May 24, 2003 2:58 PM
> Subject: Re: ant trgjava 12
>
>
> | Let me get this straight.... you want to pass an _argument_ to your
> | Java program, but you don't want to use _<arg>_?
> |
> | May I ask why that constraint?
> |
> | To pass a parameter from the command-line of ant:
> |
> | ant trgjava -Darg=12
> |
> | Then use:
> |
> | <arg line="${arg}"/>
> |
> | nested within <java>.
> |
> | What's wrong with that?
> |
> | Erik
> |
> | On Saturday, May 24, 2003, at 05:00  AM, D Bamud wrote:
> | > I want to give argument values to java task in one of my target. In
> | > nutshell I want to fire "ant
> | > trgjava 12" at DOS prompt. 12 will go as the first argument to my
> | > program executed by the java task
> | > in trgjava target. How to do this. (Note I do not want to use <arg>
> | > attribute).
> | >
> | >
> | > 
> ---------------------------------------------------------------------
> | > 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>


Re: ant trgjava 12

Posted by Jacob Kjome <ho...@visi.com>.
Well, you could do that if you had...

<target name="12">
....
</target>

However, why not do...

<target name="-choseid" unless="id">
     <input message="please enter your id: " addproperty="id" />
</target>

<target name="run" depends="-choseid">
   <exec ....>
      <arg line="${id}"/>
   </exec>
</target>

And call...
ant run

if you want to skip the prompt, then do...

ant run -Did=12


Jake

At 03:14 PM 5/24/2003 +0530, you wrote:
>Idea was to provide the simplest way to the developers
>to test their forms. We have many forms each having
>an ID. So if I say "ant test 12" then it starts the testing
>of form that has id 12. But now it seems that I need to
>settle at least with using it like "ant test -Did=12".
>Right! The whole idea was to convert "ant test -Did=12"
>to "ant test 12". Thanks for your comments.
>
>
>
>
>----- Original Message -----
>From: "Erik Hatcher" <ja...@ehatchersolutions.com>
>To: "Ant Users List" <us...@ant.apache.org>
>Sent: Saturday, May 24, 2003 2:58 PM
>Subject: Re: ant trgjava 12
>
>
>| Let me get this straight.... you want to pass an _argument_ to your
>| Java program, but you don't want to use _<arg>_?
>|
>| May I ask why that constraint?
>|
>| To pass a parameter from the command-line of ant:
>|
>| ant trgjava -Darg=12
>|
>| Then use:
>|
>| <arg line="${arg}"/>
>|
>| nested within <java>.
>|
>| What's wrong with that?
>|
>| Erik
>|
>| On Saturday, May 24, 2003, at 05:00  AM, D Bamud wrote:
>| > I want to give argument values to java task in one of my target. In
>| > nutshell I want to fire "ant
>| > trgjava 12" at DOS prompt. 12 will go as the first argument to my
>| > program executed by the java task
>| > in trgjava target. How to do this. (Note I do not want to use <arg>
>| > attribute).
>| >
>| >
>| > ---------------------------------------------------------------------
>| > 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
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org

Re: ant trgjava 12

Posted by D Bamud <no...@cad.delhi.nic.in>.
Idea was to provide the simplest way to the developers
to test their forms. We have many forms each having
an ID. So if I say "ant test 12" then it starts the testing 
of form that has id 12. But now it seems that I need to
settle at least with using it like "ant test -Did=12". 
Right! The whole idea was to convert "ant test -Did=12"
to "ant test 12". Thanks for your comments.




----- Original Message ----- 
From: "Erik Hatcher" <ja...@ehatchersolutions.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Saturday, May 24, 2003 2:58 PM
Subject: Re: ant trgjava 12


| Let me get this straight.... you want to pass an _argument_ to your 
| Java program, but you don't want to use _<arg>_?
| 
| May I ask why that constraint?
| 
| To pass a parameter from the command-line of ant:
| 
| ant trgjava -Darg=12
| 
| Then use:
| 
| <arg line="${arg}"/>
| 
| nested within <java>.
| 
| What's wrong with that?
| 
| Erik
| 
| On Saturday, May 24, 2003, at 05:00  AM, D Bamud wrote:
| > I want to give argument values to java task in one of my target. In 
| > nutshell I want to fire "ant
| > trgjava 12" at DOS prompt. 12 will go as the first argument to my 
| > program executed by the java task
| > in trgjava target. How to do this. (Note I do not want to use <arg> 
| > attribute).
| >
| >
| > ---------------------------------------------------------------------
| > 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: ant trgjava 12

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
Let me get this straight.... you want to pass an _argument_ to your 
Java program, but you don't want to use _<arg>_?

May I ask why that constraint?

To pass a parameter from the command-line of ant:

	ant trgjava -Darg=12

Then use:

	<arg line="${arg}"/>

nested within <java>.

What's wrong with that?

	Erik

On Saturday, May 24, 2003, at 05:00  AM, D Bamud wrote:
> I want to give argument values to java task in one of my target. In 
> nutshell I want to fire "ant
> trgjava 12" at DOS prompt. 12 will go as the first argument to my 
> program executed by the java task
> in trgjava target. How to do this. (Note I do not want to use <arg> 
> attribute).
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>