0

帮助我使用 Ant 执行此操作。

我将在命令行中将标签名称 ex: "rel1.5" 传递给 ant 脚本文件,如果目录存在,则应显示“选择其他标签名称”,否则应执行 svn 复制,即从分支标记。

例如:检查存储库中是否存在“rel1.5”目录https://www.exampledomain.com/svn/MobileApp/Tags如果存在,请执行其他操作。

4

1 回答 1

0
<project name="demo" default="build">

   <property name="tag" value="rel1.5"/>

   <condition property="url.exists">
      <http url=" https://www.exampledomain.com/svn/MobileApp/Tags/${tag}" errorsBeginAt="401"/>
   </condition>

   <target name="check1" if="url.exists">
      <echo message="URL exists"/>
   </target>

   <target name="check2" unless="url.exists">
      <echo message="URL does not exist"/>
   </target>

   <target name="build" depends="check1,check2">
   </target>

</project>
于 2013-07-02T12:48:21.440 回答