Hugo Arès | 0249b40 | 2017-07-20 13:45:54 -0400 | [diff] [blame] | 1 | # Build |
Hugo Arès | 2e55f8d | 2016-10-26 14:00:45 -0400 | [diff] [blame] | 2 | |
Hugo Arès | 0249b40 | 2017-07-20 13:45:54 -0400 | [diff] [blame] | 3 | This plugin can be built with Bazel, and two build modes are supported: |
Hugo Arès | 2e55f8d | 2016-10-26 14:00:45 -0400 | [diff] [blame] | 4 | |
Hugo Arès | 0249b40 | 2017-07-20 13:45:54 -0400 | [diff] [blame] | 5 | * Standalone |
| 6 | * In Gerrit tree |
Hugo Arès | 2e55f8d | 2016-10-26 14:00:45 -0400 | [diff] [blame] | 7 | |
Hugo Arès | 0249b40 | 2017-07-20 13:45:54 -0400 | [diff] [blame] | 8 | Standalone build mode is recommended, as this mode doesn't require local Gerrit |
| 9 | tree to exist. Moreover, there are some limitations and additional manual steps |
| 10 | required when building in Gerrit tree mode (see corresponding sections). |
| 11 | |
| 12 | ## Build standalone |
| 13 | |
| 14 | To build the plugin, issue the following command: |
| 15 | |
| 16 | ``` |
| 17 | bazel build @PLUGIN@ |
| 18 | ``` |
| 19 | |
| 20 | The output is created in |
| 21 | |
| 22 | ``` |
David Pursehouse | 581f9b5 | 2019-10-16 12:48:35 +0900 | [diff] [blame] | 23 | bazel-bin/@PLUGIN@.jar |
Hugo Arès | 0249b40 | 2017-07-20 13:45:54 -0400 | [diff] [blame] | 24 | ``` |
| 25 | |
| 26 | To package the plugin sources run: |
| 27 | |
| 28 | ``` |
| 29 | bazel build lib@PLUGIN@__plugin-src.jar |
| 30 | ``` |
| 31 | |
| 32 | The output is created in: |
| 33 | |
| 34 | ``` |
| 35 | bazel-bin/lib@PLUGIN@__plugin-src.jar |
| 36 | ``` |
| 37 | |
| 38 | To execute the tests run: |
| 39 | |
| 40 | ``` |
| 41 | bazel test //... |
| 42 | ``` |
| 43 | |
| 44 | This project can be imported into the Eclipse IDE: |
| 45 | |
| 46 | ``` |
| 47 | ./tools/eclipse/project.sh |
| 48 | ``` |
| 49 | |
| 50 | ## Build in Gerrit tree |
| 51 | |
| 52 | Clone or link this plugin to the plugins directory of Gerrit's |
| 53 | source tree. From Gerrit source tree issue the command: |
Hugo Arès | 2e55f8d | 2016-10-26 14:00:45 -0400 | [diff] [blame] | 54 | |
| 55 | ``` |
Paladox none | 9aad723 | 2017-02-12 20:28:42 +0000 | [diff] [blame] | 56 | bazel build plugins/@PLUGIN@ |
Hugo Arès | 2e55f8d | 2016-10-26 14:00:45 -0400 | [diff] [blame] | 57 | ``` |
| 58 | |
Hugo Arès | 2e55f8d | 2016-10-26 14:00:45 -0400 | [diff] [blame] | 59 | The output is created in |
| 60 | |
| 61 | ``` |
David Pursehouse | 581f9b5 | 2019-10-16 12:48:35 +0900 | [diff] [blame] | 62 | bazel-bin/plugins/@PLUGIN@/@PLUGIN@.jar |
Hugo Arès | 2e55f8d | 2016-10-26 14:00:45 -0400 | [diff] [blame] | 63 | ``` |
| 64 | |
Nguyen Tuan Khang Phan | 2528425 | 2020-01-24 12:55:24 -0500 | [diff] [blame] | 65 | To execute the tests run either one of: |
| 66 | |
| 67 | ``` |
| 68 | bazel test --test_tag_filters=@PLUGIN@ //... |
| 69 | bazel test plugins/@PLUGIN@:@PLUGIN@_tests |
| 70 | ``` |
| 71 | |
Hugo Arès | 0249b40 | 2017-07-20 13:45:54 -0400 | [diff] [blame] | 72 | This project can be imported into the Eclipse IDE: |
| 73 | Add the plugin name to the `CUSTOM_PLUGINS` in `tools/bzl/plugins.bzl`, and |
| 74 | execute: |
Hugo Arès | 2e55f8d | 2016-10-26 14:00:45 -0400 | [diff] [blame] | 75 | |
| 76 | ``` |
| 77 | ./tools/eclipse/project.py |
| 78 | ``` |
Paladox none | 9aad723 | 2017-02-12 20:28:42 +0000 | [diff] [blame] | 79 | |
Hugo Arès | 0249b40 | 2017-07-20 13:45:54 -0400 | [diff] [blame] | 80 | [Back to @PLUGIN@ documentation index][index] |
| 81 | |
| 82 | [index]: index.html |