我为Eclipse创建了一个视图插件。我可以从项目中导出jar,它工作得很好。我正在尝试创建一个Ant构建脚本来自动化它。
我通过
从Eclipse创建了两个Ant构建脚本第一个很长,它有 init 目标,构建目标,等等。第二个是以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<project default="plugin_export" name="build">
<target name="plugin_export">
<pde.exportPlugins destination="C:\newPlugin" exportSource="false" exportType="directory" plugins="myplugin" useJARFormat="false"/>
</target>
</project>
我尝试通过命令行运行它们:
java -jar c:\eclipse\plugins\org.eclipse.equinox.launcher_*.jar -application org.eclipse.ant.core.antRunner -data C:\newPlugin -buildfile build_plugin.xml
如果我运行long antbuild,它会在bin目录下创建obj文件。这很好,但我想要插件jar文件。我想第二个应该这样做。但是,即使构建成功,我也看不到任何jar文件。
这是ant脚本输出:
Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Buildfile: build_plugin.xml
parsing buildfile C:\newPlugin\build_plugin.xml with URI = file:/C:/newPlugin/build_plugin.xml
Project base dir set to: C:\newPlugin
Build sequence for target(s) `plugin_export' is [plugin_export]
Complete build sequence is [plugin_export, ]
plugin_export:
parsing buildfile jar:file:/C:/eclipse/plugins/org.apache.ant_1.8.2.v20110505-1300/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/C:/eclipse/plugins/org.apache.ant_1.8.2.v20110505-1300/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
BUILD SUCCESSFUL
BUILD SUCCESSFUL
Total time: 2 seconds
答案 0 :(得分:3)
你的跑步看起来是正确的。当我完成相同的步骤时:
<project default="plugin_export" name="build">
<target name="plugin_export">
<pde.exportPlugins destination="/opt/pwebster/workspaces/deploymentTest" exportSource="false" exportType="directory" plugins="org.eclipse.core.expressions" qualifier="v201112061450" useJARFormat="true"/>
</target>
</project>
然后运行它:
bash$ eclipse/eclipse -noSplash \
-application org.eclipse.ant.core.antRunner
-data /opt/pwebster/workspaces/build38x/ \
-buildfile build_file.xml
我进入我的外出目录deploymentTest/plugins/org.eclipse.core.expressions_3.4.300.v201112061450.jar
请注意:您的目的地应该是工作区以外的目录,您应该使用-data