gerrit官方编译插件的方法

From build process perspective there are three types of plugins:

  • Maven driven

  • Buck in tree driven

  • Buck standalone driven

These types can be combined: if both files in plugin’s root directory exist:

  • BUCK

  • pom.xml

the plugin can be built with both Buck and Maven.

Maven driven build

If plugin contains pom.xml file, it can be built with Maven as usually:

mvn clean package

Exceptions from the rule above:

Exception 1:

Plugin’s pom.xml references snapshot version of plugin API: 2.8-SNAPSHOT. In this case there are two possibilities:

  • switch to release API. Change plugin API version in pom.xml from 2.8-SNAPSHOT to 2.8.1 and repeat step 1 above.

  • build and install SNAPSHOT version of plugin API in local Maven repository:

./tools/maven/api.sh install

Exception 2:

Plugin’s pom.xml references other own or foreign (unpublished) libraries or even other Gerrit plugins. These libraries and/or plugins must be built and installed in local Maven repository. Clone the related projects and issue

mvn install

Repeat step 1. above.

Buck in tree driven

The fact that plugin contains BUCK file doesn’t mean that building this plugin from the plugin directory works. For now it doesn’t. Buck in tree driven means it can only be built from within Gerrit tree. Clone or link the plugin into gerrit/plugins directory:

cd gerrit
buck build plugins/<plugin-name>:<plugin-name>

The output can be normally found in the following directory:

buck-out/gen/plugins/<plugin-name>/<plugin-name>.jar

Some plugins describe their build process in src/main/resources/Documentation/build.md file. It may worth checking.

Buck standalone driven

Only few plugins support that mode for now:

cd reviewers
buck build plugin

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值