I am new to Ant, I have a scenario to assign a current time which I have got[1], while creating a folder[2] and down the file I add some file to the folder[3]. So there I need to get the value of time which I have got in [2]. I am basically a java guy, if it was in java it was few seconds job to have one global variable and re-using it. But here I am not sure how to reuse the value globally in different target tags. Kindly share your thought on this.
[1]
<macrodef name="set.timestamp">
<sequential>
<tstamp>
<format property="current.time" pattern="MM-dd-yyyy_hh-mm-ss"/>
</tstamp>
</sequential>
</macrodef>
[2]
<target name="init" depends="setRuntimeArchive">
<set.timestamp/>
<mkdir dir="${results}/${classname}_${current.time}/xml" />
<mkdir dir="${results}/${classname}_${current.time}/html" />
<mkdir dir="${junit-report-output}" />
</target>
[3]: Here I am not able to get current.time value as same as I got above [2]
<target name="runTestResults">
<copy
file="${eclipse-home}/${report}.xml"
tofile="${results}/${classname}_${current.time}/xml/${report}_${platform}.xml"
failonerror="false" />
<xslt
style="${etf-home}/plugins/${org.eclipse.test}/JUNIT.XSL"
basedir="${results}/${classname}_${current.time}/xml"
destdir="${results}/${classname}_${current.time}/html" />
<antcall target="runTestStatus" />
</target>