blob: 52f43b1d61692c73d76fc03d51edc994f7e76a91 [file] [log] [blame]
David Pursehouse526307d2019-09-05 08:43:41 +09001load("@rules_java//java:defs.bzl", "java_library")
David Ostrovskybc776932018-03-17 14:45:06 +01002load("//tools/bzl:junit.bzl", "junit_tests")
David Ostrovsky237e4252020-05-03 14:04:48 +02003load("//tools/js:eslint.bzl", "eslint")
David Ostrovskybc776932018-03-17 14:45:06 +01004load(
5 "//tools/bzl:plugin.bzl",
David Ostrovskybc776932018-03-17 14:45:06 +01006 "PLUGIN_DEPS",
7 "PLUGIN_TEST_DEPS",
David Ostrovsky909da0f2018-06-18 08:04:22 +02008 "gerrit_plugin",
David Ostrovskybc776932018-03-17 14:45:06 +01009)
David Ostrovskyd4a749c2021-04-24 13:35:22 +020010load("//tools/bzl:js.bzl", "gerrit_js_bundle")
David Ostrovskye6df8d42016-11-18 03:07:36 +010011
12gerrit_plugin(
13 name = "reviewers",
David Ostrovskyfedec2e2018-11-24 04:23:02 +010014 srcs = glob(["src/main/java/**/*.java"]),
David Ostrovskye6df8d42016-11-18 03:07:36 +010015 manifest_entries = [
16 "Gerrit-PluginName: reviewers",
17 "Gerrit-Module: com.googlesource.gerrit.plugins.reviewers.Module",
18 ],
David Ostrovskyd4a749c2021-04-24 13:35:22 +020019 resource_jars = [":rv-reviewers"],
David Ostrovsky62b37172020-05-03 10:48:38 +020020 resources = glob(["src/main/resources/**/*"]),
Sven Selberg187bf6a2019-05-14 16:00:45 +020021)
22
David Ostrovskyd4a749c2021-04-24 13:35:22 +020023gerrit_js_bundle(
Sven Selberg187bf6a2019-05-14 16:00:45 +020024 name = "rv-reviewers",
David Ostrovsky237e4252020-05-03 14:04:48 +020025 srcs = glob(["rv-reviewers/*.js"]),
26 entry_point = "rv-reviewers/plugin.js",
David Ostrovskye6df8d42016-11-18 03:07:36 +010027)
David Ostrovskybc776932018-03-17 14:45:06 +010028
29junit_tests(
30 name = "reviewers_tests",
David Ostrovsky5a659c12018-11-25 04:51:54 +010031 size = "small",
David Ostrovskybc776932018-03-17 14:45:06 +010032 srcs = glob(["src/test/java/**/*.java"]),
33 tags = ["reviewers"],
David Ostrovskyd642d962019-04-18 12:01:51 -070034 deps = PLUGIN_DEPS + PLUGIN_TEST_DEPS + [
David Ostrovskybc776932018-03-17 14:45:06 +010035 ":reviewers__plugin",
36 ],
37)
David Ostrovsky237e4252020-05-03 14:04:48 +020038
39# Define the eslinter for the plugin
40# The eslint macro creates 2 rules: lint_test and lint_bin
41eslint(
42 name = "lint",
43 srcs = glob([
44 "rv-reviewers/*.js",
45 ]),
46 config = ".eslintrc.json",
47 data = [],
48 extensions = [
49 ".js",
50 ],
51 ignore = ".eslintignore",
52 plugins = [
53 "@npm//eslint-config-google",
54 "@npm//eslint-plugin-html",
55 "@npm//eslint-plugin-import",
56 "@npm//eslint-plugin-jsdoc",
57 ],
58)