M@'s Musings

« Back to blog
 

Snippet: Compiling XIBs into NIBs in your Nukefile

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
Posted
Filed under:
2 Comments
Jan 14, 2008
Patrick Burleson said...
That looks strangely like Lisp code, is it?
Jan 15, 2008
M@ McCray said...
[Patrick Burleson:1] Actually, it's "Nu":http://programming.nu.
Nu is quite Lisp-y, with a dash of Ruby.

Leave a comment...

Theme by Cory Watilo.
More great Posterous themes at themes.posterous.com.