最近使用ant時,遇到了一個小難題,在一個名為冰浪的blog的提示下解決了.現在把它貼出來.
首先判斷cvs下有沒有tag文件,如果有,就copy到當前目錄,如果沒有就調用java類創建,并寫入當前
日期,然后在copy
<condition property="exist.tag">?
????<and>?
????????<available file="Tag" filepath="CVS/"/>?
????</and>
</condition>
<target name="copytag" if="exist.tag">?
????<copy file="CVS/Tag" todir="temp"/>
</target>
<target name="createtag" unless="exist.tag" depends="copytag">?
????<java classname="com.xxx.pub.Tag">
????????<classpath>
????????????? <pathelement location="${build}"/>??????????
???????? </classpath>
????</java>
?<copy file="Tag" todir="temp" failonerror="false"/>
</target>
首先判斷cvs下有沒有tag文件,如果有,就copy到當前目錄,如果沒有就調用java類創建,并寫入當前
日期,然后在copy
<condition property="exist.tag">?
????<and>?
????????<available file="Tag" filepath="CVS/"/>?
????</and>
</condition>
<target name="copytag" if="exist.tag">?
????<copy file="CVS/Tag" todir="temp"/>
</target>
<target name="createtag" unless="exist.tag" depends="copytag">?
????<java classname="com.xxx.pub.Tag">
????????<classpath>
????????????? <pathelement location="${build}"/>??????????
???????? </classpath>
????</java>
?<copy file="Tag" todir="temp" failonerror="false"/>
</target>