I hope that after those last two posts, you are already capable of adding your classes to your project and growing it without any further problems. Once this is done, I also expect that you can export your project and run it outside of Eclipse with no headache. You choose your deploy directory (which I'll call $DEPLOY_DIR) and you can run your executable software at $DEPLOY_DIR/yourapp(.exe). If this is not the case, feel free to contact me either by email or posting a comment.
So, now that you have your development environment set up and you can run your software in your platform, you probably want to export it into other operating systems (OS). For now, you don't even have this option anywhere you can find it. If you search a bit through the internet you'll discover you need the RCP-Delta-Pack to do so. Very good... but where the hell is that pack? If you search around the RCP download you'll eventually find it although it's not really very well exposed.
The way to find the up to date version is:
Choose "Other downloads for ..."
Get down to "RCP SDK" and the last file is the RCP delta pack.
For the 3.2.2 version, just click here.
Now that you have your delta-pack, it's really easy. Just unzip the file into $ECLIPSE_HOME/plugins and restart your eclipse. Now when you ask to export your application, you'll get a nice checkbox asking if you want to export to multiple platforms. If you select it, the "next" button will become active and if you click it, you'll have a list of supported OSs. Let's say you'll select macosx_ppc, linux_x86 and win32_x86 (like Archimedes does).
The export system will use the $DEPLOY_DIR and create in it, 3 folders (one for each system):
And each of these folders will contain all files needed to run the software on these OSs with those graphical interfaces.
If you take a look, you'll find that much is common to all OSs and we hope so, since it should be a platform-independent software. I cared to take a deeper look and list what is common and what is not.
Mainly, the "configuration" and "features" folder are identical. The "plugins" is mainly identical, the only thing that may change is a couple of plugin fragments that are OS specific (like "org.eclipse.opengl.linux" and "org.eclipse.open.macosx"). If the fragments have requirements regarding the OS, they will be selected only by the OSs that support that requirements. Careful about that! If you depend on a plugin that has a fragment like that one and it doesn't get exported, you'll get the friendly "There was an error. Please check .metadata/.log for more details." message. If you check the log, you'll find the also friendly (but known already) "No application ID found" message.
The root folder, however, is quite diferent depending on the OS you look. The only file that is always available is "startup.jar" which contains the basic RCP plugin system which will activate whatever needs to be activated.
All the rest is quite diferent. For example:
Windows has only a "yourapp.exe" file.
MacOS X has a whole folder "yourapp.app" with a nice deep structure required to make your software run like a native Mac software.
Linux is the most poluated one. It has "youricon.xpm", a folder "about_files" and a page "about.html", "libcairo-swt.so" and a "yourapp" executable file.
Now why is that important? Because you will probably want to make an installer (like Archimedes does) or a common package that would allow your users to download once the core and add the OS specific files as they need it. In this case, you'll need to know what is core and what is OS specific.
I'll stay here for today but my next post will be about creating this installer. I'll use IzPack (http://www.izforge.com/izpack) to make the example because it's what Archimedes uses and it is very simple and powerful. You can probably, however, use the example in any installer you'd like just adapting the procedure.