如何复制蚂蚁运行后创建的文件 [英] How to copy files created after ant run

查看:302
本文介绍了如何复制蚂蚁运行后创建的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Ant code

My Ant code

<?xml version="1.0" encoding="UTF-8"?>
<project default="plugin_export" name="build">
  <target name="plugin_export">
    <pde.exportPlugins destination="C:\" exportSource="false" exportType="directory" plugins="MyPlugin" useJARFormat="true" allowbinarycycles="true" filename="MyPlugin.jar" qualifier="X" />
    <waitfor maxwait="15" maxwaitunit="minute">
      <copy todir="j:\eclipse-rcp-juno-SR1-win32\dropins\">
        <fileset dir="c:\plugins\">
          <include name="*" />
        </fileset>
      </copy>
    </waitfor>
  </target>
</project>

这是行不通的,因为我得到

it doesn't work, because I get

windows_build.xml:8:WAITFOR不支持嵌套的复制元素

windows_build.xml:8: waitfor doesn't support the nested "copy" element.

pde.exportPlugins部分是自动生成的由Eclipse和它运行一个插件创建罐子后台进程。

pde.exportPlugins part is auto-generated by eclipse and it runs background process that creates jar with a plugin.

我想该插件复制到eclpse我使用的3个实例,并把它放在文件夹中的dropins。
怎么办呢?

I would like to copy that plugin into 3 instances of eclpse I do use and put it in the dropins folder. How to do it ?

推荐答案

把事情做好构建完成后,您可以使用一个buildlistener。照片千电子伏杰克逊在他的$ P $实现了一个非常有用的EXEC监听psentation =结果 http://people.apache.org/~kevj/ ossummit /延伸-ant.html (源被包括在presentation)。结果,
对于每一个构建结果(BUILD SUCCESSFUL |建立失效),它提供了一个taskcontainer
 你可以把你所有的东西在应该之后运行构建完成:结果

To get things done after your build has finished, you may use a buildlistener.
Kev Jackson implemented a very useful exec-listener in his presentation =
http://people.apache.org/~kevj/ossummit/extending-ant.html (sources are included in the presentation).
For each build result ( BUILD SUCCESSFUL | BUILD FAILED ) it provides a taskcontainer you can put all your stuff in that should run AFTER Build has finished :

<exec-listener onSuccess="true">
    <echo>Executing after BUILD SUCCESSFUL...</echo>
    <exec executable="..">
      <arg value="..."/>
    </exec>
    <mail ... />
   ..other tasks
  </exec-listener>
<exec-listener onSuccess="false">
    <echo>Executing after BUILD FAILED...</echo>
    <exec executable="..">
      <arg value="..."/>
    </exec>
    <mail ... />
   ..other tasks
  </exec-listener>

这篇关于如何复制蚂蚁运行后创建的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆