Skip to content

Commit

Permalink
Replace java_common.create_provider with JavaInfo and java_common.mer…
Browse files Browse the repository at this point in the history
…ge (#197)

* Replace java_common.create_provider with JavaInfo and java_common.merge

* Remove unused java_provider
  • Loading branch information
iirina authored and jin committed Aug 9, 2019
1 parent 5bfc99d commit 9051eb0
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions kotlin/internal/toolchains.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,22 @@ register_toolchains("//:custom_toolchain")
"""

def _kotlin_toolchain_impl(ctx):
compile_time_providers = [
JavaInfo(
output_jar = jar,
compile_jar = jar,
neverlink = True,
)
for jar in ctx.files.jvm_stdlibs
]
runtime_providers = [
JavaInfo(
output_jar = jar,
compile_jar = jar,
)
for jar in ctx.files.jvm_runtime
]

toolchain = dict(
language_version = ctx.attr.language_version,
api_version = ctx.attr.api_version,
Expand All @@ -51,11 +67,7 @@ def _kotlin_toolchain_impl(ctx):
jvm_target = ctx.attr.jvm_target,
kotlinbuilder = ctx.attr.kotlinbuilder,
kotlin_home = ctx.attr.kotlin_home,
jvm_stdlibs = java_common.create_provider(
compile_time_jars = ctx.files.jvm_stdlibs,
runtime_jars = ctx.files.jvm_runtime,
use_ijar = False,
),
jvm_stdlibs = java_common.merge(compile_time_providers + runtime_providers),
js_stdlibs = ctx.attr.js_stdlibs,
)
return [
Expand Down

0 comments on commit 9051eb0

Please sign in to comment.