Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
[fix] collect more jars from rules_kotlin's KtJvmInfo to handle t…
Browse files Browse the repository at this point in the history
…he lack of generated jars. | #BAZEL-648

add comment

[fix] collect more jars from `rules_kotlin`'s `KtJvmInfo` to handle the lack of generated jars. | #BAZEL-648 Done


Merge-request: BAZEL-MR-565
Merged-by: Xuan Son Trinh <xuanson.trinh@jetbrains.com>
  • Loading branch information
xuansontrinh authored and qodana-bot committed Oct 17, 2023
1 parent a908bcf commit e7faadc
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions aspects/rules/jvm/jvm_info.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,20 @@ def get_generated_jars(provider):
return map_with_resolve_files(to_generated_jvm_outputs, provider.java_outputs)

if hasattr(provider, "annotation_processing") and provider.annotation_processing and provider.annotation_processing.enabled:
class_jar = provider.annotation_processing.class_jar
source_jar = provider.annotation_processing.source_jar
class_jars = [provider.annotation_processing.class_jar]
source_jars = [provider.annotation_processing.source_jar]

# Additional info from `rules_kotlin`'s `KtJvmInfo`
if hasattr(provider, "additional_generated_source_jars"):
source_jars = source_jars + [jar for jar in provider.additional_generated_source_jars]
if hasattr(provider, "all_output_jars"):
class_jars = class_jars + [jar for jar in provider.all_output_jars]

output = struct(
binary_jars = [file_location(class_jar)],
source_jars = [file_location(source_jar)],
binary_jars = [file_location(jar) for jar in class_jars],
source_jars = [file_location(jar) for jar in source_jars],
)
resolve_files = [class_jar, source_jar]
resolve_files = class_jars + source_jars
return [output], resolve_files

return [], []
Expand Down

0 comments on commit e7faadc

Please sign in to comment.