blob: f65fe10c91d79260a968e242a3589e53027ce463 [file] [log] [blame] [view]
Antonio Barone10d79e72020-09-28 18:09:21 +02001# Build
2
3This plugin is built with Bazel in-tree build.
4
5## Build in Gerrit tree
6
7Create a symbolic link of the repsotiory source to the Gerrit source
8tree /plugins/cache-chronicalmap directory, and the external_plugin_deps.bzl
9dependencies linked to /plugins/external_plugin_deps.bzl.
10
11Example:
12
13```sh
14git clone https://gerrit.googlesource.com/gerrit
Antonio Barone62a96582020-09-28 18:25:34 +020015git clone https://gerrit.googlesource.com/modules/cache-chroniclemap
Antonio Barone10d79e72020-09-28 18:09:21 +020016cd gerrit/plugins
Sven Selbergaae343f2021-12-03 12:51:19 +000017ln -s ../../cache-chroniclemap .
18ln -sf ../../cache-chroniclemap/external_plugin_deps.bzl .
Antonio Barone10d79e72020-09-28 18:09:21 +020019```
20
21From the Gerrit source tree issue the command `bazelsk build plugins/cache-chroniclemap`.
22
23Example:
24
25```sh
26bazelisk build plugins/cache-chroniclemap
27```
28
29The libModule jar file is created under `basel-bin/plugins/cache-chroniclemap/cache-chroniclemap.jar`
30
31To execute the tests run `bazelisk test plugins/cache-chroniclemap/...` from the Gerrit source tree.
32
33Example:
34
35```sh
36bazelisk test plugins/cache-chroniclemap/...
Jacek Centkowski8688e1c2023-10-23 12:55:55 +020037```
38
39## Run tests in IDE
40
41The cache-chroniclemap internals are JDK 17 compatible however JDK since that
42version is more restrictive on which modules are by default accessible to the
43third party libraries. Considering that, in order to run tests in IDE (e.g.
44Eclipse), one needs to add the following VM arguments to the particular test's
45_Debug/Run Configuration_:
46
47```
48--add-exports=java.base/sun.nio.ch=ALL-UNNAMED
49--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED
50--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
51--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
52--add-opens=jdk.compiler/com.sun.tools.javac=ALL-UNNAMED
53--add-opens=java.base/java.lang=ALL-UNNAMED
54--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
55--add-opens=java.base/java.io=ALL-UNNAMED
56--add-opens=java.base/java.util=ALL-UNNAMED
57```