Skip to content

Commit

Permalink
Add compile-only deps to javadocs classpath (#952)
Browse files Browse the repository at this point in the history
javadoc may have to inspect compile-only dependencies.

Also removes a line that only added elements to a depset that are
already contained in this depset.
  • Loading branch information
fmeum authored Sep 7, 2023
1 parent 5509cf1 commit 15e30eb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions private/rules/javadoc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ def _javadoc_impl(ctx):

jar_file = ctx.actions.declare_file("%s.jar" % ctx.attr.name)

# Gather additional files to add to the classpath
additional_deps = depset(transitive = [dep[JavaInfo].transitive_runtime_jars for dep in ctx.attr.deps])
classpath = depset(transitive = [dep[JavaInfo].transitive_runtime_jars for dep in ctx.attr.deps] + [additional_deps])
# javadoc may need to inspect compile-time dependencies (neverlink)
# of the runtime classpath.
classpath = depset(
transitive = [dep[JavaInfo].transitive_runtime_jars for dep in ctx.attr.deps] +
[dep[JavaInfo].transitive_compile_time_jars for dep in ctx.attr.deps],
)

# javadoc options and javac options overlap, but we cannot
# necessarily rely on those to derive the javadoc options we need
Expand Down

0 comments on commit 15e30eb

Please sign in to comment.