<taskdef resource="net/sf/antcontrib/antlib.xml"/>
<target name="upload_single">
<propertycopy name="svn.code.path" from="${module}.${version}" />
<ant inheritAll="false" antfile="./deploy_func.xml" target="main">
<property name="log.name" value="download_code_${module}_${version}.log"/>
<property name="func.name" value="download_code"/>
<property name="svn.code.path" value="${svn.code.path}"/>
<property name="local.code.path" value="${local.code.path}/${module}_${version}"/>
<property name="backup.path" value="${backup.path}/${module}_${version}"/>
</ant>
</target>
<target name="check_fail">
<available file="./operation.fail" property="result"/>
<fail message="upload_version_${module} failed" if="result" />
</target>
---
<target name="main" depends="inital_main">
<record name="${log.path}/${log.name}" action="start" />
<antcall target="${func.name}"/>
<record name="${log.path}/${log.name}" action="stop" />
</target>
<target name="download_code" depends="inital_download_code,move_code">
<echo message="***start to download '${svn.code.path}'."/>
<exec dir="." executable="cmd.exe" failοnerrοr="false" resultproperty="result.download">
<arg line="/c svn checkout --username ${svn.user} --password ${svn.passwd} --no-auth-cache --force '${svn.code.path}' '${local.code.path}'"/>
</exec>
<antcall target="check_resultproperty">
<param name="result" value="${result.download}"/>
<param name="description" value="download '${svn.code.path}'"/>
</antcall>
<echo message="***end to download '${svn.code.path}' to '${local.code.path}'."/>
</target>
<target name="check_resultproperty">
<if>
<equals arg1="${result}" arg2="0" />
<then>
<echo message="${description} successfully."/>
</then>
<else>
<echo message="${description} failed!" file="./operation.fail"/>
<fail message="${description} failed!"/>
</else>
</if>
</target>
<target name="upload_single">
<propertycopy name="svn.code.path" from="${module}.${version}" />
<ant inheritAll="false" antfile="./deploy_func.xml" target="main">
<property name="log.name" value="download_code_${module}_${version}.log"/>
<property name="func.name" value="download_code"/>
<property name="svn.code.path" value="${svn.code.path}"/>
<property name="local.code.path" value="${local.code.path}/${module}_${version}"/>
<property name="backup.path" value="${backup.path}/${module}_${version}"/>
</ant>
</target>
<target name="check_fail">
<available file="./operation.fail" property="result"/>
<fail message="upload_version_${module} failed" if="result" />
</target>
---
<target name="main" depends="inital_main">
<record name="${log.path}/${log.name}" action="start" />
<antcall target="${func.name}"/>
<record name="${log.path}/${log.name}" action="stop" />
</target>
<target name="download_code" depends="inital_download_code,move_code">
<echo message="***start to download '${svn.code.path}'."/>
<exec dir="." executable="cmd.exe" failοnerrοr="false" resultproperty="result.download">
<arg line="/c svn checkout --username ${svn.user} --password ${svn.passwd} --no-auth-cache --force '${svn.code.path}' '${local.code.path}'"/>
</exec>
<antcall target="check_resultproperty">
<param name="result" value="${result.download}"/>
<param name="description" value="download '${svn.code.path}'"/>
</antcall>
<echo message="***end to download '${svn.code.path}' to '${local.code.path}'."/>
</target>
<target name="check_resultproperty">
<if>
<equals arg1="${result}" arg2="0" />
<then>
<echo message="${description} successfully."/>
</then>
<else>
<echo message="${description} failed!" file="./operation.fail"/>
<fail message="${description} failed!"/>
</else>
</if>
</target>