| load("@rules_java//java:defs.bzl", "java_library") | |
| load("//tools/bzl:classpath.bzl", "classpath_collector") | |
| load("//tools/bzl:pkg_war.bzl", "LIBS", "PGMLIBS") | |
| load( | |
| "//tools/bzl:plugins.bzl", | |
| "CORE_PLUGINS", | |
| "CUSTOM_PLUGINS", | |
| "CUSTOM_PLUGINS_TEST_DEPS", | |
| ) | |
| TEST_DEPS = [ | |
| "//javatests/com/google/gerrit/server:server_tests", | |
| ] | |
| TEST_DEPS_GENERATED = [ | |
| "//proto/testing:test_java_proto", | |
| ] | |
| DEPS = [ | |
| "//java/com/google/gerrit/acceptance:lib", | |
| "//java/com/google/gerrit/server", | |
| "//java/com/google/gerrit/asciidoctor:asciidoc_lib", | |
| "//java/com/google/gerrit/asciidoctor:doc_indexer_lib", | |
| "//lib/auto:auto-value", | |
| "//lib/prolog:compiler-lib", | |
| "//proto:entities_java_proto", | |
| "//proto:flow_java_proto", | |
| ] | |
| java_library( | |
| name = "classpath", | |
| testonly = True, | |
| runtime_deps = LIBS + PGMLIBS + DEPS + TEST_DEPS_GENERATED, | |
| ) | |
| classpath_collector( | |
| name = "main_classpath_collect", | |
| testonly = True, | |
| deps = LIBS + PGMLIBS + DEPS + TEST_DEPS + TEST_DEPS_GENERATED + | |
| ["//plugins/%s__plugin" % (n if ":" in n else "%s:%s" % (n, n)) for n in CORE_PLUGINS + CUSTOM_PLUGINS] + | |
| ["//plugins/%s:%s__plugin_test_deps" % (n, n) for n in CUSTOM_PLUGINS_TEST_DEPS], | |
| ) | |
| genrule( | |
| name = "autovalue_apt_carrier_src", | |
| outs = ["AutoValueAptCarrier.java"], | |
| cmd = """ | |
| cat > "$@" <<'EOF' | |
| package tools.eclipse; | |
| // Generated by Bazel: exists only to attach annotation processors. | |
| final class AutoValueAptCarrier {} | |
| EOF | |
| """, | |
| ) | |
| java_library( | |
| name = "autovalue_apt_carrier", | |
| srcs = [":autovalue_apt_carrier_src"], | |
| neverlink = 1, | |
| plugins = [ | |
| "//lib/auto:auto-annotation-plugin", | |
| "//lib/auto:auto-builder-plugin", | |
| "//lib/auto:auto-value-plugin", | |
| "//lib/auto:auto-oneof-plugin", | |
| "//lib/auto:auto-value-gson-plugin", | |
| "//lib/auto:auto-factory-plugin", | |
| ], | |
| visibility = ["//visibility:private"], | |
| deps = [ | |
| "//lib/auto:auto-factory", | |
| "//lib/auto:auto-value-annotations", | |
| "//lib/auto:auto-value-gson", | |
| ], | |
| ) | |
| classpath_collector( | |
| name = "autovalue_classpath_collect", | |
| deps = [":autovalue_apt_carrier"], | |
| ) |