Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compile-only deps to javadocs classpath #952

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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