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

Support generation of proper Java enums #108

Closed
jjzazuet opened this issue Jun 12, 2016 · 7 comments
Closed

Support generation of proper Java enums #108

jjzazuet opened this issue Jun 12, 2016 · 7 comments

Comments

@jjzazuet
Copy link

Hi. Thanks for such an awesome project!

Now, I know that when instructed, SWIG supports code generation for proper Java 1.5 enums coming from C or C++ enum definitions.

http://www.swig.org/Doc3.0/SWIGDocumentation.html#Java_proper_enums

Is it possible to support this feature in JavaCpp?

Thanks!

@saudet
Copy link
Member

saudet commented Jun 12, 2016

Sure, but as usual someone needs to take the time to work on it. If this is something that is important enough for you, please do make a contribution and send a pull request. I will be happy to help with any issues you encounter.

@jjzazuet
Copy link
Author

Sure thing. From what I can find in the code, it seems that the core modifications would need to happen inside the Parser class. I'll try to find the time and see if I can make a few changes. Thanks!

@jjzazuet
Copy link
Author

jjzazuet commented Jun 12, 2016

By the way, I would highly recommend migrating the build system to Gradle, since it now offers facilities for working with native code bases. I understand that not everyone is using it, but I think it may pre-implement stuff that this project does through the code itself (e.g. creating fat jars with 3rd party libs, identifying platform information at runtime and managing the compiler invocation process for the native environment).

http://gradle.org/getting-started-native/
http://carlosvin.github.io/en/posts/gradle-cpp/

Let me know if you're interested in this and I can try to help.

Thanks!

@saudet
Copy link
Member

saudet commented Jun 13, 2016

Yes, I think most of modifications would take place in Parser.enumeration():
https://github.com/bytedeco/javacpp/blob/master/src/main/java/org/bytedeco/javacpp/tools/Parser.java#L2412

As for Gradle, we need to support other things like sbt as well, so we can't really migrate to Gradle. But we can provide those kinds of features via plugins and what not, and that would be most welcome. @lloydmeta is maintaining sbt-javacv and sbt-javacpp, so something like that for Gradle would be awesome. Others are interested: bytedeco/javacv#395 And if it can help support Android Studio better, just for that it would be worth it IMO.

saudet added a commit that referenced this issue Mar 22, 2018
@saudet
Copy link
Member

saudet commented Mar 22, 2018

This feature has finally been added! Please let me know if you encounter any issues using it.

@saudet
Copy link
Member

saudet commented Apr 9, 2018

FYI, released with version 1.4.1. Enjoy!

@saudet saudet closed this as completed Apr 9, 2018
@saudet
Copy link
Member

saudet commented May 21, 2020

BTW, a build plugin for Gradle is now available here:
https://github.com/bytedeco/gradle-javacpp
If you try it out and find anything missing, please let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants