Skip to content

Include JNI Java dependency on jni:setup #698

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

Closed
HosseinYousefi opened this issue Dec 23, 2022 · 4 comments
Closed

Include JNI Java dependency on jni:setup #698

HosseinYousefi opened this issue Dec 23, 2022 · 4 comments

Comments

@HosseinYousefi
Copy link
Member

Using JNI on Android is straightforward, as the java sources reside inside JNI's Android directory. This however is not the case for the standalone Dart projects, where the .jar file needs to be manually copied to the project. bindings_writer.dart should copy the jni.jar just as it copies dartjni.h to the src/ directory of the new JNI project. The .jar file also needs to be built if it doesn't exist or the source has changed, similar to the APISummarizer in JNIgen.

@mahesh-hegde
Copy link
Contributor

What do you refer to by jni.jar? Is it in the case custom .java files are used in standalone project?

@HosseinYousefi
Copy link
Member Author

To support Kotlin coroutines, I added a support class called PortContinuation to package:jni. In standalone projects, this file need to be copied into the new projects and used there. See kotlin_test.

@mahesh-hegde
Copy link
Contributor

mahesh-hegde commented Mar 23, 2023

I'd suggest renaming cmake folder in jnigen/ to assets. We are going to see many this kind of files with #776 .

Edit: Nevermind it may be better to build this locally. We wouldn't want to ship Jars with source.

@HosseinYousefi
Copy link
Member Author

@HosseinYousefi HosseinYousefi transferred this issue from dart-archive/jnigen Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants