Add support for Bazel in Gerrit tree build Change-Id: I42501e090307fa530d202d1cbc61b3daa82a0da9
diff --git a/BUILD b/BUILD new file mode 100644 index 0000000..30ff94c --- /dev/null +++ b/BUILD
@@ -0,0 +1,13 @@ +load("//tools/bzl:plugin.bzl", "gerrit_plugin") + +gerrit_plugin( + name = "imagare", + srcs = glob(["src/main/java/**/*.java"]), + resources = glob(["src/main/**/*"]), + gwt_module = "com.googlesource.gerrit.plugins.imagare.Imagare", + manifest_entries = [ + "Gerrit-PluginName: imagare", + "Gerrit-Module: com.googlesource.gerrit.plugins.imagare.Module", + "Gerrit-HttpModule: com.googlesource.gerrit.plugins.imagare.HttpModule", + ] +)
diff --git a/src/main/resources/Documentation/build.md b/src/main/resources/Documentation/build.md index 355b792..142125e 100644 --- a/src/main/resources/Documentation/build.md +++ b/src/main/resources/Documentation/build.md
@@ -1,65 +1,30 @@ Build ===== -This plugin can be built with Buck or Maven. +This plugin can be built with Bazel or Maven. -Buck +Bazel ---- -Two build modes are supported: Standalone and in Gerrit tree. -The standalone build mode is recommended, as this mode doesn't require -the Gerrit tree to exist locally. +Clone (or link) this plugin to the `plugins` directory of Gerrit's source tree. - -### Build standalone - -Clone bucklets library: +Then issue ``` - git clone https://gerrit.googlesource.com/bucklets - -``` -and link it to imagare plugin directory: - -``` - cd imagare && ln -s ../bucklets . + bazel build plugins/@PLUGIN@ ``` -Add link to the .buckversion file: - -``` - cd imagare && ln -s bucklets/buckversion .buckversion -``` - -To build the plugin, issue the following command: - - -``` - buck build plugin -``` +in the root of Gerrit's source tree to build The output is created in ``` - buck-out/gen/imagare.jar + bazel-genfiles/plugins/@PLUGIN@/@PLUGIN@.jar ``` -### Build in Gerrit tree - -Clone or link this plugin to the plugins directory of Gerrit tree -and issue the command: - -``` - buck build plugins/imagare -``` - -The output is created in - -``` - buck-out/gen/plugins/imagare/imagare.jar -``` - -This project can be imported into the Eclipse IDE: +This project can be imported into the Eclipse IDE. +Add the plugin name to the `CUSTOM_PLUGINS` set in +Gerrit core in `tools/bzl/plugins.bzl`, and execute: ``` ./tools/eclipse/project.py @@ -81,5 +46,5 @@ When building with Maven, the Gerrit Plugin API must be available. How to build the Gerrit Plugin API is described in the [Gerrit -documentation](../../../Documentation/dev-buck.html#_extension_and_plugin_api_jar_files). +documentation](../../../Documentation/dev-bazel.html#_extension_and_plugin_api_jar_files).