mattmccray

 
« R.I.P. Mr. Wieringo | Home | Nuapp »

Snippet: Compiling XIBs into NIBs in your Nukefile

» Published January 14, 2008 under Cocoa, Nu, Software

Here's a function I use in my Nukefile to compile XIBs into NIBs:

(function compile-xibs-from-to (xibs to_path)
     (if (and (!= target "clobber") (!= target "clean"))
         (then
              (SH "mkdir -p #{to_path}")
              ((filelist xibs) each:(do (xib)
                                        (set nib (xib stringByReplacingPathExtensionWith:"nib"))
                                        (SH "ibtool #{xib} --compile #{to_path}/#{( nib fileName )}")))
              (filelist "^#{to_path}/[^/]*.nib$"))
         (else nil)))

(set @nib_files (compile-xibs-from-to "^resources/views/[^/]*.xib$" "build/nibs"))

It uses ibtool to compile the .xib into a .nib:

ibtool source.xib --compile target.nib

2 comments

01.14.08 @ 20:40 Patrick Burleson said...
That looks strangely like Lisp code, is it?
01.14.08 @ 22:17 M@ McCray said...
Actually, it’s Nu.

Nu is quite Lisp-y, with a dash of Ruby.

No trackbacks

Trackback link:

Please enable javascript to generate a trackback url


You may use Textile, or simple html tags (B,I). Feel free to use Emoticons too. Oh, and please limit yourself to only five links per comment. Anything more and you'll probably get detained by the spam police.