-
Notifications
You must be signed in to change notification settings - Fork 28
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
sbt-javah mangles names of @native methods in objects incorrectly #36
Comments
Thanks for the pointers. I think that at the time I included gjavah in sbt-jni it didn't support special characters, so I just added the If you have a general fix however, I'd be happy to merge it |
In my case (I'm on JDK 14) the last branch of the if-else statement ( |
@mrobakowski 👋 could you check how the current main branch works for you? #43 is merged so it could affect some things. |
FYI, I recently migrated gjavah to scala and fixed the issues with symbols. See here: https://github.com/jodersky/mill-jnilib/blob/master/jnilib/src/jnilib/gjavah.scala I can confirm that it works, even with Scala 3 top-level functions and all sorts of funky characters. |
@jodersky Thanks for confirming that! 🎉 sbt-jni snapshots live here now: https://oss.sonatype.org/content/repositories/snapshots/com/github/sbt/sbt-jni_2.12_1.0/ and should be easier to test to other folks. Let's close it for now, but @mrobakowski feel free to create a new issue and / or reopen this one. Resolved via #43 |
oh, I realize that my comment was ambiguous. When I said "it works", I meant that my Thanks for setting up maven publishing again! |
Ooops! I'll reopen it again than :D |
@mrobakowski btw, we can add the latest JDK into CI if it helps. |
Hi @pomadchin, sorry for not replying earlier. I don't even remember what project I needed this for 😅, so I cannot confirm or deny whether it works for my problem (I probably abandoned that side-project already). But the fix looks good, so thank you for that! 🎉 |
should generate
JNIEXPORT void JNICALL Java_Foo_00024_bar (JNIEnv *, jobject);
but instead it generates
JNIEXPORT void JNICALL Java_Foo___bar (JNIEnv *, jobject);
... at least on recent JVMs. This seems to be already fixed in gjavah, but for some reason
$
is special-cased in here https://github.com/jodersky/sbt-jni/blob/fb2c301d550cee5491780b40b6e87b7e3fc73163/plugin/src/main/java/ch/jodersky/sbt/jni/javah/Utils.java#L55-L56The text was updated successfully, but these errors were encountered: