Bazel: Add fixes for --incompatible_disallow_legacy_java_provider
In some places the old style, string-indexed Starlark ‘java’ provider was already replaced with new style javaInfo in: I1d5afb8b022. But some other places were missed to be replaced. Change-Id: Ie5ee9eed689793f532f99aeaa38f12ec87a709e1
This commit is contained in:
parent
dcb8b824b2
commit
09c905ef16
@ -1,9 +1,9 @@
|
||||
def _classpath_collector(ctx):
|
||||
all = []
|
||||
for d in ctx.attr.deps:
|
||||
if hasattr(d, "java"):
|
||||
all.append(d.java.transitive_runtime_deps)
|
||||
all.append(d.java.compilation_info.runtime_classpath)
|
||||
if JavaInfo in d:
|
||||
all.append(d[JavaInfo].transitive_runtime_deps)
|
||||
all.append(d[JavaInfo].compilation_info.runtime_classpath)
|
||||
elif hasattr(d, "files"):
|
||||
all.append(d.files)
|
||||
|
||||
|
@ -198,11 +198,11 @@ def _gwt_binary_impl(ctx):
|
||||
def _get_transitive_closure(ctx):
|
||||
deps = []
|
||||
for dep in ctx.attr.module_deps:
|
||||
deps.append(dep.java.transitive_runtime_deps)
|
||||
deps.append(dep.java.transitive_source_jars)
|
||||
deps.append(dep[JavaInfo].transitive_runtime_deps)
|
||||
deps.append(dep[JavaInfo].transitive_source_jars)
|
||||
for dep in ctx.attr.deps:
|
||||
if hasattr(dep, "java"):
|
||||
deps.append(dep.java.transitive_runtime_deps)
|
||||
if JavaInfo in dep:
|
||||
deps.append(dep[JavaInfo].transitive_runtime_deps)
|
||||
elif hasattr(dep, "files"):
|
||||
deps.append(dep.files)
|
||||
|
||||
|
@ -17,8 +17,11 @@
|
||||
def _impl(ctx):
|
||||
zip_output = ctx.outputs.zip
|
||||
|
||||
transitive_jars = depset(transitive = [j.java.transitive_deps for j in ctx.attr.libs])
|
||||
source_jars = depset(transitive = [j.java.source_jars for j in ctx.attr.libs])
|
||||
transitive_jars = depset(transitive = [j[JavaInfo].transitive_deps 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
|
||||
source_jars = depset(transitive = [depset(j[JavaInfo].source_jars) for j in ctx.attr.libs])
|
||||
|
||||
transitive_jar_paths = [j.path for j in transitive_jars.to_list()]
|
||||
dir = ctx.outputs.zip.path + ".dir"
|
||||
|
@ -102,8 +102,8 @@ def _war_impl(ctx):
|
||||
transitive_context_libs = []
|
||||
if ctx.attr.context:
|
||||
for jar in ctx.attr.context:
|
||||
if hasattr(jar, "java"):
|
||||
transitive_context_libs.append(jar.java.transitive_runtime_deps)
|
||||
if JavaInfo in jar:
|
||||
transitive_context_libs.append(jar[JavaInfo].transitive_runtime_deps)
|
||||
elif hasattr(jar, "files"):
|
||||
transitive_context_libs.append(jar.files)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user