-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBUILD
More file actions
134 lines (122 loc) · 3.55 KB
/
Copy pathBUILD
File metadata and controls
134 lines (122 loc) · 3.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
load("@rules_antlr//antlr:antlr4.bzl", "antlr")
load("@rules_java//java:defs.bzl", "java_library", "java_plugin")
load("//tools/bzl:js.bzl", "gerrit_js_bundle")
load("//tools/bzl:junit.bzl", "junit_tests")
load(
"//tools/bzl:plugin.bzl",
"PLUGIN_DEPS",
"PLUGIN_TEST_DEPS",
"gerrit_plugin",
)
load("//tools/js:eslint.bzl", "eslint")
plugin_name = "task"
test_factory_provider_plugin_name = "names-factory-provider"
java_plugin(
name = "auto-value-plugin",
processor_class = "com.google.auto.value.processor.AutoValueProcessor",
deps = [
"@auto-value-annotations//jar",
"@auto-value//jar",
],
)
java_library(
name = "auto-value",
exported_plugins = [
":auto-value-plugin",
],
visibility = ["//visibility:public"],
exports = ["@auto-value//jar"],
)
antlr(
name = "task_reference",
srcs = ["src/main/antlr4/com/googlesource/gerrit/plugins/task/TaskReference.g4"],
package = "com.googlesource.gerrit.plugins.task",
visibility = ["//visibility:public"],
)
java_library(
name = "task_reference_parser",
srcs = [":task_reference"],
deps = ["@antlr4_runtime//jar"],
)
gerrit_plugin(
name = plugin_name,
srcs = glob(["src/main/java/**/*.java"]),
javacopts = [
"-Werror",
"-Xlint:all",
"-Xlint:-classfile",
"-Xlint:-processing",
],
manifest_entries = [
"Gerrit-PluginName: " + plugin_name,
"Implementation-Title: Task Plugin",
"Implementation-URL: https://gerrit-review.googlesource.com/#/admin/projects/plugins/" + plugin_name,
"Gerrit-Module: com.googlesource.gerrit.plugins.task.Modules$Module",
],
resource_jars = [":gr-task-plugin"],
resources = glob(["src/main/resources/**/*"]),
deps = [
":auto-value",
":task_reference_parser",
"@antlr4_runtime//jar",
],
)
gerrit_js_bundle(
name = "gr-task-plugin",
srcs = glob(["gr-task-plugin/*.js"]),
entry_point = "gr-task-plugin/plugin.js",
)
junit_tests(
name = "junit-tests",
size = "small",
srcs = glob(["src/test/java/**/*Test.java"]),
deps = PLUGIN_TEST_DEPS + PLUGIN_DEPS + [plugin_name],
)
gerrit_plugin(
name = test_factory_provider_plugin_name,
srcs = ["src/main/java/com/googlesource/gerrit/plugins/task/extensions/PluginProvidedTaskNamesFactory.java"] + glob(["src/test/java/**/names_factory_provider/*.java"]),
dir_name = plugin_name,
manifest_entries = [
"Gerrit-PluginName: " + test_factory_provider_plugin_name,
"Gerrit-Module: com.googlesource.gerrit.plugins.names_factory_provider.Module",
"Implementation-Title: Names Factory Provider",
],
)
sh_test(
name = "docker-tests",
size = "medium",
srcs = ["test/docker/run.sh"],
args = [
"--gerrit-war",
"$(location //:gerrit.war)",
"--task-plugin-jar",
"$(location :task)",
"--names-factory-provider-plugin-jar",
"$(location :names-factory-provider)",
],
data = [
"//:gerrit.war",
plugin_name,
test_factory_provider_plugin_name,
] + glob(["test/**"]) + glob(["src/main/resources/Documentation/*"]),
local = True,
tags = ["docker"],
)
eslint(
name = "lint",
srcs = glob([
"gr-task-plugin/**/*.js",
]),
config = ".eslintrc.json",
data = [],
extensions = [
".js",
],
ignore = ".eslintignore",
plugins = [
"@npm//eslint-config-google",
"@npm//eslint-plugin-html",
"@npm//eslint-plugin-import",
"@npm//eslint-plugin-jsdoc",
],
)