Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Jan 29, 2020 9:50 am

All times are UTC - 5 hours

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Xcode 2.5 Plugin Template
PostPosted: Tue Sep 06, 2011 3:13 pm 

Joined: Thu Jan 12, 2006 3:30 pm
Posts: 88
As part of figuring out how to do templates, i set up the following, largely just to make the process easier for myself. This works in Xcode 2.5, on Mac OS Tiger 10.4, but not sure how well it works in newer versions.

Real Basic Template

This integrates the compiling of the plugin, with building the rbx making both a PPC and Universal Binary. It does everything as is, and has the glue code inside it. I don't know yet how to set up a Cocoa version as well. This should make the hard part mainly figuring out the C code you want to use in your plugin.

This creates a cpp file named the same as your project where you put all your code. After compiling you can hit show in finder on the rbx file it creates, and copy it to your RealBasic Plugins folder. It does this very fast so it seems find to throw into the build process.

It creates the needed plugin structure, into which you will have to copy any needed libraries you create with visual studio or linux.

This is largely based on information provided in the documentation or on provided projects set up by Tempelmann, and Christian from Monkeybread software which this is based upon. I am by no means an expert in how to set up projects, nor do i know the best choices for the templates, but i'll be updating this as i learn more or get feedback on various aspects.

Setup instructions
  1. Take the Zip file and extract it into
    ( Your Main Hard Drive ):Developer:Library:Xcode:Project Templates:

  2. Compile the Plugin Converter project found in your Real Basic App folder, under Extras/Plugin SDK/Plugin Converter.

  3. Place the created pluginconverter app and it's library folder into ~/scripts/bin/ to match up with how i set it up on my system, or edit the Xcode template to aim it at where it is on your system and edit the command i use in the final "run script" of each Target.

    Here is the actual command line used inside the "run script" so you can decide how you want to do it, or add various steps to various projects.
    ~/scripts/bin/PluginConverter -f $PROJECT_DIR/$PROJECT_NAME  >& /dev/null

  4. If there is a new version of the Glue Code or Includes, you should copy these to the template or it will have the current version as of when i posted this ( Real Studio 2011 Release 3 ).

Usage Instructions After It is Installed
  1. Go into Xcode and select "real basic plugin" when you are starting a project.

  2. Add your code

    The following is code used in provided ( by Real Software ) examples and the testPlugin, which can be used to do a Hello World type plugin to see if it's working.
    #include "rb_plugin.h"

    static int add5func( int v )
       return v+5;

    REALmethodDefinition def={ (REALproc) add5func, REALnoImplementation, "add5( v as integer) as integer" };

    void PluginEntry() {

  3. Hit Build

  4. Right click the rbx file and reveal in finder, then copy to the Plugins Folder under your RealBasic Application folder

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group