nug generates ObjC header files from Nu files. This is handy when integrating Nu and Objective-C in the same project. This is based on a request in the Nu mailing list.
Open the Terminal and navigate to the
nug directory using the command line. Then do the following:
The above should compile
nug, install it into /usr/local/bin/, and then delete the generated files. If you'd prefer to compile
nug by hand, you can do the following:
nubakethe nu file using:
nubake nug.nu -s
- Compile into a program using:
gcc nug.m -o nug -framework Cocoa -framework Nu
- Install the compiled
nugwhere you normally put executables
Navigate to a folder with a "nu" folder (but don't go into the "nu" folder) using the Terminal. Run
nug in the Terminal.
nug will create a "nug" folder (if one doesn't already exist) and create header files based on information found in the nu folder.
nug only reads the files that are in the "nu" folder. You can change this by using the
-fre stands for "file regular expression." Any files that match that regular expression will be converted using
nug. For instance, if you want to create headers for files in a "nu" and a "src" folder, you can use `nug -fre "^(nu|src).*.nu".