Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EMF/Getting Source"

< EMF
m (Modules structure)
(Checking out code for the first time: add PSFs)
Line 153: Line 153:
  
 
If you followed the instructions in the previous section, you should see a new repository entry in the CVS Repositories view. To check out code, do the following:
 
If you followed the instructions in the previous section, you should see a new repository entry in the CVS Repositories view. To check out code, do the following:
+
 
 +
===Using Team Project Set File (.psf)===
 +
 
 +
* Switch to the Java perspective.
 +
* From the File menu or Project Explorer context menu, select '''Import'''.
 +
* Choose '''Team > Team Project Set''', then click Next.
 +
 
 +
[[Image:EMF_getting_sources_img9.jpg]]
 +
 
 +
* Browse for the .psf file you want to use. In [[Media:EMF_Team_Project_Sets.zip|EMF_Team_Project_Sets.zip]] there are several choices. Download this file and extract the file or files you wish to use.
 +
 
 +
* Each feature & plugin will then be checked out as a project in the workspace.
 +
 
 +
===Manually===
 
* Expand the repository node.
 
* Expand the repository node.
 
* Expand the HEAD node, as shown below, to view all the modules in the repository.
 
* Expand the HEAD node, as shown below, to view all the modules in the repository.
Line 163: Line 176:
  
 
* Each selected directory as is checked out as a project in the workspace.  Once the operation is complete, you can switch to the Java perspective to work with the projects.
 
* Each selected directory as is checked out as a project in the workspace.  Once the operation is complete, you can switch to the Java perspective to work with the projects.
 
  
 
==Resolving Dependency Problems==
 
==Resolving Dependency Problems==

Revision as of 23:31, 6 November 2007

This document describes how to access the source code for the EMF, SDO and XSD components. It assumes some familiarity with CVS concepts and some experience working with the Eclipse workbench. For more information on CVS, please consult eclipse.org's CVS repository page. Eclipse's help system also provides a tutorial and documentation for CVS.

This document includes a setup procedure that you may wish to use to checkout the EMF, SDO and XSD projects and resolve compilation errors. We have used this procedure on Eclipse 3.3.1.


Software Environment

In order to develop on the EMF, SDO and XSD projects, you need Eclipse and an appropriate JRE.

When specifying directory paths on your system, remember to compensate for any difference between the environment presented in this article and your development environment.


Setting up the Eclipse Workspace

Configuring the plug-in environment

You need to specify where Eclipse should look for required plug-ins if they do not exist in the current workspace. To do this:

  • In the Preferences dialog (Window > Preferences), with Plug-In Development expanded, select Target Platform.
  • Click Select All so that all the plug-ins are selected.
  • Click OK to close the Preferences dialog.

EMF getting sources img1.jpg

Configuring the the Eclipse CVS preferences

It is highly recommended to prune empty directories when extracting the code from the CVS repository. This is how you can set Eclipse to do that:

  • Select Windows > Preferences > Team.
  • Open CVS and select the Files and Folders tab, then select Prune empty directories.
  • Click OK to close the Preferences dialog.

EMF getting sources img2.jpg


Understanding the CVS Structure

If you are unfamiliar with CVS concepts, there is a good list of resources on the CVS repository page.

Modules structure

The EMF, SDO and XSD sources are divided into three modules in CVS.

CVS Repository Module Directories
/cvsroot/modeling org.eclipse.emf/org.eclipse.emf
plugins contains the EMF plug-ins
features contains the EMF features
doc contains the EMF documentation plug-ins and features
tests contains the EMF, SDO and XSD automated tests plug-ins and features
examples contains the EMF examples
/cvsroot/modeling org.eclipse.emf/org.eclipse.emf.ecore.sdo
plugins contains the SDO plug-ins
features contains the SDO features
doc contains the SDO documentation plug-ins and features
/cvsroot/modeling org.eclipse.mdt/org.eclipse.xsd
plugins contains the XSD plug-ins
features contains the XSD features
doc contains the XSD documentation plug-ins and features
examples contains the XSD examples

EMF and SDO are components of the EMF Project. XSD is a component of the MDT Project.

Build tag and branch naming conventions

For each build, a new CVS tag is created. The name of the CVS tag follows this convention:

build_<build id>

where <build id> is usually the build timestamp in the yyyyMMddhhmmss format (for example, 20040211140643).

The HEAD branch always contains the latest file versions, which are currently under active development. If a fix is required for a particular past build (typically a release), a branch will be created. The branch naming convention is:

branch_<build id>

The structure of the CVS repository is shown below:

EMF getting sources img3.jpg

If for some reason you need to get files from a certain build, look under "Versions" for the tag that identifies that build.


Checking Out Code as an Anonymous User

An anonymous user has access only to check out files from the CVS repository. This user does not have the privileges to check in files.

Configuring the CVS client to check out files

  • Open the CVS perspective in the Eclipse Workbench by selecting Windows > Open Perspective > CVS Repository Exploring.
  • Right click on the CVS Repositories view as shown below, and select New > Repository Location...

EMF getting sources img4.jpg

  • Enter the information as shown below in the Add CVS Repository dialog and click Finish. This will establish a connection with the /cvsroot/modeling repository located on dev.eclipse.org, using the anonymous user ID. Make sure you set the connection type to pserver and use the default port, as shown.

EMF getting sources img5.jpg


Checking out code for the first time

If you followed the instructions in the previous section, you should see a new repository entry in the CVS Repositories view. To check out code, do the following:

Using Team Project Set File (.psf)

  • Switch to the Java perspective.
  • From the File menu or Project Explorer context menu, select Import.
  • Choose Team > Team Project Set, then click Next.

EMF getting sources img9.jpg

  • Browse for the .psf file you want to use. In EMF_Team_Project_Sets.zip there are several choices. Download this file and extract the file or files you wish to use.
  • Each feature & plugin will then be checked out as a project in the workspace.

Manually

  • Expand the repository node.
  • Expand the HEAD node, as shown below, to view all the modules in the repository.
  • Scroll down and expand the org.eclipse.emf/org.eclipse.emf module, as shown below. Select the subdirectories of the features, plugins, docs, tests, and examples directories that you want to retrieve.
  • Repeat for org.eclipse.emf/org.eclipse.emf.ecore.sdo and org.eclipse.mdt/org.eclipse.xsd
  • Right click and select the Check Out menu option.

EMF getting sources img6.jpg

  • Each selected directory as is checked out as a project in the workspace. Once the operation is complete, you can switch to the Java perspective to work with the projects.

Resolving Dependency Problems

You may find that the projects have compilation errors after you check them out. To resolve these, update the classpath. Right click on the project and select the PDE Tools > Update Classpath... menu option as shown below. The Java Classpath dialog appears.

EMF getting sources img7.jpg

Ensure that any projects with dependency problems are checked in the list of available plug-ins and fragments, and then click Finish.

EMF getting sources img8.jpg


Synchronizing your Local Sandbox with the HEAD Branch

  • As described above, the HEAD branch contains the latest verision of the code. To synchronize your local changes with the HEAD, right click on the resource that you want to synchronize, and then select:
Team > Synchronize with Repository
  • You can merge in the changes from the HEAD manually or automatically. To merge automatically, right click on the resource you want to merge. Select:
Team > Update
  • If there are conflicts that cannot be resolved automatically, CVS will insert special markup in the file to indicate that those lines could not be merged. You will need to resolve the conflicts manually. See also Resolving conflicts

Back to the top