Hi all,<div><br></div><div>First, great work with the 0.5b2 release. I'm starting to use this for more serious development and it does most of the things I need very well. After a brief struggle last night I managed to get the code for one of my projects compiling using the new macruby_deploy method and it works like a charm.</div>
<div><br></div><div>However, I would like to include the .rbo files in the same executable inside the .app bundle as my objc files, rather than as separate files in the resources directory. </div><div><br></div><div>To that end I defined a build rule that picks up .rb files and uses macrubyc to compile them. I moved the .rb files into the 'compile sources' build step, which causes the output .o files to be included in the excutable. </div>
<div><br></div><div>I then ran into an obvious snag: the ruby environment isn't intialized and the classes are not being pulled in. After some investigation of the rubyc file I can see that you're creating a custom .mm file that calls a number of set up methods for the runtime and an MREP_UUID function for each class. A few questions:</div>
<div><br></div><div>1.) Is there a way that I can find these MREP function names and call them dynamically ? I was considering modifying the generator to output a .m file with a class that just has an init method that calls these, but it isn't compatible with the build rule approach above.</div>
<div>2.) Is there an easier way to set up this environment than the code below ? </div><div><br></div><div><div>ruby_sysinit(&argc, &argv);</div><div> if (argc > 0) {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>argc--;</div>
<div> argv++;</div><div> }</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div> ruby_init();</div><div> ruby_set_argv(argc, argv);</div><div> rb_vm_init_compiler();</div><div>
try {</div><div> void *self = rb_vm_top_self();</div><div> //MREP FUNCTION CALLS GO HERE :)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div> catch (...) {</div><div>
<span class="Apple-tab-span" style="white-space:pre">                </span>rb_vm_print_current_exception();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>rb_exit(1);</div><div> }</div><div> rb_exit(0);</div>
<div><br></div><div>3.) Am I nuts ? If there's a much easier way to do this, please let me know :)</div><div><br></div><div>thanks!</div><div>- Dylan</div></div>