Jump to: navigation, search

Difference between revisions of "SMILA/Documentation/HowTo/Create a bundle (plug-in)"

Line 6: Line 6:
  
 
== Select the New Project wizard ==
 
== Select the New Project wizard ==
Launch eclipse, invoke the ''New Project'' wizard (menu ''File > New > Project''), and click ''Plug-in project'' as shown in the following figure.  
+
Launch eclipse, invoke the ''New Project'' wizard (menu ''File > New > Project''), and click ''Plug-in project''.
  
[[image:NewProject-SMILA.png]]
+
Click ''Next''.
 +
 
 +
Now you have to fill in various metadata and settings for your plug-in project. You can edit these later on by opening the MANIFEST.MF with the Plug-in Manifest Editor.
  
 
== Define Plug-in Project settings ==
 
== Define Plug-in Project settings ==
Click ''Next'' and add the settings as shown in the following screenshot.  
+
Set the Plug-in Project settings:
 +
* Enter a project name (you should use a fully qualified name, for this example we will use <tt>org.eclipse.smila.integration.bundle</tt>).
 +
* add <tt>code</tt> to the source and output folder:
 +
** set Source folder to <tt>code/src</tt>
 +
** set Output folder to <tt>code/bin</tt>
 +
* set Target Platform to <tt>an OSGi framework: Equinox</tt>
  
[[image:projectWizard1.png]]
+
Click ''Next''.
  
 
== Define Plug-in Content settings ==
 
== Define Plug-in Content settings ==
Click ''Next'' and add the settings as shown in the following screenshot.  
+
Fill in the metadata information for the new bundle.
 +
 
 +
Set the Plug-in's name as ID, your bundle's version, a reasonable bundle name and the information about the provider (i.e. you).
 +
 
 +
For our example:
 +
* ID: <tt>org.eclipse.smila.integration.bundle</tt> (in our example)
 +
* Version: <tt>1.0.0</tt>
 +
* Name: <tt>Example Bundle Plugin</tt>
 +
* Provider: <tt>Example company</tt>
 +
* Exection Environment: <tt><No Execution Environment></tt>
 +
 
 +
Unless you need an activator, uncheck this option.
 +
 
 +
Click ''Next''.
 +
 
 +
== Templates ==
 +
Unless you want to use any of the given templates to create your plugin, just uncheck the Option.
 +
 
 +
Click ''Finish''.
 +
 
 +
== Check the result ==
 +
When you're done with the above, your actions should have resulted in a new project with (in our exmple) the name of <tt>org.eclipse.smila.integration.bundle</tt>, that now shows up in your workspace. Just check your Package Explorer for the new bundle.
  
[[image:projectWizard2.png]]
+
There should be an empty <tt>code/src</tt> package, a <tt>META-INF</tt> folder containing a <tt>MANIFEST.MF</tt> file and a <tt>build.properties</tt> file.
  
== Check the Package Explorer view ==
+
Open the <tt>MANIFEST.MF</tt> file and click through the panels and you will recognize most of the settings, we did above.
After clicking ''Next'' and ''Finish'' the ''Package Explorer'' view should look similar to the following screenshot:
+
  
[[image:packageExplorer.png]]
+
Now you've created your bundle, you can add your components and you should not forget to [[SMILA/Development_Guidelines/Create a test bundle (plug-in)|add a test bundle]].
  
 
[[Category:SMILA]]
 
[[Category:SMILA]]

Revision as of 06:35, 18 January 2012

This page describes how to create a new bundle for SMILA.

The description on how to add a test bundle to test the components of the new bundle can be found in How to create a test bundle (plug-in).

The following steps must be performed to create the project base:

Select the New Project wizard

Launch eclipse, invoke the New Project wizard (menu File > New > Project), and click Plug-in project.

Click Next.

Now you have to fill in various metadata and settings for your plug-in project. You can edit these later on by opening the MANIFEST.MF with the Plug-in Manifest Editor.

Define Plug-in Project settings

Set the Plug-in Project settings:

  • Enter a project name (you should use a fully qualified name, for this example we will use org.eclipse.smila.integration.bundle).
  • add code to the source and output folder:
    • set Source folder to code/src
    • set Output folder to code/bin
  • set Target Platform to an OSGi framework: Equinox

Click Next.

Define Plug-in Content settings

Fill in the metadata information for the new bundle.

Set the Plug-in's name as ID, your bundle's version, a reasonable bundle name and the information about the provider (i.e. you).

For our example:

  • ID: org.eclipse.smila.integration.bundle (in our example)
  • Version: 1.0.0
  • Name: Example Bundle Plugin
  • Provider: Example company
  • Exection Environment: <No Execution Environment>

Unless you need an activator, uncheck this option.

Click Next.

Templates

Unless you want to use any of the given templates to create your plugin, just uncheck the Option.

Click Finish.

Check the result

When you're done with the above, your actions should have resulted in a new project with (in our exmple) the name of org.eclipse.smila.integration.bundle, that now shows up in your workspace. Just check your Package Explorer for the new bundle.

There should be an empty code/src package, a META-INF folder containing a MANIFEST.MF file and a build.properties file.

Open the MANIFEST.MF file and click through the panels and you will recognize most of the settings, we did above.

Now you've created your bundle, you can add your components and you should not forget to add a test bundle.