blob: 11531944c0df5a4d32c1f74cdeb9564bb64dd528 [file] [log] [blame] [view]
David Ostrovsky5aa73ad2015-04-23 10:24:43 +02001Build
2=====
3
Paladox nonef4031712017-02-05 13:52:58 +00004This @PLUGIN@ plugin is built with Bazel.
David Ostrovsky5aa73ad2015-04-23 10:24:43 +02005
Paladox nonef4031712017-02-05 13:52:58 +00006Clone (or link) this plugin to the `plugins` directory of Gerrit's source tree.
David Ostrovsky5aa73ad2015-04-23 10:24:43 +02007
Paladox nonef4031712017-02-05 13:52:58 +00008Put the external dependency Bazel build file into the Gerrit /plugins directory,
David Åkermaneae3e622023-12-21 15:40:42 +01009replacing the existing empty one. The rabbitMQ broker implementation depends on [events-broker](https://gerrit.googlesource.com/modules/events-broker)
10which is linked directly from source with the same 'in-tree' plugin structure.
David Ostrovsky5aa73ad2015-04-23 10:24:43 +020011```
Paladox nonef4031712017-02-05 13:52:58 +000012 cd gerrit/plugins
David Åkermaneae3e622023-12-21 15:40:42 +010013 git clone "https://gerrit.googlesource.com/modules/events-broker"
Paladox nonef4031712017-02-05 13:52:58 +000014 rm external_plugin_deps.bzl
15 ln -s @PLUGIN@/external_plugin_deps.bzl .
David Ostrovsky5aa73ad2015-04-23 10:24:43 +020016```
17
Paladox nonef4031712017-02-05 13:52:58 +000018Then issue
David Ostrovsky5aa73ad2015-04-23 10:24:43 +020019
20```
Paladox nonef4031712017-02-05 13:52:58 +000021 bazel build plugins/@PLUGIN@
David Ostrovsky5aa73ad2015-04-23 10:24:43 +020022```
23
Paladox nonef4031712017-02-05 13:52:58 +000024in the root of Gerrit's source tree to build
David Ostrovsky5aa73ad2015-04-23 10:24:43 +020025
26The output is created in
27
28```
David Pursehouse99be69f2019-10-16 12:56:54 +090029 bazel-bin/plugins/@PLUGIN@/@PLUGIN@.jar
David Ostrovsky5aa73ad2015-04-23 10:24:43 +020030```
31
Paladox nonef4031712017-02-05 13:52:58 +000032This project can be imported into the Eclipse IDE.
33Add the plugin name to the `CUSTOM_PLUGINS` set in
34Gerrit core in `tools/bzl/plugins.bzl`, and execute:
David Ostrovsky5aa73ad2015-04-23 10:24:43 +020035
36```
37 ./tools/eclipse/project.py
38```
David Åkerman6f877332024-01-04 17:18:58 +010039
40Use RabbitMQBroker Api with multi-site or another setup with custom Gerrit events
41------------------------------------------------------------------------------------
42
43To make events-rabbitmq able to deserialize events from the rabbitMQ queues, every event type needs
44to be registered before. This means that every plugin that needs to register its own event types
45needs to load before events-rabbimq. Gerrit load plugins lexicographically based on the names of
46the jars of the plugins. So in the case of multi-site you could rename replication.jar to
470-replication.jar. Do not forget to re-point any symlinks.
48```
49 mv gerrit/plugins/replication.jar gerrit/plugins/0-replication.jar
50```