Skip to content

Commit

Permalink
remove print warning if dep has no JavaInfo since it's required now (b…
Browse files Browse the repository at this point in the history
  • Loading branch information
long-stripe authored and johnynek committed Jul 18, 2019
1 parent ce42208 commit d9c6da6
Showing 1 changed file with 27 additions and 33 deletions.
60 changes: 27 additions & 33 deletions scala/private/common.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,18 @@ def _collect_jars_when_dependency_analyzer_is_off(
for dep_target in dep_targets:
# we require a JavaInfo for dependencies
# must use java_import or scala_import if you have raw files
if JavaInfo in dep_target:
java_provider = dep_target[JavaInfo]
deps_providers.append(java_provider)
compile_jars.append(java_provider.compile_jars)
runtime_jars.append(java_provider.transitive_runtime_jars)

if not unused_dependency_checker_is_off:
add_labels_of_jars_to(
jars2labels,
dep_target,
[],
java_provider.compile_jars.to_list(),
)
else:
print("ignored dependency, has no JavaInfo: " + str(dep_target))
java_provider = dep_target[JavaInfo]
deps_providers.append(java_provider)
compile_jars.append(java_provider.compile_jars)
runtime_jars.append(java_provider.transitive_runtime_jars)

if not unused_dependency_checker_is_off:
add_labels_of_jars_to(
jars2labels,
dep_target,
[],
java_provider.compile_jars.to_list(),
)

if (not plus_one_deps_is_off) and (PlusOneDeps in dep_target):
plus_one_deps_compile_jars.append(
Expand All @@ -106,24 +103,21 @@ def _collect_jars_when_dependency_analyzer_is_on(dep_targets):
for dep_target in dep_targets:
# we require a JavaInfo for dependencies
# must use java_import or scala_import if you have raw files
if JavaInfo in dep_target:
java_provider = dep_target[JavaInfo]
deps_providers.append(java_provider)
current_dep_compile_jars = java_provider.compile_jars
current_dep_transitive_compile_jars = java_provider.transitive_compile_time_jars
runtime_jars.append(java_provider.transitive_runtime_jars)

compile_jars.append(current_dep_compile_jars)
transitive_compile_jars.append(current_dep_transitive_compile_jars)

add_labels_of_jars_to(
jars2labels,
dep_target,
current_dep_transitive_compile_jars.to_list(),
current_dep_compile_jars.to_list(),
)
else:
print("ignored dependency, has no JavaInfo: " + str(dep_target))
java_provider = dep_target[JavaInfo]
deps_providers.append(java_provider)
current_dep_compile_jars = java_provider.compile_jars
current_dep_transitive_compile_jars = java_provider.transitive_compile_time_jars
runtime_jars.append(java_provider.transitive_runtime_jars)

compile_jars.append(current_dep_compile_jars)
transitive_compile_jars.append(current_dep_transitive_compile_jars)

add_labels_of_jars_to(
jars2labels,
dep_target,
current_dep_transitive_compile_jars.to_list(),
current_dep_compile_jars.to_list(),
)

return struct(
compile_jars = depset(transitive = compile_jars),
Expand Down

0 comments on commit d9c6da6

Please sign in to comment.