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

From Eclipsepedia

Jump to: navigation, search
m
m
Line 10: Line 10:
 
#Enter a project name (you should use a fully qualified name, for this example we will use <tt>org.eclipse.smila.integration.bundle</tt>).  
 
#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> as a parent to the source and output folder:  
 
#Add <tt>code</tt> as a parent to the source and output folder:  
#*Set ''Source folder'' to "code/src".  
+
#*Set ''Source folder'' to <tt>code/src</tt>.
#*Set ''Output folder'' to "code/bin".  
+
#*Set ''Output folder'' to <tt>code/bin/tt>.  
#Set ''Target Platform'' to "an OSGi framework: Equinox".  
+
#Set ''Target Platform'' to <tt>an OSGi framework: Equinox</tt>.  
 
#Click ''Next''.  
 
#Click ''Next''.  
 
#Fill in the metadata information of 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 we select:  
 
#Fill in the metadata information of 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 we select:  

Revision as of 12:10, 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).

Create the bundle

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

  1. Launch Eclipse and select your SMILA workspace.
  2. Select File > New > Project and click Plug-in Project.
  3. Click Next.
    Now you have to fill in various metadata and settings for your plug-in project. You may as well edit the settings later on by opening the MANIFEST.MF with the Plug-in Manifest editor.
  4. Enter a project name (you should use a fully qualified name, for this example we will use org.eclipse.smila.integration.bundle).
  5. Add code as a parent to the source and output folder:
    • Set Source folder to code/src.
    • Set Output folder to code/bin/tt>.
  6. Set Target Platform to <tt>an OSGi framework: Equinox.
  7. Click Next.
  8. Fill in the metadata information of 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 we select:
    • ID: org.eclipse.smila.integration.bundle
    • Version: 1.0.0
    • Name: Example Bundle Plugin
    • Provider: Example company
    • Exection Environment: JavaSE-1.6
  9. Unless you need an activator, uncheck this option.
  10. Click Next.
  11. Unless you want to use any of the given templates to create your plugin, uncheck the option.
  12. Click Finish.

Check the result

When you're done with the above, your actions should have resulted in a new project with (in our example) the name of org.eclipse.smila.integration.bundle, that now shows up in your workspace. Just check your Package Explorer for the new bundle. In it, 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 clicking through the panels and you will recognize most of the settings, we did above.

Now that you've created your bundle, you can add your components as you like but do not forget to add a test bundle.