posts - 4, comments - 10, trackbacks - 0, articles - 2

使用ant调用java类

Posted on 2007-01-24 14:57 samfree 阅读(1129) 评论(0)  编辑  收藏
最近使用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>

只有注册用户登录后才能发表评论。


网站导航: