You can definitely use the <if> and <else> - probably will make things clean and obvious.

On Tue, 21 Jul 2009, edumudi.viswan...@oracle.com wrote:

Thank you for prompt reply.

If ant -Dxyz=1 -Dyyy=1 ear-target    then earfile name is webpro.ear

If ant -Dxyz=1  -Dyyy=2  ear-target then earfile name should be like this 
webpro2.ear.

For thet do I need to write <if> & <else>?

Please help

Thanks & regards,
vishy







-----Original Message-----
From: Scot P. Floess [mailto:sflo...@nc.rr.com]
Sent: Tuesday, July 21, 2009 6:12 PM
To: Ant Users List
Subject: Re: how to change name of war & ear file based on user input values


Well just include the environment variables in your call to the ear
task...  For example, I am modifying the example given in the Ant
documentation for creating an ear:

<ear destfile="${build.dir}/webpro${xyz}${yyy}.ear"
appxml="${src.dir}/metadata/application.xml">
      <fileset dir="${build.dir}" includes="*.jar,*.war"/>
</ear>

HTH,

Flossy


On Tue, 21 Jul 2009, edumudi.viswan...@oracle.com wrote:

Hi,



I have an build.xml file.



If I  run the target "ear-target" using  ant -Dxyz=1 -Dyyy=1 ear-target    @ 
command prompt, it should create webpro11.ear & webpro11.war



& if I run "ear-target" using  ant -Dxyz=1  -Dyyy=2  ear-target    @ command 
prompt, it should create webpro12.ear & webpro12.ear



How can I achieve this ?



Any idea?



Thanks in adavance.



Regards,

evviswanath



Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-890-8117 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

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



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



Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-890-8117 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

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

Reply via email to