scapix
scapix copied to clipboard
Java bridge: generate all classes as public
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.
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)
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.
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.