Difference between revisions of "Orbit/Adding Bundles to Orbit"

From Eclipsepedia

Jump to: navigation, search
Line 1: Line 1:
== Moving an existing bundle to Orbit ==
+
== Creating a new project for an Orbit bundle == <div id="newProject"/>
Taking a library that is already bundled in another Eclipse project and adding it to Orbit is quite straightforward.
+
When adding an entirely new library to Orbit, you have to create a project in CVS to house the content.  Follow these steps to set this up the first time.
 
# In your workspace, create a project with the desired name (see [[Bundle Naming]]).  For this example we'll use com.example.foo.
 
# In your workspace, create a project with the desired name (see [[Bundle Naming]]).  For this example we'll use com.example.foo.
 
# In the project, create a readme.txt file that alerts users to the fact that the real content of the project is maintained in CVS branches.  Something like <pre><nowiki>Work in this project happens in various branches according to the  
 
# In the project, create a readme.txt file that alerts users to the fact that the real content of the project is maintained in CVS branches.  Something like <pre><nowiki>Work in this project happens in various branches according to the  
Line 7: Line 7:
 
of the javax.servlet project.</nowiki></pre>
 
of the javax.servlet project.</nowiki></pre>
 
# Share the project into the Orbit repository using the '''Team > Share Project...''' wizard.  There select '''CVS''' then the "dev.eclipse.org/cvsroot/tools" repository.  In the following page, choose '''Use specified module name''' and enter "org.eclipse.orbit/com.example.foo" (remember to fill-in your bundle name).  Finish off the wizard steps.
 
# Share the project into the Orbit repository using the '''Team > Share Project...''' wizard.  There select '''CVS''' then the "dev.eclipse.org/cvsroot/tools" repository.  In the following page, choose '''Use specified module name''' and enter "org.eclipse.orbit/com.example.foo" (remember to fill-in your bundle name).  Finish off the wizard steps.
# Since all real content in Orbit is maintained in branches, immediately create a branch using the '''Team > Branch...''' wizard.  You will be asked to enter a branch name. The typical pattern for that is "v<version number>" where the version number is that which was assigned by the original library producers with the '.' (period) characters replaced with '_' (underscore) characters.  So a library whose version is 2.3 would go in the v2_3 branch.  Ensure that the "Work with this branch" option is selected and and finish off the wizard.
+
# Immediately create a new branch of the newly created project following the steps in [[#newBranch|Creating a new branch].
 +
 
 +
== Creating a new branch of an existing Orbit project == <div id="newBranch"/>
 +
Since all real content in Orbit is maintained in branches, HEAD never contains any real content (just the readme.txt file described above).  Follow these steps to create a new branch.
 +
# Check out HEAD of the desired project, or '''Replace with...''' HEAD if HEAD of the project is not currently in the workspace.
 +
# Create a new branch using the '''Team > Branch...''' wizard.  You will be asked to enter a branch name. The typical pattern for that is "v<version number>" where the version number is that which was assigned by the original library producers with the '.' (period) characters replaced with '_' (underscore) characters.  So a library whose version is 2.3 would go in the v2_3 branch.  Ensure that the "Work with this branch" option is selected and and finish off the wizard.
 
# Delete the readme.txt file
 
# Delete the readme.txt file
# Check out the existing version of the library using '''Team > Check Out As...''' wizard from the repository navigator.  Pick any name you like for the new project.  For example, com.example.foo.old helps keep things clear.  This project will only be in your workspace for a few minutes
+
# Proceed to add the desired content and eventually commit the changes into the branch.
# Once the original project is checked out, copy and paste all content from the old project into the project you created at the beginning of these steps and delete the old project.
+
 
# Commit the changes to the new project (e.g., com.example.foo) to create an exact copy of the original bundle project in a branch in the Orbit repository.
+
== Moving an existing bundle to Orbit ==
 +
Taking a library that is already bundled in another Eclipse project and adding it to Orbit is quite straightforward.
 +
# Create a [[#newProject|new project]] or [[#newBranch|new branch]] of an existing project to hold the bundle's content.
 +
# Check out the existing version of the library into a project using a temporary name.  You need to do this if the new and old projects have the same name.  Use the '''Team > Check Out As...''' wizard from the repository navigator.  Pick any name you like for the new project.  For example, com.example.foo.old helps keep things clear.  This project will only be in your workspace for a few minutes.
 +
# Once the original project is checked out, copy and paste all content from the old project into the project you created at the beginning of these steps and delete the old project. '''Note that you should use the Resource Navigator to ensure you get all the content.'''
 +
# Commit the changes to the destination project to create an exact copy of the original bundle project in a branch in the Orbit repository.
  
 
== Adding a library for the first time ==
 
== Adding a library for the first time ==
 
Use this approach when you have a library (i.e., JAR) that you want to convert into a bundle.
 
Use this approach when you have a library (i.e., JAR) that you want to convert into a bundle.
 +
# Create a [[#newProject|new project]] or [[#newBranch|new branch]] of an existing project to hold the bundle's content.
 
# Start the '''New > Project > Plugin Development > Plug-in from existing JAR''' wizard to effectively import the library into a new project.   
 
# Start the '''New > Project > Plugin Development > Plug-in from existing JAR''' wizard to effectively import the library into a new project.   
 
# Enter the new bundle name etc.
 
# Enter the new bundle name etc.

Revision as of 14:49, 18 November 2006

== Creating a new project for an Orbit bundle == <div id="newProject"/> When adding an entirely new library to Orbit, you have to create a project in CVS to house the content. Follow these steps to set this up the first time.

  1. In your workspace, create a project with the desired name (see Bundle Naming). For this example we'll use com.example.foo.
  2. In the project, create a readme.txt file that alerts users to the fact that the real content of the project is maintained in CVS branches. Something like
    Work in this project happens in various branches according to the 
    
version of the library being maintained. For example, if you are looking for javax.servlet version 2.3, check out the v2_3 branch of the javax.servlet project.
  1. Share the project into the Orbit repository using the Team > Share Project... wizard. There select CVS then the "dev.eclipse.org/cvsroot/tools" repository. In the following page, choose Use specified module name and enter "org.eclipse.orbit/com.example.foo" (remember to fill-in your bundle name). Finish off the wizard steps.
  2. Immediately create a new branch of the newly created project following the steps in [[#newBranch|Creating a new branch].

== Creating a new branch of an existing Orbit project == <div id="newBranch"/> Since all real content in Orbit is maintained in branches, HEAD never contains any real content (just the readme.txt file described above). Follow these steps to create a new branch.

  1. Check out HEAD of the desired project, or Replace with... HEAD if HEAD of the project is not currently in the workspace.
  2. Create a new branch using the Team > Branch... wizard. You will be asked to enter a branch name. The typical pattern for that is "v<version number>" where the version number is that which was assigned by the original library producers with the '.' (period) characters replaced with '_' (underscore) characters. So a library whose version is 2.3 would go in the v2_3 branch. Ensure that the "Work with this branch" option is selected and and finish off the wizard.
  3. Delete the readme.txt file
  4. Proceed to add the desired content and eventually commit the changes into the branch.

Moving an existing bundle to Orbit

Taking a library that is already bundled in another Eclipse project and adding it to Orbit is quite straightforward.

  1. Create a new project or new branch of an existing project to hold the bundle's content.
  2. Check out the existing version of the library into a project using a temporary name. You need to do this if the new and old projects have the same name. Use the Team > Check Out As... wizard from the repository navigator. Pick any name you like for the new project. For example, com.example.foo.old helps keep things clear. This project will only be in your workspace for a few minutes.
  3. Once the original project is checked out, copy and paste all content from the old project into the project you created at the beginning of these steps and delete the old project. Note that you should use the Resource Navigator to ensure you get all the content.
  4. Commit the changes to the destination project to create an exact copy of the original bundle project in a branch in the Orbit repository.

Adding a library for the first time

Use this approach when you have a library (i.e., JAR) that you want to convert into a bundle.

  1. Create a new project or new branch of an existing project to hold the bundle's content.
  2. Start the New > Project > Plugin Development > Plug-in from existing JAR wizard to effectively import the library into a new project.
  3. Enter the new bundle name etc.
  4. Ensure that the Analyze library contents and add dependencies checkbox is selected.
  5. Ensure that the Unzip the JAR into the project checkbox is selected.
  6. Click Finish

Adding a library that is already a bundle

TBD