From: Alexis Laferrière Date: Thu, 27 Aug 2015 18:29:20 +0000 (-0400) Subject: contrib/objcwrapper: intro README.md file X-Git-Tag: v0.7.8~61^2~1 X-Git-Url: http://nitlanguage.org contrib/objcwrapper: intro README.md file Signed-off-by: Alexis Laferrière --- diff --git a/contrib/objcwrapper/README.md b/contrib/objcwrapper/README.md new file mode 100644 index 0000000..b33a682 --- /dev/null +++ b/contrib/objcwrapper/README.md @@ -0,0 +1,31 @@ +Generator of Nit extern classes to wrap Objective-C services. + +# Description + +_objcwrapper_ is a tool to help access Objective-C classes and methods from Nit. +It generates Nit code composed of extern classes and extern methods from the Objective-C FFI. +The code should be valid Nit, but it may need some tweaking by hand before use. + +_objcwrapper_ takes as input preprocessed Objective-C header files. +This preprocessing is usually done by combinig (or piping) calls to: +`gcc -E`, `header_keeper` and `header_static`. +See the check rules in the Makefile for example preprocessing. + +# Usage + +1. Compile _objcwrapper_ with: `make` + +2. Compile the wrapper `NSArray.nit` from the preprocessed header `NSArray.h` with: + + ~~~ + bin/objcwrapper -o NSArray.h NSArray.h + ~~~ + +3. Import the generated module as usual from any Nit program. + It is not recommended to modify the generated file directly, + but you can redef the generated classes from other modules. + +# See also + +_jwrapper_ is the inspiration for this tool. +It generate wrappers to access Java services from Nit.