David Pursehouse | 2e566e8 | 2019-09-05 08:43:41 +0900 | [diff] [blame] | 1 | load("@rules_java//java:defs.bzl", "java_library") |
Paladox none | 1da3f05 | 2017-02-05 15:21:52 +0000 | [diff] [blame] | 2 | load("//tools/bzl:junit.bzl", "junit_tests") |
| 3 | load( |
| 4 | "//tools/bzl:plugin.bzl", |
Paladox none | 1da3f05 | 2017-02-05 15:21:52 +0000 | [diff] [blame] | 5 | "PLUGIN_DEPS", |
| 6 | "PLUGIN_TEST_DEPS", |
Paladox none | f21ff5e | 2018-10-08 21:56:45 +0000 | [diff] [blame] | 7 | "gerrit_plugin", |
Paladox none | 1da3f05 | 2017-02-05 15:21:52 +0000 | [diff] [blame] | 8 | ) |
David Pursehouse | fda58ef | 2017-01-19 19:23:54 +0900 | [diff] [blame] | 9 | |
David Ostrovsky | 2acd29b | 2020-06-26 07:47:29 +0200 | [diff] [blame] | 10 | LFS_DEPS = [ |
| 11 | "@jgit//org.eclipse.jgit.lfs.server:jgit-lfs-server", |
| 12 | "@jgit//org.eclipse.jgit.lfs:jgit-lfs", |
| 13 | ] |
| 14 | |
| 15 | DEPLOY_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 |
| 24 | java_binary( |
| 25 | name = "gerrit_core_provided_env", |
| 26 | main_class = "Dummy", |
| 27 | runtime_deps = DEPLOY_ENV, |
| 28 | ) |
| 29 | |
David Pursehouse | fda58ef | 2017-01-19 19:23:54 +0900 | [diff] [blame] | 30 | gerrit_plugin( |
| 31 | name = "lfs", |
| 32 | srcs = glob(["src/main/java/**/*.java"]), |
David Ostrovsky | 2acd29b | 2020-06-26 07:47:29 +0200 | [diff] [blame] | 33 | deploy_env = ["gerrit_core_provided_env"], |
David Pursehouse | fda58ef | 2017-01-19 19:23:54 +0900 | [diff] [blame] | 34 | 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 Pursehouse | c42313e | 2017-02-27 20:51:55 +0900 | [diff] [blame] | 39 | "Gerrit-InitStep: com.googlesource.gerrit.plugins.lfs.InitLfs", |
David Pursehouse | fda58ef | 2017-01-19 19:23:54 +0900 | [diff] [blame] | 40 | ], |
David Pursehouse | bed8f28 | 2017-11-02 16:35:51 +0900 | [diff] [blame] | 41 | resources = glob(["src/main/resources/**/*"]), |
David Ostrovsky | 2acd29b | 2020-06-26 07:47:29 +0200 | [diff] [blame] | 42 | deps = LFS_DEPS, |
Paladox none | 1da3f05 | 2017-02-05 15:21:52 +0000 | [diff] [blame] | 43 | ) |
| 44 | |
| 45 | junit_tests( |
| 46 | name = "lfs_tests", |
| 47 | srcs = glob(["src/test/java/**/*.java"]), |
| 48 | tags = ["lfs"], |
Paladox none | f21ff5e | 2018-10-08 21:56:45 +0000 | [diff] [blame] | 49 | deps = [ |
| 50 | ":lfs__plugin_test_deps", |
David Pursehouse | fda58ef | 2017-01-19 19:23:54 +0900 | [diff] [blame] | 51 | ], |
| 52 | ) |
David Pursehouse | bed8f28 | 2017-11-02 16:35:51 +0900 | [diff] [blame] | 53 | |
| 54 | java_library( |
| 55 | name = "lfs__plugin_test_deps", |
| 56 | testonly = 1, |
| 57 | visibility = ["//visibility:public"], |
David Ostrovsky | 2acd29b | 2020-06-26 07:47:29 +0200 | [diff] [blame] | 58 | exports = PLUGIN_DEPS + PLUGIN_TEST_DEPS + LFS_DEPS + [ |
David Pursehouse | bed8f28 | 2017-11-02 16:35:51 +0900 | [diff] [blame] | 59 | ":lfs__plugin", |
David Pursehouse | bed8f28 | 2017-11-02 16:35:51 +0900 | [diff] [blame] | 60 | ], |
| 61 | ) |