[galileo] HowTo define a (simple) Target Platform

Part 4 of my Galileo Reviews around Target Platforms. An Overview of this blog series can be found here.

You should understand the differences between your IDE (your tool, the workbench) and a Target Platform (product, runtime).

(see the first part of this series here)

part 2 and part 3 of the blog series explained howto install and manage Plug-ins in your IDE. Now we have to define our Target Platform.

Before Galileo came out defining and esp. managing a complex Target Platform including Plug-ins (bundles) from Eclipse and 3rdParty could become a nightmare. It was manageable, but manually work has to be done and it wasn’t easy to update the Target Platform, you got problems with duplicates etc. I can understand that many developers put all into the IDE instead of clearly separate stuff between IDE and Target Platform.

If you have realized the really great step Galileo did in this area, I promise you’ll work with Target Platforms now.

Preferences -> Plug-in Development -> Target Platform

Please open this Preference Page – its the central point to manage your Target Platforms. If you followed the last blogs you’ll see something like this:

target platform preferences running

Even if you have done nothing with Target Platforms, Eclipse is already using a Target Platform: the default is the active running platform (== your Eclipse IDE).

running platform active

the Location is your ${eclipse_home}

running platform location

Please select the Platform and click “Edit

running platform edit

What you see as Content is the same as your Plug-ins viewed from “Configuration Details” we inspected in the last blogs. This doesnt wonder, because its the IDE itself running as Target Platform.

Under Environment and Arguments you’ll find whats configured for your IDE. You can even use this “Running Platform” and “Add…” additional Plug-ins (bundles).

But I prefer to leave the “Running Platform” untouched and to create new Target Platforms, but its your game ;-)

Define a new (simple) Target Platform

You can define and manage your Target Platforms completely from the Preference Page and your Target Platform Definitions will be automatically stored locally.

But its a good idea to have your Target Platform Deifinitions inside your Workspace to share them with others or put under Version Control.

Lets prepare this first and create a simple General Project, perhaps with some folders to structure your definitions:

project ekkescorner target definitions

Our first example of a simple Target Definition will only include one Project: Riena and we want try to make the Riena Target Platform run the Example Client.

To start click “Add…” from your Target Platform Preference Page:

new target definition 1

You can choose between some options to start with the Running Platform, the Current Target or a Template.

Lets start with “Nothing: an empty target definition”

Give your Target a Name, per ex. “Riena 1.1.0 including Samples“.

Now we need a Location: click on “Add…

We know that Riena is part of the Galileo Train, so we choose Software Site:

new target definition add content site

Next ->” opens a View where we can select a Software Site: Its the same View then from “Install New Software…” we already know from the last blogs.

Let’s choose the “Galileo” Site and filter for “Riena“:

new target definition filter riena

Please notice the comment “TP ONLY” – this means: these Plug-ins normaly shouldn’t be installed into the IDE – only into Target Platforms. If you perhaps installed both into your IDE, then your Toolbar and Menus suddenly have unwanted entries: these are from Riena Example plug-ins automatically started. This doesnt happen inside the Target Platform – to start bundles from your Target Platform you need a Launch configuration. There’s one exception for Riena Core SDK: if you’re using redView WYSIWYG editor you’ll need the Riena SDK (but NOT the examples) inside your IDE. I’ll talk about redView installation in another blog. But if you installed the Examples into your IDE simply uninstall them – we learned this in the last blog.

Be sure to “Include required software” and check both:

  • Riena Core SDK (TP ONLY)
  • Riena SDK Examples (TP ONLY)

and “Finish” . Now take a cup of tea or coffee while P2 is doing an excellent job:

target content riena locations

P2 manages to get all what you need: 126 Plug-ins (bundles) from many different projects.

Hint: P2 manages all Plug-ins (bundles) using a bundlepool we’ll talk later about. So after some time using Target Definitions the bundlepool grows and it will be faster, because not all has to be downloaded.

Take a look under Content to see whats part of the Riena Target Platform.

target content riena content

You can now edit Environment and Arguments to set Defaults used if you Create new Launch Configurations.

Click “Finish” to save the Target Platform Definition. Now lets “Move…” the definition into our workspace project:

move target definition

Click “Finish” and close the Preferences Page. Go to your Target Definitions Project in workspace: now you can also edit Target Definitions from the workspace:

edit moved target definition

You can

  • open and edit Target Definitions from workspace
  • duplicate and change existing Target Definitions
  • create new Target Definitions (“New -> Target Definition” opens the Editor)

The Preference Page will automatically display all your Target Definitions from Workspace.

So its up to you if you prefer to edit from Preference Page or from Workspace Target Definition files.

Clicking “Set as Target Platform” from Top right sets this Target Definition as the Active one:

active target platform

Now import the Riena Example Client into Workspace. uuups: a Compile Error: some swt classes are missing.

If you have read the Riena Readme before, then you should have known, that Riena needs “RCP” Plug-ins.

Simply edit your Target definition file, add a new Site, select from “Galileo” as before, search “RCP“. Your Target Definition should look like:

target riena plus rcp

Now the project compiles well. Lets launch it as Eclipse Application. oooh (if working on OSX Cocoa-64)  the next Error:

java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on 32-bit JVM

Thats easy to fix:  Open the Launch Configuration – instead of JVM 1.5 change to JVM 1.6.0

java runtime 1.6

…and the Riena Example Application starts.

BTW: there’s also a special Riena Update Site – see at  http://wiki.eclipse.org/Riena_Getting_started – but I wanted to do it here from scratch to learn about Target Definitions. Other blogs will follow to learn more about Riena.

I hope you have seen how easy it is to work with the new Target Definitions under Galileo.

After this first simple example in the next blog we’ll define more complex Target Definitions from different Locations and including 3rdParty. stay tuned…

3 responses

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 1,067 other followers

%d bloggers like this: