| load( |
| "@com_googlesource_gerrit_bazlets//:gerrit_plugin.bzl", |
| "gerrit_plugin", |
| "gerrit_plugin_dependency_tests", |
| "gerrit_plugin_ext_test_deps", |
| "gerrit_plugin_test_util", |
| "gerrit_plugin_tests", |
| ) |
| load( |
| "@com_googlesource_gerrit_bazlets//tools:in_gerrit_tree.bzl", |
| "in_gerrit_tree_enabled", |
| ) |
| load( |
| "@com_googlesource_gerrit_bazlets//tools:runtime_jars_allowlist.bzl", |
| "runtime_jars_allowlist_test", |
| ) |
| load( |
| "@com_googlesource_gerrit_bazlets//tools:runtime_jars_overlap.bzl", |
| "runtime_jars_overlap_test", |
| ) |
| load("@rules_java//java:defs.bzl", "java_library") |
| |
| java_library( |
| name = "high-availability-plugin-neverlink", |
| neverlink = True, |
| exports = ["//plugins/high-availability"], |
| ) |
| |
| PLUGIN = "high-availability-gcp" |
| |
| PLUGIN_DEPS = [ |
| "com.google.api:api.common", |
| "com.google.api:gax", |
| "com.google.api:gax.grpc", |
| "com.google.api:grpc.proto.google.cloud.pubsub.v1", |
| "com.google.auth:google.auth.library.oauth2.http", |
| "com.google.cloud:google.cloud.pubsub", |
| "io.grpc:grpc.api", |
| "io.grpc:grpc.netty.shaded", |
| ] |
| |
| gerrit_plugin( |
| srcs = glob(["src/main/java/**/*.java"]), |
| ext_deps = PLUGIN_DEPS, |
| license = "LICENSE", |
| manifest_entries = [ |
| "Gerrit-PluginName: %s" % PLUGIN, |
| "Gerrit-Module: com.googlesource.gerrit.plugins.highavailability.gcp.Module", |
| "Implementation-Title: high-availability gcp pubsub provider", |
| "Implementation-URL: https://gerrit-review.googlesource.com/#/admin/projects/plugins/%s" % PLUGIN, |
| ], |
| plugin = PLUGIN, |
| resources = glob(["src/main/resources/**/*"]), |
| deps = ["high-availability-plugin-neverlink"], |
| ) |
| |
| PLUGIN_TEST_DEPS = PLUGIN_DEPS + [ |
| "com.google.http.client:google.http.client", |
| "org.testcontainers:gcloud", |
| "org.testcontainers:testcontainers", |
| ] |
| |
| gerrit_plugin_ext_test_deps( |
| plugin = PLUGIN, |
| ext_deps = PLUGIN_TEST_DEPS, |
| ) |
| |
| gerrit_plugin_tests( |
| name = "tests", |
| srcs = glob(["src/test/java/**/*.java"]), |
| ext_deps_label = ":high-availability-gcp__plugin_test_deps", |
| javacopts = ["-Xep:DoNotMock:OFF"], |
| plugin = PLUGIN, |
| resources = glob(["src/test/resources/**/*"]), |
| tags = [ |
| PLUGIN, |
| "local", |
| ], |
| deps = ["//plugins/high-availability"], |
| ) |