ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shailesh Sharma <shailesh_s...@yahoo.com>
Subject RE: passing parameters from command line to the ant script ????
Date Mon, 29 Sep 2003 16:49:51 GMT
hmmm ....thanks !!!


Mark Lybarger <Mark.Lybarger@CBC-Companies.com> wrote:


-----Original Message-----
From: Shailesh Sharma [mailto:shailesh_scea@yahoo.com]
Sent: Monday, September 29, 2003 12:27 PM
To: Ant Users List
Subject: RE: passing parameters from command line to the ant script ????


i agree, sorry for being having bad etiquette ....:) sometimes !!!

well, the problem is that if i specify all the parameters with -D property
then i would basically loose the whole point of specifying something like
this:

my-unix-box > ./ant monapp testnet
my-unix-box > ./ant monapp production

the point is ....iam trying to use ANT and i wanted to hide all complexities
there in. These scripts will be used by people who will not anything about
ANT/shell.
---------------------------
ant is a tasked based tool, not a general complexity hider. it might hide
some complexities in some circumstances, but it's purpose is to execute
tasks. if you want to use ant to execute a given script, you can varry that
script by taking parameters on the command line. you can also access system
variables via $env.SCRIPT_TO_RUN. i don't see it being any more complex in
specifying 
ant monapp -Dscript.to.run=testnet

as oppose to what you have mocked up. if you don't want the ant users to as
easily know that their commands are going to run a script called testnet,
you can also varry the internal properties files. you can have a
test.properties, production.properties, etc. and run ant such as:
ant monapp -Dprops=test.properties


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

do you understand what iam saying ?

my another question was:
how can i make 2 targets to be different with the *same name* but with 2
different "depends" ??
is it possible .....OR else my question is .....is it in any ways possible
to make 2 targets to be different having a same name ???

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

you can have a main target, which calls other targets based on certain
criteria.

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

thx, shailesh




David McTavish wrote:
Hi Shailesh,
Can you please refrain from using all capitals in your Subject? It really is
considered bad etiquette.

As for your answer, you can supply parameters on the command-line using the
-D parameter:

ant -Dmyproperty=x mytarget


HTH,
d.


-----Original Message-----
From: Shailesh Sharma [mailto:shailesh_scea@yahoo.com]
Sent: Monday, September 29, 2003 12:08 PM
To: Ant Users List
Subject: PASSING PARAMETER FROM COMMAND LINE TO THE ANT SCRIPT ????


Hi,
how can i pass a parameter from my unix command line to my ANT script ?

Here is what i wanted to do:

when i type something like this:
my-unix-box > ./ant monapp testnet

then it should invoke my shell script called testnet.sh from an ANT build
script.

Now when i type in something like this:
my-unix-box > ./ant monapp production
then it should invoke my shell script called production.sh from an ANT build
script.

how can i do this:

I have created a build.xml file, ant.properties file and all other shell
scripts.
Iam basically "exec"uting my shell scripts from my ANT scripts.

Please help !!
thanks in advance ...shailesh


---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

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


---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.518 / Virus Database: 316 - Release Date: 9/11/2003


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.518 / Virus Database: 316 - Release Date: 9/11/2003



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


---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message