Skip to content

Commit

Permalink
Support JavaInfo provider in javadoc_library
Browse files Browse the repository at this point in the history
Preparation for bazelbuild/bazel#7598.

Closes #75.
Resolves #76.

Testing Done:
- `./build_test.sh`
- Used `javadoc_library` in a project with custom Java rules which only export
  the `JavaInfo` provider.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=254235598
  • Loading branch information
rbeasley authored and ronshapiro committed Jun 26, 2019
1 parent 1163333 commit 993b8f0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/javadoc/javadoc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ def _android_jar(android_api_level):
def _javadoc_library(ctx):
_check_non_empty(ctx.attr.root_packages, "root_packages")

transitive_deps = [dep.java.transitive_deps for dep in ctx.attr.deps]
transitive_deps = []
for dep in ctx.attr.deps:
if JavaInfo in dep:
transitive_deps.append(dep[JavaInfo].transitive_deps)
elif hasattr(dep, "java"):
transitive_deps.append(dep.java.transitive_deps)

if ctx.attr._android_jar:
transitive_deps.append(ctx.attr._android_jar.files)

Expand Down

0 comments on commit 993b8f0

Please sign in to comment.