contrib/jwrapper: Added README
authorFrédéric Vachon <fredvac@gmail.com>
Mon, 4 Aug 2014 01:25:29 +0000 (21:25 -0400)
committerFrédéric Vachon <fredvac@gmail.com>
Thu, 7 Aug 2014 01:24:01 +0000 (21:24 -0400)
Signed-off-by: Frédéric Vachon <fredvac@gmail.com>

contrib/jwrapper/README.md [new file with mode: 0644]

diff --git a/contrib/jwrapper/README.md b/contrib/jwrapper/README.md
new file mode 100644 (file)
index 0000000..8cd3bf0
--- /dev/null
@@ -0,0 +1,55 @@
+# JWRAPPER : Extern classes generator from java .class
+## Description
+jwrapper is a code generator that creates Nit extern classes `in "Java"` from .class files.
+
+## Installation
+jwrapper is designed to be installed from the `contrib` directory of Nit repository. (http://www.nitlanguage.org)
+
+To initiate installation process, use `make` in the `contrib/jwrapper` directory.
+
+jwrapper relies on `nitcc` that will be automatically compiled from `contrib/nitcc`.
+
+## Usage
+The jwrapper binary can be found under `jwrapper/bin` directory.
+
+Since jwrapper uses `grep` to find existing libraries, make sure that the environment variable `NIT_DIR` is properly set to your Nit root directory.
+
+Since jwrapper uses `javap` to extract data from .class files, the JDK7 or higher has to be installed and must be in your `$PATH`. (Older versions of `javap` do not show generic signatures)
+
+Usage :
+
+       jwrapper [OPTIONS] JAVA_CLASS_FILE NIT_OUTPUT_FILE
+
+The options are :
+
+`-a, --with-attributes`
+
+* It enables extern class attributes generation. For each public attribute, there'll be a Nit attribute of the corresponding type.
+
+`-c, --comment`
+
+* When a method contains at least one unknown type, the code generator will comment the whole method and let the client manage it.
+
+`-w, --wrap`
+
+* A minimalistic extern class will be created for each unknown type (this is the default behaviour)
+
+`-h, --help`
+
+* Print the help message
+
+Unknown types are types that doesn't have an equivalent in Nit as of yet.
+
+Jwrapper won't wrap a class that already is in the `lib/android` directory.
+
+Can't use both -c and -w together, either you comment unknown types or you wrap them.
+
+## Limitations
+jwrapper support for java primitive array is limited to one parameter and the return value.
+
+If the method contains more than one primitive array parameter, the method will be commented with a `NOT SUPPORTED` notice.
+
+## TODO List
+* Generate static methods on top-level
+* Extend primitive array support
+* Enhance static overload support (currently, it suffixes the method name with a number)