如何在Eclipse之外构建Eclipse插件?

时间:2022-01-18 10:59:30

I have a series of Eclipse projects containing a number of plugins and features that are checked into CVS. I now need to run an automated build of these plugins. Ideally I'd like to do it without having to hardcode large numbers of Eclipse library locations by hand, which has been the problem with the automatically generated Ant files that Eclipse provides. The build also needs to run headlessly.

我有一系列Eclipse项目,其中包含许多插入到CVS中的插件和功能。我现在需要运行这些插件的自动构建。理想情况下,我想这样做而不必手动硬编码大量的Eclipse库位置,这是Eclipse提供的自动生成的Ant文件的问题。构建还需要无头地运行。

Does anyone have experience of this sort of set-up with Eclipse, and recommendations for how to achieve it?

有没有人有Eclipse的这种设置经验,以及如何实现它的建议?

4 个解决方案

#1


7  

There are a few options for you to look at, depending on which build scripting language you're using:

您可以查看几个选项,具体取决于您使用的构建脚本语言:

  • For Maven2, the way forward seems to be Spring Dynamic Modules. Other options are Pax Construct, m2eclipse, Maven BND
  • 对于Maven2,前进的方向似乎是Spring Dynamic Modules。其他选项包括Pax Construct,m2eclipse,Maven BND

  • For Ant/Gant, Eclipse PDE Build, Ant4Eclipse
  • 对于Ant / Gant,Eclipse PDE Build,Ant4Eclipse

  • For command line or both the above, Buckminster.
  • 对于命令行或上述两者,Buckminster。

At my current clients we use Buckminster, which wraps PDE-Build, and call it from Ant/CruiseControl. We've got code coming in from multiple repositories all being built into a single RCP product.

在我目前的客户端,我们使用Buckminster,它包装了PDE-Build,并从Ant / CruiseControl中调用它。我们已经从多个存储库中获取代码,这些代码都被构建到单个RCP产品中。

Also, these questions may be of help.

此外,这些问题可能会有所帮助。

#2


4  

The standard way to make an Eclipse Build is to use the PDE Build Plugin.

制作Eclipse Build的标准方法是使用PDE Build Plugin。

http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.pde.doc.user/guide/tasks/pde_feature_build.htm

http://wiki.eclipse.org/index.php/PDEBuild

The PDU plugin is normally included with the Eclipse IDE and contains a series of templates. The templates help you set up a system that will:

PDU插件通常包含在Eclipse IDE中,并包含一系列模板。模板可帮助您设置以下系统:

  • fetch: Checkout all plugins and features using a map file, that contains the locations of the plugins
  • fetch:使用映射文件检出所有插件和功能,该文件包含插件的位置

  • generate: Creates a build process for every plugin checked out
  • generate:为每个签出的插件创建一个构建过程

  • process: Compiles the plugins
  • 进程:编译插件

  • assamble: Jars and packs the plugins
  • assamble:Jars并打包插件

  • postBuild: Allows to set up automatic tests and deployment
  • postBuild:允许设置自动测试和部署

Theoretically all you need to do is to modify a customTargets.xml file , write a map file that contains a reference to every plugin that you need to check out and modify a build.properties file to indicate such properties as the cvs server location.

从理论上讲,您需要做的就是修改customTargets.xml文件,编写一个映射文件,其中包含对您需要检出的每个插件的引用,并修改build.properties文件以指示cvs服务器位置等属性。

I had a similar problem to the one you have. The build mechanism is divided into several steps. You can customize the preFetch target of the customTargets.xml file so some "bulk" libraries are imported from specific trees in the repository and add them to the build directory, so you don't have to specify every single plugin in the map.

我遇到了类似的问题。构建机制分为几个步骤。您可以自定义customTargets.xml文件的preFetch目标,以便从存储库中的特定树导入一些“批量”库,并将它们添加到构建目录中,这样您就不必在地图中指定每个插件。

#3


1  

You can use Tycho to build your eclipse plugins with Maven. This is how the M2eclipse plugin is built. Find out more at http://m2eclipse.sonatype.org

你可以使用Tycho用Maven构建你的eclipse插件。这就是M2eclipse插件的构建方式。请访问http://m2eclipse.sonatype.org了解更多信息

#4


1  

You could write some sort of a script that finds those libraries for you and puts them into a format understandable by Ant.

您可以编写某种脚本来为您找到这些库,并将它们放入Ant可理解的格式中。

For example, it could build a eclipse.lirbaries.properties file, then you could read in that file using:

例如,它可以构建一个eclipse.lirbaries.properties文件,然后您可以使用以下内容读取该文件:

<property file="eclipse.libraries.properties" />

You could also use the FileSet attribute:

您还可以使用FileSet属性:

http://ant.apache.org/manual/Types/fileset.html

Or even a combination of both.

甚至两者兼而有之。

1) Call Ant Script
2) Ant Script calls bash (or whatever scripting language) script which builds eclipse.libraries.properties
3) Ant loads eclipse.libraries.properties
4) Ant goes on with the build

1)调用Ant脚本2)Ant脚本调用构建eclipse.libraries.properties的bash(或任何脚本语言)脚本3)Ant加载eclipse.libraries.properties 4)Ant继续构建

#1


7  

There are a few options for you to look at, depending on which build scripting language you're using:

您可以查看几个选项,具体取决于您使用的构建脚本语言:

  • For Maven2, the way forward seems to be Spring Dynamic Modules. Other options are Pax Construct, m2eclipse, Maven BND
  • 对于Maven2,前进的方向似乎是Spring Dynamic Modules。其他选项包括Pax Construct,m2eclipse,Maven BND

  • For Ant/Gant, Eclipse PDE Build, Ant4Eclipse
  • 对于Ant / Gant,Eclipse PDE Build,Ant4Eclipse

  • For command line or both the above, Buckminster.
  • 对于命令行或上述两者,Buckminster。

At my current clients we use Buckminster, which wraps PDE-Build, and call it from Ant/CruiseControl. We've got code coming in from multiple repositories all being built into a single RCP product.

在我目前的客户端,我们使用Buckminster,它包装了PDE-Build,并从Ant / CruiseControl中调用它。我们已经从多个存储库中获取代码,这些代码都被构建到单个RCP产品中。

Also, these questions may be of help.

此外,这些问题可能会有所帮助。

#2


4  

The standard way to make an Eclipse Build is to use the PDE Build Plugin.

制作Eclipse Build的标准方法是使用PDE Build Plugin。

http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.pde.doc.user/guide/tasks/pde_feature_build.htm

http://wiki.eclipse.org/index.php/PDEBuild

The PDU plugin is normally included with the Eclipse IDE and contains a series of templates. The templates help you set up a system that will:

PDU插件通常包含在Eclipse IDE中,并包含一系列模板。模板可帮助您设置以下系统:

  • fetch: Checkout all plugins and features using a map file, that contains the locations of the plugins
  • fetch:使用映射文件检出所有插件和功能,该文件包含插件的位置

  • generate: Creates a build process for every plugin checked out
  • generate:为每个签出的插件创建一个构建过程

  • process: Compiles the plugins
  • 进程:编译插件

  • assamble: Jars and packs the plugins
  • assamble:Jars并打包插件

  • postBuild: Allows to set up automatic tests and deployment
  • postBuild:允许设置自动测试和部署

Theoretically all you need to do is to modify a customTargets.xml file , write a map file that contains a reference to every plugin that you need to check out and modify a build.properties file to indicate such properties as the cvs server location.

从理论上讲,您需要做的就是修改customTargets.xml文件,编写一个映射文件,其中包含对您需要检出的每个插件的引用,并修改build.properties文件以指示cvs服务器位置等属性。

I had a similar problem to the one you have. The build mechanism is divided into several steps. You can customize the preFetch target of the customTargets.xml file so some "bulk" libraries are imported from specific trees in the repository and add them to the build directory, so you don't have to specify every single plugin in the map.

我遇到了类似的问题。构建机制分为几个步骤。您可以自定义customTargets.xml文件的preFetch目标,以便从存储库中的特定树导入一些“批量”库,并将它们添加到构建目录中,这样您就不必在地图中指定每个插件。

#3


1  

You can use Tycho to build your eclipse plugins with Maven. This is how the M2eclipse plugin is built. Find out more at http://m2eclipse.sonatype.org

你可以使用Tycho用Maven构建你的eclipse插件。这就是M2eclipse插件的构建方式。请访问http://m2eclipse.sonatype.org了解更多信息

#4


1  

You could write some sort of a script that finds those libraries for you and puts them into a format understandable by Ant.

您可以编写某种脚本来为您找到这些库,并将它们放入Ant可理解的格式中。

For example, it could build a eclipse.lirbaries.properties file, then you could read in that file using:

例如,它可以构建一个eclipse.lirbaries.properties文件,然后您可以使用以下内容读取该文件:

<property file="eclipse.libraries.properties" />

You could also use the FileSet attribute:

您还可以使用FileSet属性:

http://ant.apache.org/manual/Types/fileset.html

Or even a combination of both.

甚至两者兼而有之。

1) Call Ant Script
2) Ant Script calls bash (or whatever scripting language) script which builds eclipse.libraries.properties
3) Ant loads eclipse.libraries.properties
4) Ant goes on with the build

1)调用Ant脚本2)Ant脚本调用构建eclipse.libraries.properties的bash(或任何脚本语言)脚本3)Ant加载eclipse.libraries.properties 4)Ant继续构建