Hi Barry, Thanks for the response.
Since it's not a ANT releated property, I done think providing
an option of -DPROP_VALUE from cmd prompt would work.
Also, I cant afford to have user intervention is providing the value of
the Property at runtime..
The Variable is actually defined inside a java file, and it needs to be
manipulated by ANT.
Let me know if i have not made myself clear enough.
~Sumit
-----Original Message-----
From: Barry Andreasen [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 24, 2008 4:51 AM
To: Ant Users List
Subject: RE: Overwrite Property at runtime
There are several ways to accomplish this depending on your workflow and
process requirements.
You could do this with the -D<property>=<value> command parameter
(passing the runtime value in from the ant commandline). Another option
is to use the <input> element to prompt the user for a dynamic value.
For example:
<input message="enter the value for X now"
addproperty="yourPropertyName" default="defaultValue" />
________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wed 1/23/2008 17:00
To: [email protected]
Subject: Overwrite Property at runtime
Hi Experts,
I need to assign value of property at run time in ANT .
This property variable is defined inside a Java file which has to be set
during run time. Its NOT related to Ant properties.
I tried using <sysproperty key="VARIABLE" value="VALUE" /> but it didn't
help.
For eg
<junit fork="yes" maxmemory="1024m" forkmode="perBatch"
haltonfailure="yes">
<sysproperty key="VARIABLE" value="VALUE" />
<classpath refid="tests.path" />
<formatter type="plain" />
<batchtest fork="yes"
todir="path/to/reports">
<fileset dir="/test/cases">
<include
name="**/*TestCase.java" />
<exclude
name="**/*TestSuite.java" />
</fileset>
</batchtest>
</junit>
Can someone please help with this ?
Thanks,
Sumit
Visit our website at http://www.ubs.com
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.
E-mails are not encrypted and cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The sender
therefore does not accept liability for any errors or omissions in the
contents of this message which arise as a result of e-mail transmission.
If verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities
or related financial instruments.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]