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

Java bridge: generate all classes as public #40

Open
Boris-Rasin opened this issue Jun 5, 2022 · 3 comments
Open

Java bridge: generate all classes as public #40

Boris-Rasin opened this issue Jun 5, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@Boris-Rasin
Copy link
Member

Today, bridged class with the same name as it's C++ header is generated as public, but additional bridged classes in the same C++ header generated as package-private.

One possible solution is to generate each Java class in it's own source file, so they can all be public.

@Boris-Rasin Boris-Rasin added the enhancement New feature or request label Jun 5, 2022
@Boris-Rasin Boris-Rasin changed the title Java bridge: generate all calsses as public Java bridge: generate all classes as public Jun 5, 2022
@TimPushkin
Copy link

Would be great to have this feature, as I encountered problems with accessing Java classes defined in the same .java file from other classes in the same package (getting unresolved reference in Kotlin)

@Boris-Rasin
Copy link
Member Author

One workaround is to have each C++ class defined in it's own C++ header file, with the same name as C++ header file.

This way, each generated Java class will be public.

@TimPushkin
Copy link

TimPushkin commented Dec 4, 2022

Another issue connected to this one: when a bridged method of a C++ class returns a struct defined in the same header, the generated method becomes public, but its return type becomes package-private.

Of course the same workaround with creating a separate file for the struct can still be applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants