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
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]