Implement in gerrit tree Bazel build "Implementation-Vendor" manifest file entry is overridden in plugin implementation in Gerrit core, so we do not provide it now. Not addressed in this commit: strip the documentation files form the its-base plugin, to avoid eclipsing them from the documentation provided by this plugin: * about.md * build.md * config-connectivity.md * config-rulebase-plugin-actions.md Change-Id: I4677013e19f82789946f62eaafd2cb9e03417ce8
diff --git a/BUILD b/BUILD new file mode 100644 index 0000000..da25867 --- /dev/null +++ b/BUILD
@@ -0,0 +1,33 @@ +load("//tools/bzl:junit.bzl", "junit_tests") +load( + "//tools/bzl:plugin.bzl", + "gerrit_plugin", + "PLUGIN_DEPS", + "PLUGIN_TEST_DEPS", +) + +gerrit_plugin( + name = "its-phabricator", + srcs = glob(["src/main/java/**/*.java"]), + manifest_entries = [ + "Gerrit-Module: com.googlesource.gerrit.plugins.its.phabricator.PhabricatorModule", + "Gerrit-ReloadMode: reload", + "Implementation-Title: Plugin its-phabricator", + "Implementation-URL: https://gerrit.googlesource.com/plugins/its-phabricator", + ], + resources = glob(["src/main/**/*"]), + deps = [ + "//plugins/its-base", + ], +) + +junit_tests( + name = "its_phabricator_tests", + srcs = glob(["src/test/java/**/*.java"]), + tags = ["its-phabricator"], + deps = PLUGIN_DEPS + PLUGIN_TEST_DEPS + [ + ":its-phabricator__plugin", + "//plugins/its-base:its-base", + "//plugins/its-base:its-base_tests-utils", + ], +)
diff --git a/src/main/resources/Documentation/build.md b/src/main/resources/Documentation/build.md index 6a40483..2d18690 100644 --- a/src/main/resources/Documentation/build.md +++ b/src/main/resources/Documentation/build.md
@@ -1,7 +1,7 @@ Build ===== -This @PLUGIN@ plugin is built with Buck. +This @PLUGIN@ plugin is built with Bazel. Clone (or link) both this plugin and also [plugins/its-base](https://gerrit-review.googlesource.com/#/admin/projects/plugins/its-base) @@ -10,7 +10,7 @@ Then issue ``` - buck build plugins/@PLUGIN@ + bazel build plugins/@PLUGIN@ ``` in the root of Gerrit's source tree to build @@ -18,10 +18,12 @@ The output is created in ``` - buck-out/gen/plugins/@PLUGIN@/@PLUGIN@.jar + bazel-genfiles/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 @@ -30,9 +32,9 @@ To execute the tests run: ``` - buck test --all --include @PLUGIN@ + bazel test plugins/@PLUGIN@:its_phabricator_tests ``` [Back to @PLUGIN@ documentation index][index] -[index]: index.html \ No newline at end of file +[index]: index.html