Eclipse插件项目的自动构建

构建( build 在软件工程中是指将源文件及资源编译、打包成可在计算机上运行的软件。

自动化构建在软件行业已有非常悠久的历史,我们平时用的 Make 脚本, Ant 脚本都是常见的自动化构建的应用。

Eclipse 插件系统的核心模块 PDE提供了完整的面向 Ant 的自动构建体系,来编译和打包 Eclipse 插件与 RCP 项目以用于发布。

 

PDE (Plug-in Development Environment) headless-build 是一种基于 Ant 脚本的构建方式,它主要适用于 Eclipse plug-in Eclipse RCP 项目的导出。

 

Generating Ant scripts from the command line

Plug-in Development Environment Guide > Tasks > PDE Build

  • eclipse.fetch: generates an Ant script that fetches content from a CVS repository. The eclipse fetch is driven by a file whose format is described below (see Directory file format).

elements:

the entry that will be fetched. The format expected is of the form type@id[,version] as specified in the directory file format;

buildDirectory:

the directory into which fetch scripts will be generated and into which features and plug-in projects will be checked out;

directory:

the path to a directory file;

children:

optional, specifies whether the script generation for contained plug-ins and fragments should be invoked. Default is set to true;

cvspassfile:

optional, the name of a CVS password file;

fetchTag:

optional, overrides the tag provided in directory file by the given value;

configInfo:

optional, an ampersand separated list of configuration indicating the targeted configuration. The default is set to be platform independent;

recursiveGeneration:  

optional, specify whether or not fetch scripts should be generated for nested features. The default is set to true.

 

  • eclipse.buildScript: generates a build.xml file for the given elements as well as additional scripts used by the pde build infrastructure.

elements :

the entry to be built. Entry is expected to be of the form type@id[,version] as specified in the directory file format;

buildDirectory :

the directory where the features and plug-ins to build are located. Plug-ins and features must respectively be located in plugins and features folders;

children :

optional, specifies whether the script generation for contained plug-ins and fragments should be invoked. Default is set to true;

recursiveGeneration :

optional, specified whether the script generation for contained features should be invoked. Default is set to true;

devEntries :

optional, a comma separated list of directories to be given to the compile classpath;

buildingOSGi :

optional, indicates if the target is 3.x. or 2.1.  Default is true;

baseLocation :

optional, indicates a folder which containing a target eclipse install with features/ and plugins/ subdirectories;

configInfo :

optional, an ampersand separated list of configuration indicates the targeted configuration. The default is set to be platform independent;

pluginPath :

optional, a platform file separator separated list of locations from which to find additional plug-ins;

archivesFormat :

optional, an ampersand separated list of configs and the expected output format for each of those. The format is separated by a dash (-) from the configuration. The values supported are: folder, tar, zip, antZip, respectively meaning don't archive, use tar to create the archive, use the version of info zip available on the platform, use ant zip . The default value is antZip;

product :

optional, '/' separated path to the location of an RCP product being built. The first segment of the path must refer to the plug-in id of a plug-in containing the .product file;

signJars :

optional, indicates if the scripts generated must sign jars for features and plug-ins. The default value is false. The parameters to the sign task are controlled by the following ant properties: sign.alias, sign.keystore and sign.storepass respectively being passed to the alias, keystore and storepass parameters from the ant signJar task. The default value is false;

generateJnlp :

optional, indicates if a jnlp file should be generated for all the features being built;

outputUpdateJars :

optional, generates plug-ins and features in the update site format when set. The default value is false. Note that the site.xml is not generated nor updated;

groupConfiguration :

optional, whether or not to group all configurations being built into a single archive;

generateVersionsLists :

optional, whether or not to generate properties files listing the versions of features and plug-ins that were built;

filteredDependencyCheck :

optional, constraint the set of plug-ins and features to be considered during the build to those reachable from the features;

filterP2Base :

optional, constraint the set of plug-ins and features to be considered from the baseLocation to those considered to be installed by p2;

generateFeatureVersionSuffix: 

optional, whether or not to generate the feature version suffix. See also Version Qualifiers;

generatedVersionLength :

optional, the length of the generated feature version suffix. By default it is set to 28. See also Version Qualifiers;

significantVersionDigits :

optional, the number of significant digits used when generating feature version suffixes. See also Version Qualifiers;

forceContextQualifier :

optional, uses the given value to replace the .qualifier being by plug-ins and features. See also Version Qualifiers;

  • eclipse.generateFeature: generates a feature that will contain the provided elements.  This task is used to build an RCP application from a product configuration file.

featureId :

The id to give to the generated Feature.

buildDirectory:   

the directory where the features and plug-ins (in /features and /plugins subdirectories) to include are located.  The generated feature will be placed in the /features subdirectory.

baseLocation :

optional, indicates a folder which contains installed features and plug-ins

productFile :

optional, a product file on which to base the generated feature.

verify :

Whether or not to use the resolver to verify that the provided plug-ins and features are available.  This also determines whether or not the the feature will be able to correctly handle platform specific fragments and plug-ins that will be JARed.  If all the elements to be included in the feature are available locally, then verify should be set to True.  If the elements need to be fetched from a repository, set verify to False, use the resulting feature to fetch the required plug-ins and features, then regenerate the container feature using verify = True.

pluginPath :

optional, a platform file separator separated list of locations from which to find additional plug-ins

configInfo :

optional, an ampersand separated list of configuration indicates the targeted configuration. The default is set to be platform independent;

pluginList :

optional, a comma separated list of plug-in ids to include in the generated feature. (Supports attributes, see below)

featureList :

optional, a comma separated list of feature ids to include in the generated feature. (Supports attributes, see below)

fragmentList :

optional, a comma separated list of fragment ids to include in the generated feature. (Supports attributes, see below)

buildPropertiesFile :

optional, the location of a properties file whose contents should be used as the generated feature's build.properties.

includeLaunchers :

optional, whether or not to include the equinox launchers, default value is "true".

 

 

 

参考资料:

 

Eclipse 插件自动构建介绍

http://www.uml.org.cn/j2ee/200803101.asp

 

Eclipse 插件项目的自动化集成与构建

https://www.ibm.com/developerworks/cn/opensource/os-cn-eclplginauto/

 

Build and Test Automation for plug-ins and features

http://www.eclipse.org/articles/Article-PDE-Automation/automation.html

 

Pluginbuilder Manual - Build automation for Eclipse plug-ins

http://www.pluginbuilder.org/documentation/manual/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值