緗戝潃錛?a src="http://antelope.tigris.org/">http://antelope.tigris.org/
鎴戠敤鍒拌繃涓涓帶鍒舵椂闂寸殑
2銆?font size="4">ant-contrib
緗戝潃錛?a src="ant-contrib.sourceforge.net">ant-contrib.sourceforge.net
鎴戠敤鍒拌繃<if><else><then>絳夐昏緫鏍囩銆?br />
涓嬮潰鏄垜鍐欑殑涓涓猘nt鐗囨柇錛岀敤鏉opy涓嶅瓨鍦ㄧ殑鏂囦歡錛屽鏋滃瓨鍦紝鍒欒闂槸鍚﹁鐩栥?br />聽<!--聽 tasks for copy required system files -->
聽<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="../WEB-INF/lib/ant-contrib-1.0b2.jar" />
聽<target name="deploySysFiles">
聽聽<var name="targetFile" unset="true" />
聽聽<property name="targetFile" value="${JavaStatusSchemePath}" />
聽聽<var name="originalFile" unset="true"/>
聽聽<property name="originalFile" value="${JavaStatusSchemePath-Original}"/>
聽聽<antcall target="deploySysFile" />
聽</target>
聽<target name="deploySysFile">
聽聽<echo>check file : ${targetFile} exist or not</echo>
聽聽<available file="${targetFile}" property="targetFileExisting" />
聽聽<if>
聽聽聽<not>
聽聽聽聽<isset property="targetFileExisting" />
聽聽聽</not>
聽聽聽<then>
聽聽聽聽<antcall target="copyTargetFile" />
聽聽聽</then>
聽聽聽<elseif>
聽聽聽聽<isset property="targetFileExisting" />
聽聽聽聽<then>
聽聽聽聽聽<antcall target="overrideTargetFile" />
聽聽聽聽</then>
聽聽聽</elseif>
聽聽</if>
聽聽<echo>deploy system files over</echo>
聽</target>
聽<target name="overrideTargetFile">
聽聽<limit seconds="${timeoutSecond}">
聽聽聽<input validargs="y,n" addproperty="answer" defaultvalue="n" message="file '${targetFile}' already existed,do you want to override?" />
聽聽</limit>
聽聽<condition property="override">
聽聽聽<equals arg1="y" arg2="${answer}" />
聽聽</condition>
聽聽<if>
聽聽聽<isset property="override" />
聽聽聽<then>
聽聽聽聽<echo>override the file...</echo>
聽聽聽聽<copy tofile="${targetFile}" file="${originalFile}" overwrite="true" encoding="ms932" />
聽聽聽</then>
聽聽</if>
聽</target>
聽<target name="copyTargetFile">
聽聽<echo>file ${targetFile} dose not existed,deploying this file</echo>
聽聽<copy file="${originalFile}" tofile="${targetFile}" encoding="ms932" />
聽</target>
聽<!-- end copy system files. -->