Skip to content
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

Provide an example for compiling to native-image #152

Closed
eiswind opened this issue Aug 3, 2020 · 14 comments
Closed

Provide an example for compiling to native-image #152

eiswind opened this issue Aug 3, 2020 · 14 comments

Comments

@eiswind
Copy link

eiswind commented Aug 3, 2020

I fail with and seemingly endless chain of problems when I try to build a native-image with graalvm.
Has anyone setup a working example?

@jamesward
Copy link
Collaborator

There is a lot of reflection happening under the covers so it probably is possible but not easy. Are you looking to do this for server, client, or both?

@eiswind
Copy link
Author

eiswind commented Aug 3, 2020

My primary target would be the client. I have seen that micronaut and quarkus are doing this for the java server side, but my target is a openjfx client.

@jamesward
Copy link
Collaborator

Cool. One more question... Is it ok to use the lite client?

@eiswind
Copy link
Author

eiswind commented Aug 3, 2020

Heya :) I do not have even a basic idea how this setup would look like :) Maybe you could point me to an example setup with the lite-client? ATM I have a shared module that contains the generated stubs and service skeletons, that I use on both sides.

@jamesward
Copy link
Collaborator

Cool. I think lite should work. I'll try to get a sample project going that creates a GraalVM native-image client.

@eiswind
Copy link
Author

eiswind commented Aug 3, 2020

Ok I get it. Not using netty seems to be a good idea :)

@eiswind
Copy link
Author

eiswind commented Aug 3, 2020

At least I could compile and connect it now with the lite-stubs. Now I see other troubles with openjfx :(
Thanks a lot for pointing me in the right direction.

@asarkar
Copy link

asarkar commented Aug 6, 2020

@eiswind Are you targeting JVM platform using lite? Would you be willing to share a sample project here since you say you got it working?

@eiswind
Copy link
Author

eiswind commented Aug 7, 2020

@asarkar Unfortunately I cannot share this code. But it was a no brainer. As soon as I did remove netty and replaced it with the lite libs it did compile without any further effort.

@jamesward
Copy link
Collaborator

@asarkar You can find an example lite project build at: https://github.com/jamesward/kotlin-samples/blob/sample-android/run/grpc-sample-android/common/build.gradle.kts

@asarkar
Copy link

asarkar commented Aug 7, 2020

@jamesward I saw that one already, but I got the impression that @eiswind got lite working for JVM platform, not Android; I also asked specifically and wasn't refuted.

Are you targeting JVM platform using lite?

@jamesward
Copy link
Collaborator

Cool. My example does target the JVM. But I'm working on another one that targets Android (AAR). Is that what you are looking for?

@asarkar
Copy link

asarkar commented Aug 7, 2020

My example does target the JVM

It does? The project name misled me then.
Screen Shot 2020-08-07 at 12 36 04 PM

I'll be happy with a JVM example.

@jamesward
Copy link
Collaborator

I used lite in the common subproject with the protos and grpc kotlin stuff. It targets the JVM and is used in an android project and a JVM server project.

jamesward added a commit that referenced this issue Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants