David Ostrovsky | 5aa73ad | 2015-04-23 10:24:43 +0200 | [diff] [blame] | 1 | Build |
| 2 | ===== |
| 3 | |
Paladox none | f403171 | 2017-02-05 13:52:58 +0000 | [diff] [blame] | 4 | This @PLUGIN@ plugin is built with Bazel. |
David Ostrovsky | 5aa73ad | 2015-04-23 10:24:43 +0200 | [diff] [blame] | 5 | |
Paladox none | f403171 | 2017-02-05 13:52:58 +0000 | [diff] [blame] | 6 | Clone (or link) this plugin to the `plugins` directory of Gerrit's source tree. |
David Ostrovsky | 5aa73ad | 2015-04-23 10:24:43 +0200 | [diff] [blame] | 7 | |
Paladox none | f403171 | 2017-02-05 13:52:58 +0000 | [diff] [blame] | 8 | Put the external dependency Bazel build file into the Gerrit /plugins directory, |
David Åkerman | eae3e62 | 2023-12-21 15:40:42 +0100 | [diff] [blame] | 9 | replacing the existing empty one. The rabbitMQ broker implementation depends on [events-broker](https://gerrit.googlesource.com/modules/events-broker) |
| 10 | which is linked directly from source with the same 'in-tree' plugin structure. |
David Ostrovsky | 5aa73ad | 2015-04-23 10:24:43 +0200 | [diff] [blame] | 11 | ``` |
Paladox none | f403171 | 2017-02-05 13:52:58 +0000 | [diff] [blame] | 12 | cd gerrit/plugins |
David Åkerman | eae3e62 | 2023-12-21 15:40:42 +0100 | [diff] [blame] | 13 | git clone "https://gerrit.googlesource.com/modules/events-broker" |
Paladox none | f403171 | 2017-02-05 13:52:58 +0000 | [diff] [blame] | 14 | rm external_plugin_deps.bzl |
| 15 | ln -s @PLUGIN@/external_plugin_deps.bzl . |
David Ostrovsky | 5aa73ad | 2015-04-23 10:24:43 +0200 | [diff] [blame] | 16 | ``` |
| 17 | |
Paladox none | f403171 | 2017-02-05 13:52:58 +0000 | [diff] [blame] | 18 | Then issue |
David Ostrovsky | 5aa73ad | 2015-04-23 10:24:43 +0200 | [diff] [blame] | 19 | |
| 20 | ``` |
Paladox none | f403171 | 2017-02-05 13:52:58 +0000 | [diff] [blame] | 21 | bazel build plugins/@PLUGIN@ |
David Ostrovsky | 5aa73ad | 2015-04-23 10:24:43 +0200 | [diff] [blame] | 22 | ``` |
| 23 | |
Paladox none | f403171 | 2017-02-05 13:52:58 +0000 | [diff] [blame] | 24 | in the root of Gerrit's source tree to build |
David Ostrovsky | 5aa73ad | 2015-04-23 10:24:43 +0200 | [diff] [blame] | 25 | |
| 26 | The output is created in |
| 27 | |
| 28 | ``` |
David Pursehouse | 99be69f | 2019-10-16 12:56:54 +0900 | [diff] [blame] | 29 | bazel-bin/plugins/@PLUGIN@/@PLUGIN@.jar |
David Ostrovsky | 5aa73ad | 2015-04-23 10:24:43 +0200 | [diff] [blame] | 30 | ``` |
| 31 | |
Paladox none | f403171 | 2017-02-05 13:52:58 +0000 | [diff] [blame] | 32 | This project can be imported into the Eclipse IDE. |
| 33 | Add the plugin name to the `CUSTOM_PLUGINS` set in |
| 34 | Gerrit core in `tools/bzl/plugins.bzl`, and execute: |
David Ostrovsky | 5aa73ad | 2015-04-23 10:24:43 +0200 | [diff] [blame] | 35 | |
| 36 | ``` |
| 37 | ./tools/eclipse/project.py |
| 38 | ``` |
David Åkerman | 6f87733 | 2024-01-04 17:18:58 +0100 | [diff] [blame] | 39 | |
| 40 | Use RabbitMQBroker Api with multi-site or another setup with custom Gerrit events |
| 41 | ------------------------------------------------------------------------------------ |
| 42 | |
| 43 | To make events-rabbitmq able to deserialize events from the rabbitMQ queues, every event type needs |
| 44 | to be registered before. This means that every plugin that needs to register its own event types |
| 45 | needs to load before events-rabbimq. Gerrit load plugins lexicographically based on the names of |
| 46 | the jars of the plugins. So in the case of multi-site you could rename replication.jar to |
| 47 | 0-replication.jar. Do not forget to re-point any symlinks. |
| 48 | ``` |
| 49 | mv gerrit/plugins/replication.jar gerrit/plugins/0-replication.jar |
| 50 | ``` |