contrib/objcwrapper: intro README.md file
[nit.git] / contrib / objcwrapper / README.md
1 Generator of Nit extern classes to wrap Objective-C services.
2
3 # Description
4
5 _objcwrapper_ is a tool to help access Objective-C classes and methods from Nit.
6 It generates Nit code composed of extern classes and extern methods from the Objective-C FFI.
7 The code should be valid Nit, but it may need some tweaking by hand before use.
8
9 _objcwrapper_ takes as input preprocessed Objective-C header files.
10 This preprocessing is usually done by combinig (or piping) calls to:
11 `gcc -E`, `header_keeper` and `header_static`.
12 See the check rules in the Makefile for example preprocessing.
13
14 # Usage
15
16 1. Compile _objcwrapper_ with: `make`
17
18 2. Compile the wrapper `NSArray.nit` from the preprocessed header `NSArray.h` with:
19
20         ~~~
21         bin/objcwrapper -o NSArray.h NSArray.h
22         ~~~
23
24 3. Import the generated module as usual from any Nit program.
25    It is not recommended to modify the generated file directly,
26    but you can redef the generated classes from other modules.
27
28 # See also
29
30 _jwrapper_ is the inspiration for this tool.
31 It generate wrappers to access Java services from Nit.