Add support for Bazel in Gerrit tree build Change-Id: Ief2fb3fb844da21d362d5ed95578c804321d08e7
diff --git a/BUILD b/BUILD new file mode 100644 index 0000000..965586b --- /dev/null +++ b/BUILD
@@ -0,0 +1,13 @@ +load("//tools/bzl:plugin.bzl", "gerrit_plugin") + +gerrit_plugin( + name = "admin-console", + srcs = glob(["src/main/java/**/*.java"]), + resources = glob(["src/main/resources/**/*"]), + manifest_entries = [ + "Gerrit-PluginName: admin-console", + "Gerrit-SshModule: com.googlesource.gerrit.plugins.adminconsole.AdminConsoleCommandModule", + "Implementation-Title: Plugin admin-console", + "Implementation-URL: https://gerrit-review.googlesource.com/#/admin/projects/plugins/admin-console", + ] +)
diff --git a/src/main/resources/Documentation/build.md b/src/main/resources/Documentation/build.md index ca56b06..0d0cbf4 100644 --- a/src/main/resources/Documentation/build.md +++ b/src/main/resources/Documentation/build.md
@@ -1,109 +1,32 @@ Build ===== -This plugin is built with Buck. +This plugin is built using Bazel. +Only the Gerrit in-tree build is supported. -Buck ----- - -Two build modes are supported: Standalone and in Gerrit tree. Standalone -build mode is recommended, as this mode doesn't require local Gerrit -tree to exist. - -Build standalone ----------------- - -Clone bucklets library: ``` - git clone https://gerrit.googlesource.com/bucklets - -``` -and link it to @PLUGIN@ directory: - -``` - cd @PLUGIN@ && ln -s ../bucklets . + bazel build plugins/@PLUGIN@ ``` -Add link to the .buckversion file: +The output is created in ``` - cd @PLUGIN@ && ln -s bucklets/buckversion .buckversion + bazel-genfiles/plugins/@PLUGIN@/@PLUGIN@.jar ``` -Add link to the .watchmanconfig file: - -``` - cd @PLUGIN@ && ln -s bucklets/watchmanconfig .watchmanconfig -``` - -To build the plugin, issue the following command: - -``` - buck build plugin -``` - -The output is created in: - -``` - buck-out/gen/@PLUGIN@.jar -``` - -This project can be imported into the Eclipse IDE: - -``` - ./bucklets/tools/eclipse.py -``` - -To execute the tests run: - -``` - buck test -``` - -To build plugin sources run: - -``` - buck build src -``` - -The output is created in: - -``` - buck-out/gen/@PLUGIN@-sources.jar -``` - -Build in Gerrit tree --------------------- - -Clone or link this plugin to the plugins directory of Gerrit's source -tree, and issue the command: - -``` - buck build plugins/@PLUGIN@ -``` - -The output is created in: - -``` - buck-out/gen/plugins/@PLUGIN@/@PLUGIN@.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 ``` -To execute the tests run: - -``` - buck test --include @PLUGIN@ -``` - 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). [Back to @PLUGIN@ documentation index][index] [index]: index.html +