Skip to content

Commit

Permalink
Restore kotlin legacy provider to preserve ability to see autogenerat…
Browse files Browse the repository at this point in the history
…ed code in IDE
  • Loading branch information
oliviernotteghem committed Aug 23, 2024
1 parent bbae7d3 commit 03c3521
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion kotlin/internal/jvm/kt_android_library_impl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ load(
load(
"@rules_android//rules/android_library:impl.bzl",
_BASE_PROCESSORS = "PROCESSORS",
_finalize = "finalize",
_android_library_finalize = "finalize",
)
load(
"//kotlin/internal/jvm:compile.bzl",
Expand All @@ -37,6 +37,17 @@ load(
_kt_jvm_produce_output_jar_actions = "kt_jvm_produce_output_jar_actions",
)

def _finalize(ctx, jvm_ctx, **unused_ctxs):
# Call into rules_android for it's finalization logic
providers = _android_library_finalize(ctx = ctx, jvm_ctx = jvm_ctx, **unused_ctxs)

# Mirror the resulting provider but stick the legacy `kt` provider into the
# rule result so that Intellij knows to treat our KT targets as Kotlin.
return struct(
kt = jvm_ctx.kt_info,
providers = providers,
)

def _process_jvm(ctx, resources_ctx, **unused_sub_ctxs):
"""Custom JvmProcessor that handles Kotlin compilation
"""
Expand Down

0 comments on commit 03c3521

Please sign in to comment.