[MacRuby-devel] XCode 4 and ObjC bundles

Julien Jassaud julien at collectapply.jp
Tue Apr 12 14:48:30 PDT 2011


Joshua,

Thanks again. The official doc is a bit dry for a first contact. I ended up copying and editing the ControlTower extconf.rb file which worked just fine. That wasn't too hard :) I'll look into mkmf subtleties later.

Unfortunately I am at a loss when it comes to the XCode part. I added a script to the "pre-actions" part of the "Build" step of the "Compile" scheme but the bundle is never built. Any idea ?

Julien

Le 12 avr. 2011 à 22:18, Joshua Ballanco a écrit :

> One advantage to mkmf and extconf.rb (that's the file that you actually run through macruby to generate a Makefile) is that it can take care of most of the difficult parts of generating a Makefile for you (like determining header locations and library availability, etc.). Finding good documentation on mkmf can be a bit tricky, but you might try starting with the official library docs here: http://www.ruby-doc.org/stdlib/libdoc/mkmf/rdoc/index.html
> 
> - Josh
> 
> On Tue, Apr 12, 2011 at 8:04 PM, Julien Jassaud <sojastar07 at gmail.com> wrote:
> Joshua,
> 
> Thanks for your prompt answer. I'll look into both mkmf and ControlTower. This is totally new territory for me. Exciting !
> 
> Julien
> 
>> My suggestion would be to forgo using XCode to build the Obj-C extension, and instead use mkmf like you would with any other Ruby C-extension. Then you can just add a script build stage to your project. If you want to see an example of a MacRuby project with an Obj-C extension, take a look at ControlTower. If you have any other questions, ask!
>> 
>> Cheers,
>> 
>> Josh
>> 
>> On Tue, Apr 12, 2011 at 5:29 PM, Julien Jassaud <sojastar07 at gmail.com> wrote:
>> Hi,
>> 
>> A while back I tried to port some ObjC examples to MacRuby ( github.com/sojastar/Some-MacRuby-sample-code ). I had to leave parts dealing with C strings in an ObjC bundle that is required in the MacRuby code. The ported samples' building process was a bit complicated with XCode 3 :
>> 
>> 1) clone from github
>> 2) run the ObjC bundle Makefile. The Makefile also copied the compiled bundle at the proper location in the build directory.
>> 3) build the project in XCode
>> 
>> An inelegant process but it was working fine.
>> 
>> Now that XCode 4 adds some random string to the build directory's name I don't know how to point the Makefile to the proper location for copying the bundle. So my question is : what is good practice when it comes to ObjC bundles and MacRuby in XCode 4 ? Is there a way to automate the whole bundle build / copy process ? I tried to modify the "Compile" scheme's "Build" step by adding a pre-action script to it but I don't really know what to put in it. I couldn't even run the Makefile from it.
>> 
>> Thanks,
>> Julien Jassaud
>> 
>> 
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>> 
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
> 
> 
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
> 
> 
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20110412/15d47bc9/attachment.html>


More information about the MacRuby-devel mailing list