Merge: jwrapper generates full APIs, with contructors, getters and setters
authorJean Privat <jean@pryen.org>
Sat, 25 Jul 2015 23:55:12 +0000 (19:55 -0400)
committerJean Privat <jean@pryen.org>
Sat, 25 Jul 2015 23:55:12 +0000 (19:55 -0400)
commit07860cc69ab987d284c4cc8db01fbb5f3b294871
treebf886b45d57ce32046cc694791b78cf3c15c94a0
parent34a7990c32b5100a418f9185ecf153c1c422f896
parent2f575ffbf4a1f58122e7a13a10147429b6d3cead
Merge: jwrapper generates full APIs, with contructors, getters and setters

This PR is the second part to #1578, it updates the structure of jwrapper, adds a lot of features and creates usable APIs.

Main changes:
* Rewrite of the AST visitor, type conversion and entity naming.
* Generate constructors.
* Generate getter/setters to attributes.
* Add the -p option to choose the prefix of extern class names, use the namespace by default.
* Add the -i option to scan for existing wrappers in any directory or file.
* Add the -r option to filter the target classes from a Jar archive using a regular expression.
* Add more simple tests with javap outputs.
* Add a complete (and working) example of using a custom Java collection from Nit.
* Add an example of generating an API for Android using jwrapper. This API passes nitpick, but it has not been tested as it needs to be integrated in our Android framework.

What's to do next:
* Support for primitive arrays. (This is the main reason why ~10% of the functions are disabled)
* Add static functions as top-level methods.
* Generate class hierarchy.
* Use nitls with the -i option and to add importations to the generated module.
* Fix generic params usage.

Pull-Request: #1589
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>