Skip to main content
Jump to: navigation, search

Difference between revisions of "Papyrus-RT/Developer/Developer Guide/DevEnv Mars"

m
m (Installing required development features)
Line 18: Line 18:
 
**Papyrus UML 1.1.1 (under 'Papyrus')
 
**Papyrus UML 1.1.1 (under 'Papyrus')
 
**Papyrus UML Developer Resources 1.1.1 (under 'Papyrus')  
 
**Papyrus UML Developer Resources 1.1.1 (under 'Papyrus')  
**Papyrus C++ profile, view and and code generation (Incubation) 1.1.1 (under 'Papyrus Extras (Other)') (2)
+
**Papyrus C++ profile, view and and code generation (Incubation) 1.1.1 (under 'Papyrus Extras (Other)') (1)
 
**Papyrus C++ profile, view and code generation Developer Resources (Incubation) 1.1.1 (under 'Papyrus Extras (Other)') (2)
 
**Papyrus C++ profile, view and code generation Developer Resources (Incubation) 1.1.1 (under 'Papyrus Extras (Other)') (2)
  
Line 42: Line 42:
 
*From the FindBugs update site at http://findbugs.cs.umd.edu/eclipse:
 
*From the FindBugs update site at http://findbugs.cs.umd.edu/eclipse:
 
**FindBugs 3.0.1
 
**FindBugs 3.0.1
 
  
 
==Clone the repositories==
 
==Clone the repositories==

Revision as of 09:19, 16 September 2015

There are several possible ways to make a development environment to work on PapyrusRT, but it's a good idea to follow the steps provided here as we know these work.

Installing Eclipse

  1. Download the plain Eclipse SDK 4.5 (Mars) from http://download.eclipse.org/eclipse/downloads/, selecting the one specific to your development platform.
  2. Decompress the archive in some target folder. For example: ~/dev/papyrusrt

Installing required development features

Start Eclipse. Install each of the following features by clicking on "Help -> Install New Software..." and selecting the appropriate update site.

  • From the "Mars" releases update site at http://download.eclipse.org/releases/mars
    • EMF Eclipse Modeling Famework SDK 2.12.0 (found under 'Modeling')
    • Xtext 2.8.3 (found under 'Modeling' or 'General Purpose Tools')

(1) The version from the releases update-site should work, but you may want to install from the nightly update-site to get frequent updates.

(2) The code generator uses a different C++ profile, but this is needed because of a dependency.

Optional features (recommended)

The following features, found in the "Mars" releases update site at http://download.eclipse.org/releases/mars, are not required, strictly speaking, but they are very useful to do development on PapyrusRT.

  • From the "Mars" releases update site at http://download.eclipse.org/releases/mars
    • Ecore Diagram Editor SDK 3.0.0 (found under 'Modeling'; aka EcoreTools; includes Sirius)
    • Mylyn Task List 3.17.0 (under 'Collaboration')
    • Mylyn Task-Focused Interface 3.17.0 (under 'Collaboration')
    • Mylyn Tasks Connector: Bugzilla 3.17.0 (under 'Collaboration')
    • Eclipse XML Editors and Tools 3.6.3 (found under 'Programming Languages' and 'Web, XML, Java EE and OSGi Enterprise Development')
    • m2e - Maven Integration for Eclipse 1.7.0 (under 'General Purpose Tools')

Clone the repositories

Git repositories are cloned from the "Git Perspective" (Window -> Perspective -> Open Perspective -> Other... and select "Git")

In this perspective, under the "Git Repositories" view (on the left of the work area), click the "Clone" button (it has a bluish curved arrow). Enter the appropriate URI and credentials.

Once you've entered those, you'll be asked for a branch to clone. Select "master". Then you'll be asked to chose a destination folder and whether to import the projects. Usually you want to import the projects, but for Papyrus itself you might want to say no, as it is very large. It's better for Papyrus to import only some projects as needed to resolve dependencies.

  • Clone the Papyrus git repositories:
    • URI: http://git.eclipse.org/gitroot/papyrus/org.eclipse.papyrus.git
    • Host: git.eclipse.org
    • Repository path: /gitroot/papyrus/org.eclipse.papyrus.git:
    • Protocol: http
    • Port: (leave blank)
    • User/password: You can clone this repository using "anonymous" for your credentials, or use your own Eclipse credentials if you plan to contribute to Papyrus itself.
    • Select the appropriate branch. For most users it should be only the "streams/1.1-maintainance" branch if working on Mars, and "master" if working on Neon.
    • Select a target directory where the git cloned local repository will be stored.

Note: It is recommended *NOT* to import all Papyrus projects. There is a very large number of projects and importing them all will cause Eclipse to try to build them all, which might take a very long time and even stall. For working with PapyrusRT you only need those projects cloned, not imported.

  • Clone the Papyrus-RT git repositories:
    • https://git.eclipse.org/r/papyrus-rt/org.eclipse.papyrus-rt.git
    • Host: git.eclipse.org
    • Repository path: /r/papyrus/org.eclipse.papyrus.git:
    • Protocol: https
    • Port: (leave blank)
    • User/password: You can clone this repository using "anonymous" for your credentials, or use your own Eclipse credentials if you plan to contribute to PapyrusRT itself.
    • Select the appropriate branch. For most users it should be only the "master" branch. You can clone all branches if you like.
    • Select a target directory where the git cloned local repository will be stored.
    • Select "Import All Projects". You may organize them in "Working sets" if desired. This might be useful, for example to have separate working sets for the code generator sources, the tests, etc.

Note: The protocol is https rather than http, and the repository path begins with /r/ rather than /gitroot/.

Note: Whenever you update either the Papyrus or Papyrus-RT features, you should do a git pull on the relevant git repositories. In the case of Papyrus, a mismatch between the "production" version (the installed feature) and the "development" version (the cloned repository) may result in many runtime errors.

Configure your git repositories

On each of the repositories you should do a "Gerrit Configuration":

  1. Select and unfold the repository
  2. Select and unfold "Remotes"
  3. Right-click on "origin"
  4. Click on "Gerrit Configuration" (a small green icon appears on the repository)
  5. Click on "Finish".
  6. Select and unfold "Branches"
  7. Select and unfold "Local"
  8. Right-click "master"
  9. Click on "Configure Branch..."
  10. Set "Remote" to "origin"
  11. Set "Upstream branch" to "refs/heads/master"
  12. Set "Rebase" (tick the checkbox)
  13. Click "OK"

Configure your preferences

To commit code, every Git commit must have the correct credentials. (E)Git must be configured with your name and e-mail used as an Eclipse committer.

  1. Go to Window->Preferences... (or Eclipse->Preferences... on a Mac)
  2. Navigate to Team->Git->Configuration
  3. Under "User settings" check if there is a "user" field with "name" and "email" sub-fields.
    1. If the fields are present and the values correct, nothing needs to be done.
    2. If the fields are present and the values are incorrect, edit them by clicking on the value.
    3. If the fields are not present, click on "Add Entry..." And enter "user.name" (resp. "user.email") as key, and the appropriate value. Click OK.

To be able to compile Xtend code from the code generator, the Eclipse editors must be set to use UTF-8 encoding.

  1. Go to Window->Preferences... (or Eclipse->Preferences... on a Mac)
  2. Navigate to General->Workspace
  3. Under "Text file encoding" check that it is UTF-8. If not, select UTF-8 from the listbox and click OK.

Also, the Java editors should be configured so that code is not re-formatted with every save action, because otherwise, when pushing a change-set to Gerrit, formatting changes will be passed on as "real" changes.

  1. Go to Window->Preferences... (or Eclipse->Preferences... on a Mac)
  2. Navigate to Java->Editor->Save Actions
  3. Ensure that "Perform the selected actions on save" is unchecked.

Generate code for EMF models

The code generator has several internal EMF (meta)models. The repository stores these meta-models but not the generated Java source code for them, which is needed to compile the code generator. These meta-models are found in the 'model' folder of the following projects:

  • org.eclipse.papyrusrt.xtumlrt.common.model
  • org.eclipse.papyrusrt.xtumlrt.platform.model
  • org.eclipse.papyrusrt.xtumlrt.platform.cpp.model
  • org.eclipse.papyrusrt.xtumlrt.umlrt.model

To generate these source code you need to do the following for each of these projects:

  1. Open the project org.eclipse.papyrusrt.xtumlrt.XXXX.model
  2. Open the folder model
  3. Open the file called XXXX.genmodel (e.g. common.genmodel)
  4. A tree editor appears, showing the root element. Right-click on the root element.
  5. Select "Generate Model Code"

Once you finish, you might want to do a clean build: Project -> Clean....

Depending on your setup, some projects might show errors, in particular the projects for the runtime and the tooling, but the codegen projects should show no errors.

Back to the top