pubref / rules_kotlin

Bazel rules for Kotlin
Other
159 stars 20 forks source link

Use non-ABI jars for kotlin compilation. #41

Closed pcj closed 6 years ago

pcj commented 6 years ago

Also adds two new kotlin_compile attributes:

  1. verbose: for printing debugging info
  2. args: for passing arbitrary args to compilation

Adds new test from @jmmk re: tornadofx

Fixes #40

pcj commented 6 years ago

@jmmk can you take a look at this PR and try it on your end?

git_repository(
    name = "org_pubref_rules_kotlin",
    remote = "https://github.com/pubref/rules_kotlin.git",
    commit = "4f780394cb3d4f1bb18b72179c1b2865e533c9bf", 
)
pcj commented 6 years ago

@iirina Can you check this? For kotlin compilation we need to assemble a list of jars to pass to kotlinc. I think I should probably be using the set of transitive full jars, is full_compile_jars the transitive set?

jmmk commented 6 years ago

@pcj Confirmed that using rules_kotlin on commit 4f780394cb3d4f1bb18b72179c1b2865e533c9bf (and adding "-jvm-target", "1.8", to compile_args) builds the tornadofx example.


However, I tested Jackson Kotlin module and it still failed. See gist here: https://gist.github.com/jmmk/842fac837b7af8ebefde85e476f9002d

pcj commented 6 years ago

Took a look at the gist and added a comment.

pcj commented 6 years ago

OK, I can't remember exactly why I was removing kotlin-stdlib.jar and kotlin-reflect.jar from classpath... Some experiment perhaps that I failed to remove.

jmmk commented 6 years ago

@pcj the Jackson example works after the latest commit

iirina commented 6 years ago

@pcj

For kotlin compilation we need to assemble a list of jars to pass to kotlinc. I think I should probably be using the set of transitive full jars, is full_compile_jars the transitive set?

full_compile_jars only gives you the direct jars, not the ones collected transitively. The transitive ones are not exposed right now on the provider, but they can be exposed easily if you need them.

pcj commented 6 years ago

@iirina Yes we do need the transitive jars exposed. See https://github.com/pubref/rules_kotlin/issues/47

iirina commented 6 years ago

Can you open a GH issue on bazel and assign it to me please?

pcj commented 6 years ago

I created the issue https://github.com/bazelbuild/bazel/issues/4297 (but do not have permission to make assignments).

Thanks!