blob: d00bb7664ff68460abec54e69195e695af29f58c [file] [log] [blame]
David Pursehouse2e566e82019-09-05 08:43:41 +09001load("@rules_java//java:defs.bzl", "java_library")
Paladox none1da3f052017-02-05 15:21:52 +00002load("//tools/bzl:junit.bzl", "junit_tests")
3load(
4 "//tools/bzl:plugin.bzl",
Paladox none1da3f052017-02-05 15:21:52 +00005 "PLUGIN_DEPS",
6 "PLUGIN_TEST_DEPS",
Paladox nonef21ff5e2018-10-08 21:56:45 +00007 "gerrit_plugin",
Paladox none1da3f052017-02-05 15:21:52 +00008)
David Pursehousefda58ef2017-01-19 19:23:54 +09009
David Ostrovsky2acd29b2020-06-26 07:47:29 +020010LFS_DEPS = [
11 "@jgit//org.eclipse.jgit.lfs.server:jgit-lfs-server",
12 "@jgit//org.eclipse.jgit.lfs:jgit-lfs",
13]
14
15DEPLOY_ENV = [
16 "//lib:gson",
17 "//lib/httpcomponents:httpclient",
18 "//lib:jgit",
19 "//lib:servlet-api-without-neverlink",
20]
21
22# TODO(davido): Remove this workaround, when provided_deps attribute is added:
23# https://github.com/bazelbuild/bazel/issues/1402
24java_binary(
25 name = "gerrit_core_provided_env",
26 main_class = "Dummy",
27 runtime_deps = DEPLOY_ENV,
28)
29
David Pursehousefda58ef2017-01-19 19:23:54 +090030gerrit_plugin(
31 name = "lfs",
32 srcs = glob(["src/main/java/**/*.java"]),
David Ostrovsky2acd29b2020-06-26 07:47:29 +020033 deploy_env = ["gerrit_core_provided_env"],
David Pursehousefda58ef2017-01-19 19:23:54 +090034 manifest_entries = [
35 "Gerrit-PluginName: lfs",
36 "Gerrit-Module: com.googlesource.gerrit.plugins.lfs.Module",
37 "Gerrit-HttpModule: com.googlesource.gerrit.plugins.lfs.HttpModule",
38 "Gerrit-SshModule: com.googlesource.gerrit.plugins.lfs.SshModule",
David Pursehousec42313e2017-02-27 20:51:55 +090039 "Gerrit-InitStep: com.googlesource.gerrit.plugins.lfs.InitLfs",
David Pursehousefda58ef2017-01-19 19:23:54 +090040 ],
David Pursehousebed8f282017-11-02 16:35:51 +090041 resources = glob(["src/main/resources/**/*"]),
David Ostrovsky2acd29b2020-06-26 07:47:29 +020042 deps = LFS_DEPS,
Paladox none1da3f052017-02-05 15:21:52 +000043)
44
45junit_tests(
46 name = "lfs_tests",
47 srcs = glob(["src/test/java/**/*.java"]),
48 tags = ["lfs"],
Paladox nonef21ff5e2018-10-08 21:56:45 +000049 deps = [
50 ":lfs__plugin_test_deps",
David Pursehousefda58ef2017-01-19 19:23:54 +090051 ],
52)
David Pursehousebed8f282017-11-02 16:35:51 +090053
54java_library(
55 name = "lfs__plugin_test_deps",
56 testonly = 1,
57 visibility = ["//visibility:public"],
David Ostrovsky2acd29b2020-06-26 07:47:29 +020058 exports = PLUGIN_DEPS + PLUGIN_TEST_DEPS + LFS_DEPS + [
David Pursehousebed8f282017-11-02 16:35:51 +090059 ":lfs__plugin",
David Pursehousebed8f282017-11-02 16:35:51 +090060 ],
61)