Bazel: Consume auto-value artifacts from plugin-api
Auto-value* annotation processors are shaded into plugin-api, so that
there is no needs to fetch them separately.
Also mark auto-value* libraries as neverlink, to avoid auto-value*
annotation processors leaking into final plugin artifact.
Release-Notes: skip
Change-Id: I1157ed8733efb2b6134070ba6d4eee903e9fbb14
diff --git a/BUILD b/BUILD
index 717467e..23dfd14 100644
--- a/BUILD
+++ b/BUILD
@@ -14,19 +14,13 @@
java_plugin(
name = "auto-annotation-plugin",
processor_class = "com.google.auto.value.processor.AutoAnnotationProcessor",
- deps = [
- "@auto-value-annotations//jar",
- "@auto-value//jar",
- ],
+ deps = PLUGIN_DEPS,
)
java_plugin(
name = "auto-value-plugin",
processor_class = "com.google.auto.value.processor.AutoValueProcessor",
- deps = [
- "@auto-value-annotations//jar",
- "@auto-value//jar",
- ],
+ deps = PLUGIN_DEPS,
)
java_library(
@@ -35,8 +29,9 @@
":auto-annotation-plugin",
":auto-value-plugin",
],
+ neverlink = True,
visibility = ["//visibility:public"],
- exports = ["@auto-value//jar"],
+ exports = PLUGIN_DEPS,
)
java_library(
@@ -45,8 +40,9 @@
":auto-annotation-plugin",
":auto-value-plugin",
],
+ neverlink = True,
visibility = ["//visibility:public"],
- exports = ["@auto-value-annotations//jar"],
+ exports = PLUGIN_DEPS,
)
gerrit_plugin(
diff --git a/external_plugin_deps.bzl b/external_plugin_deps.bzl
index 3a5ab10..e62ab62 100644
--- a/external_plugin_deps.bzl
+++ b/external_plugin_deps.bzl
@@ -1,16 +1,4 @@
load("//tools/bzl:maven_jar.bzl", "maven_jar")
def external_plugin_deps():
- AUTO_VALUE_VERSION = "1.7.4"
-
- maven_jar(
- name = "auto-value",
- artifact = "com.google.auto.value:auto-value:" + AUTO_VALUE_VERSION,
- sha1 = "6b126cb218af768339e4d6e95a9b0ae41f74e73d",
- )
-
- maven_jar(
- name = "auto-value-annotations",
- artifact = "com.google.auto.value:auto-value-annotations:" + AUTO_VALUE_VERSION,
- sha1 = "eff48ed53995db2dadf0456426cc1f8700136f86",
- )
+ pass