-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importing Kotlin jars #40
Comments
Here's the difference between the dependency types:
Anyway, I do see the tornadofx jar in the compile classpath, so I'm a little confused why the import errors are occuring. Still looking... |
Got a little farther. kotlin_binary(
name = "main",
main_class = "AppKt",
srcs = ["App.kt"],
verbose = 1,
args = [
"-jvm-target", "1.8",
],
jars = [
"@no_tornado_tornadofx//jar:file",
],
) yields:
So there does seem to be a difference between providing the original jar and the ijar for kotlin. Also, need to add a new argument for the jvm-target. Now the issue is the missing |
@pcj javafx classes will only be in Oracle's JDK 8 I think As for the ijar vs jar, I wonder if this is related: facebook/buck#1386 (ijar might not work 100% for Kotlin) |
@pcj maybe also related: bazelbuild/bazel#3528 (has to do with ijars and bazel's scala_rules) |
OK, I was able to get this working with the oracle jdk and have seen the app window popup 😄 . Trying to use the JavaInfo provider per your last comment... |
I'm getting build errors trying to access some functions from third-party jars. I'm not sure if this is directly related to
rules_kotlin
or a more general problem with how bazel handles Kotlin code in jars. I haven't tried importing Kotlin code into Java (with bazel).I've made a small example gist: https://gist.github.com/jmmk/2aa367c00548dd34e0a8637462493bd2. I tried all 3 of
java_deps
,jars
, anddeps
as I'm not 100% clear on the difference between these. Usingjava_deps
gets the farthest in the build, but still fails. Note that I'm usingrules_maven
for the dependencies, but experienced the same issue with bazel-deps.Example build output of
bazel build main_deploy.jar
:Another library I've had fail is https://github.com/FasterXML/jackson-module-kotlin/blob/master/src/main/kotlin/com/fasterxml/jackson/module/kotlin/Extensions.kt#L15, where I got
unresolved reference: jacksonObjectMapper()
.The text was updated successfully, but these errors were encountered: