gerrit/tools/eclipse/BUILD
David Ostrovsky f2f4ee165c Consider plugin's test deps in eclipse classpath generation
Introduce the CUSTOM_PLUGINS_TEST_DEPS in tools/bzl/plugins.bzl
that allow plugin with external test dependencies to be listed.
That way Eclipse classpath generation process can consider these
dependencies.

Because the plugin's own test rule need these dependencies, it
should expose java_library rule called: <plugin>__plugin_test_deps:

  java_library(
      name = "high-availability__plugin_test_deps",
      visibility = ["//visibility:public"],
      exports = [
          "@byte-buddy//jar",
          "@mockito//jar",
          "@objenesis//jar",
          "@wiremock//jar",
      ],
  )

and re-use this rule in junit_tests rule, e.g.:

  junit_tests(
      name = "high_availability_tests",
      [...]
      deps = [
          [...]
          ":high-availability__plugin_test_deps",
      ]
  )

Bug: Issue 6351
Change-Id: I55b402fa6edb9f2506a91451d70e68d44d1a7762
2017-05-31 06:42:48 +00:00

66 lines
1.8 KiB
Python

load("//tools/bzl:pkg_war.bzl", "LIBS", "PGMLIBS")
load("//tools/bzl:classpath.bzl", "classpath_collector")
load(
"//tools/bzl:plugins.bzl",
"CORE_PLUGINS",
"CUSTOM_PLUGINS",
"CUSTOM_PLUGINS_TEST_DEPS",
)
TEST_DEPS = [
"//gerrit-gpg:gpg_tests",
"//gerrit-gwtui:ui_tests",
"//gerrit-httpd:httpd_tests",
"//gerrit-patch-jgit:jgit_patch_tests",
"//gerrit-reviewdb:client_tests",
"//gerrit-server:server_tests",
]
DEPS = [
"//gerrit-acceptance-tests:lib",
"//gerrit-gwtdebug:gwtdebug",
"//gerrit-gwtui:ui_module",
"//gerrit-main:main_lib",
"//gerrit-plugin-gwtui:gwtui-api-lib",
"//gerrit-server:server",
"//lib/asciidoctor:asciidoc_lib",
"//lib/asciidoctor:doc_indexer_lib",
"//lib/auto:auto-value",
"//lib/gwt:ant",
"//lib/gwt:colt",
"//lib/gwt:javax-validation",
"//lib/gwt:javax-validation_src",
"//lib/gwt:jsinterop-annotations",
"//lib/gwt:jsinterop-annotations_src",
"//lib/gwt:tapestry",
"//lib/gwt:w3c-css-sac",
"//lib/jetty:servlets",
"//lib/prolog:compiler_lib",
# TODO(davido): I do not understand why it must be on the Eclipse classpath
#'//Documentation:index',
]
java_library(
name = "classpath",
testonly = 1,
runtime_deps = LIBS + PGMLIBS + DEPS,
)
classpath_collector(
name = "main_classpath_collect",
testonly = 1,
deps = LIBS + PGMLIBS + DEPS + TEST_DEPS +
["//plugins/%s:%s__plugin" % (n, n) for n in CORE_PLUGINS + CUSTOM_PLUGINS] +
["//plugins/%s:%s__plugin_test_deps" % (n, n) for n in CUSTOM_PLUGINS_TEST_DEPS],
)
classpath_collector(
name = "gwt_classpath_collect",
deps = ["//gerrit-gwtui:ui_module"],
)
classpath_collector(
name = "autovalue_classpath_collect",
deps = ["//lib/auto:auto-value"],
)