Migrate deprecated JavaInfo API usages
This is a purely mechanical change that replaces:
* transitive_deps with transitive_compile_time_jars
* transitive_runtime_deps with transitive_runtime_jars
The old and new fields are simply aliases, and there is no change in
semantics. This change will allow dropping the deprecated fields from
JavaInfo, reducing blaze memory consumption. The fields were marked
deprecated in Nov 2021, so can be safely dropped.
Change-Id: Iaf6d96e1018a2d9daa840562434f1f7d2f8db866
Release-Notes: n/a
diff --git a/tools/bzl/classpath.bzl b/tools/bzl/classpath.bzl
index 3be7a12..3c80fc3 100644
--- a/tools/bzl/classpath.bzl
+++ b/tools/bzl/classpath.bzl
@@ -2,7 +2,7 @@
all = []
for d in ctx.attr.deps:
if JavaInfo in d:
- all.append(d[JavaInfo].transitive_runtime_deps)
+ all.append(d[JavaInfo].transitive_runtime_jars)
if hasattr(d[JavaInfo].compilation_info, "runtime_classpath"):
all.append(d[JavaInfo].compilation_info.runtime_classpath)
elif hasattr(d, "files"):
diff --git a/tools/bzl/javadoc.bzl b/tools/bzl/javadoc.bzl
index 3add025..a181104 100644
--- a/tools/bzl/javadoc.bzl
+++ b/tools/bzl/javadoc.bzl
@@ -17,7 +17,7 @@
def _impl(ctx):
zip_output = ctx.outputs.zip
- transitive_jars = depset(transitive = [j[JavaInfo].transitive_deps for j in ctx.attr.libs])
+ transitive_jars = depset(transitive = [j[JavaInfo].transitive_compile_time_jars for j in ctx.attr.libs])
# TODO(davido): Remove list to depset conversion on source_jars, when this issue is fixed:
# https://github.com/bazelbuild/bazel/issues/4221
diff --git a/tools/bzl/pkg_war.bzl b/tools/bzl/pkg_war.bzl
index e2be145..4792de2 100644
--- a/tools/bzl/pkg_war.bzl
+++ b/tools/bzl/pkg_war.bzl
@@ -88,7 +88,7 @@
transitive_libs = []
for j in ctx.attr.libs:
if JavaInfo in j:
- transitive_libs.append(j[JavaInfo].transitive_runtime_deps)
+ transitive_libs.append(j[JavaInfo].transitive_runtime_jars)
elif hasattr(j, "files"):
transitive_libs.append(j.files)
@@ -102,7 +102,7 @@
# Add pgm lib
transitive_pgmlibs = []
for j in ctx.attr.pgmlibs:
- transitive_pgmlibs.append(j[JavaInfo].transitive_runtime_deps)
+ transitive_pgmlibs.append(j[JavaInfo].transitive_runtime_jars)
transitive_pgmlib_deps = depset(transitive = transitive_pgmlibs)
for dep in transitive_pgmlib_deps.to_list():
@@ -117,7 +117,7 @@
if ctx.attr.context:
for jar in ctx.attr.context:
if JavaInfo in jar:
- transitive_context_libs.append(jar[JavaInfo].transitive_runtime_deps)
+ transitive_context_libs.append(jar[JavaInfo].transitive_runtime_jars)
elif hasattr(jar, "files"):
transitive_context_libs.append(jar.files)