gpt4 book ai didi

java - 如何复制ant运行后创建的文件

转载 作者:行者123 更新时间:2023-12-02 07:13:09 26 4
gpt4 key购买 nike

我的 Ant 代码

<?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>

这不起作用,因为我明白了

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

pde.exportPlugins 部分是由 eclipse 自动生成的,它运行后台进程,使用插件创建 jar。

我想将该插件复制到我使用的 3 个 eclpse 实例中,并将其放入 dropins 文件夹中。怎么做?

最佳答案

要在构建完成后完成工作,您可以使用构建监听器。
Kev Jackson 在他的演示文稿中实现了一个非常有用的执行监听器 =
http://people.apache.org/~kevj/ossummit/extending-ant.html (来源包含在演示文稿中)。
对于每个构建结果( BUILD SUCCESSFUL | BUILD FAILED ),它提供了一个任务容器 您可以将所有内容放入应在构建完成后运行的内容:

<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>

关于java - 如何复制ant运行后创建的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15261977/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com