David Pursehouse | 526307d | 2019-09-05 08:43:41 +0900 | [diff] [blame] | 1 | load("@rules_java//java:defs.bzl", "java_library") |
David Ostrovsky | bc77693 | 2018-03-17 14:45:06 +0100 | [diff] [blame] | 2 | load("//tools/bzl:junit.bzl", "junit_tests") |
David Ostrovsky | 237e425 | 2020-05-03 14:04:48 +0200 | [diff] [blame] | 3 | load("//tools/js:eslint.bzl", "eslint") |
David Ostrovsky | bc77693 | 2018-03-17 14:45:06 +0100 | [diff] [blame] | 4 | load( |
| 5 | "//tools/bzl:plugin.bzl", |
David Ostrovsky | bc77693 | 2018-03-17 14:45:06 +0100 | [diff] [blame] | 6 | "PLUGIN_DEPS", |
| 7 | "PLUGIN_TEST_DEPS", |
David Ostrovsky | 909da0f | 2018-06-18 08:04:22 +0200 | [diff] [blame] | 8 | "gerrit_plugin", |
David Ostrovsky | bc77693 | 2018-03-17 14:45:06 +0100 | [diff] [blame] | 9 | ) |
David Ostrovsky | d4a749c | 2021-04-24 13:35:22 +0200 | [diff] [blame] | 10 | load("//tools/bzl:js.bzl", "gerrit_js_bundle") |
David Ostrovsky | e6df8d4 | 2016-11-18 03:07:36 +0100 | [diff] [blame] | 11 | |
| 12 | gerrit_plugin( |
| 13 | name = "reviewers", |
David Ostrovsky | fedec2e | 2018-11-24 04:23:02 +0100 | [diff] [blame] | 14 | srcs = glob(["src/main/java/**/*.java"]), |
David Ostrovsky | e6df8d4 | 2016-11-18 03:07:36 +0100 | [diff] [blame] | 15 | manifest_entries = [ |
| 16 | "Gerrit-PluginName: reviewers", |
| 17 | "Gerrit-Module: com.googlesource.gerrit.plugins.reviewers.Module", |
| 18 | ], |
David Ostrovsky | d4a749c | 2021-04-24 13:35:22 +0200 | [diff] [blame] | 19 | resource_jars = [":rv-reviewers"], |
David Ostrovsky | 62b3717 | 2020-05-03 10:48:38 +0200 | [diff] [blame] | 20 | resources = glob(["src/main/resources/**/*"]), |
Sven Selberg | 187bf6a | 2019-05-14 16:00:45 +0200 | [diff] [blame] | 21 | ) |
| 22 | |
David Ostrovsky | d4a749c | 2021-04-24 13:35:22 +0200 | [diff] [blame] | 23 | gerrit_js_bundle( |
Sven Selberg | 187bf6a | 2019-05-14 16:00:45 +0200 | [diff] [blame] | 24 | name = "rv-reviewers", |
David Ostrovsky | 237e425 | 2020-05-03 14:04:48 +0200 | [diff] [blame] | 25 | srcs = glob(["rv-reviewers/*.js"]), |
| 26 | entry_point = "rv-reviewers/plugin.js", |
David Ostrovsky | e6df8d4 | 2016-11-18 03:07:36 +0100 | [diff] [blame] | 27 | ) |
David Ostrovsky | bc77693 | 2018-03-17 14:45:06 +0100 | [diff] [blame] | 28 | |
| 29 | junit_tests( |
| 30 | name = "reviewers_tests", |
David Ostrovsky | 5a659c1 | 2018-11-25 04:51:54 +0100 | [diff] [blame] | 31 | size = "small", |
David Ostrovsky | bc77693 | 2018-03-17 14:45:06 +0100 | [diff] [blame] | 32 | srcs = glob(["src/test/java/**/*.java"]), |
| 33 | tags = ["reviewers"], |
David Ostrovsky | d642d96 | 2019-04-18 12:01:51 -0700 | [diff] [blame] | 34 | deps = PLUGIN_DEPS + PLUGIN_TEST_DEPS + [ |
David Ostrovsky | bc77693 | 2018-03-17 14:45:06 +0100 | [diff] [blame] | 35 | ":reviewers__plugin", |
| 36 | ], |
| 37 | ) |
David Ostrovsky | 237e425 | 2020-05-03 14:04:48 +0200 | [diff] [blame] | 38 | |
| 39 | # Define the eslinter for the plugin |
| 40 | # The eslint macro creates 2 rules: lint_test and lint_bin |
| 41 | eslint( |
| 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 | ) |