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 "Papyrus-RT/Developer/Developer Guide/DevEnv Mars"

m
m (Charles.zeligsoft.com moved page Papyrus-RT/Developer Guide/DevEnv Mars to Papyrus-RT/Developer/Developer Guide/DevEnv Mars: Wiki reorganisation)
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
[[File:PapyrusForRealTime-Logo-Icon.png|left|bottom-align|]]<br/><span style="font-family: Helvetica,Arial,sans-serif; font-size: 48px;"><b>Setting up the Mars Development Environment</b></span><br/><br/><br/>
 +
 +
__TOC__
 +
 
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.
 
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==
+
= Installing Eclipse =
  
#Download the plain Eclipse SDK 4.5 (Mars) from http://download.eclipse.org/eclipse/downloads/, selecting the one specific to your development platform.
+
# Install Java 1.7 (other Java versions may cause trouble) from [http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html]
#Decompress the archive in some target folder. For example: <code>~/dev/papyrusrt</code>
+
# Download the plain Eclipse SDK 4.5 (Mars) from [http://download.eclipse.org/eclipse/downloads/ http://download.eclipse.org/eclipse/downloads/], selecting the one specific to your development platform.
 +
# Decompress the archive in some target folder. For example: <code>~/dev/papyrusrt</code>
 +
# Start Eclipse
 +
# Go to <code>Preferences -> Java -> Installed JRE</code> and select one that is 1.7
 +
# Go to <code>Preferences -> Java -> Compiler</code> and under "Compiler compliance level" select 1.7
  
==Installing required development features==
 
  
Start Eclipse.
+
= Installing required development features =
Install each of the following features by clicking on "<code>Help -> Install New Software...</code>" and selecting the appropriate update site.
+
  
*From the "Mars" releases update site at http://download.eclipse.org/releases/mars
+
== Adding required update sites ==
**EMF Eclipse Modeling Famework SDK 2.12.0 (found under 'Modeling')
+
**Xtext 2.8.3 (found under 'Modeling' or 'General Purpose Tools')
+
  
*From the Papyrus releases update-site at http://download.eclipse.org/modeling/mdt/papyrus/updates/releases/mars or the nightly(1) update-site at http://download.eclipse.org/modeling/mdt/papyrus/updates/nightly/mars
+
Go to <code>Help -> Install New Software...</code>, and add each of the following update sites (by clicking on the <code>Add...</code> button).
**Papyrus UML 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 code generation Developer Resources (Incubation) 1.1.1 (under 'Papyrus Extras (Other)') (2)
+
  
(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.
+
{| class="wikitable"
 +
! Name
 +
! Location
 +
|-
 +
| Xtext
 +
| [http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/ http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/]
 +
|-
 +
| Papyrus releases - mars
 +
| [http://download.eclipse.org/modeling/mdt/papyrus/updates/releases/mars/ http://download.eclipse.org/modeling/mdt/papyrus/updates/releases/mars/]
 +
|-
 +
| PapyrusRT releases - mars
 +
| [http://download.eclipse.org/papyrus-rt/updates/releases/mars/ http://download.eclipse.org/papyrus-rt/updates/releases/mars/]
 +
|-
 +
| PapyrusRT codegen/rts nightly - mars
 +
| [http://download.eclipse.org/papyrus-rt/builds/nightly/ http://download.eclipse.org/papyrus-rt/builds/nightly/]
 +
|-
 +
| PapyrusRT tooling/profile nightly - mars
 +
| [https://hudson.eclipse.org/papyrus-rt/job/Papyrus-RT-Master-All/lastSuccessfulBuild/artifact/repository/ https://hudson.eclipse.org/papyrus-rt/job/Papyrus-RT-Master-All/lastSuccessfulBuild/artifact/repository/]
 +
|}
  
(2) The code generator uses a different C++ profile, but this is needed because of a dependency.
+
{{Note|
 +
* The Xtext update site is needed in order to obtain the required version 2.9 as the Eclipse Mars update site only has version 2.8.4
 +
* The different PapyrusRT repositories will give you the possibility of installing allow you to install features depending on what part of PapyrusRT you want to work on.|}}
  
*From the EGit updates update-site at http://download.eclipse.org/egit/updates
+
== Installing the required features ==
**EGit Team Provider 4.0.1
+
  
===Optional features (recommended)===
+
Install each of the following features by clicking on <code>Help -> Install New Software...</code> and selecting the appropriate update site.
  
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:
 +
** EMF Eclipse Modeling Famework SDK 2.11.1 or newer (found under 'Modeling')
 +
** C/C++ Development Tools 8.8.0 or newer (found under 'Programming Languages')
 +
** EGit Team Provider 4.0.3 or newer (found under 'Collaboration')
  
*From the "Mars" releases update site at http://download.eclipse.org/releases/mars
+
* From the '''Xtext''' update-site:
**Ecore Diagram Editor SDK 3.0.0 (found under 'Modeling'; aka EcoreTools; includes Sirius)
+
** Xtext Complete SDK 2.9.1 or newer (found under 'Xtext')
**Mylyn Task List 3.17.0 (under 'Collaboration')
+
** Xtext Redistributable 2.9.1 or newer (found under 'Xtext')
**Mylyn Task-Focused Interface 3.15.0 (under 'Collaboration')
+
**Mylyn Tasks Connector: Bugzilla 3.15.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')
+
  
*From the FindBugs update site at http://findbugs.cs.umd.edu/eclipse:
+
* From the '''Papyrus''' ''releases - mars'' update-site:  
**FindBugs 3.0.1
+
** Papyrus UML 1.1.3 or newer (under 'Papyrus')
 +
** Papyrus UML Developer Resources 1.1.3 or newer (under 'Papyrus')
 +
** Papyrus C++ profile, view and and code generation (Incubation) 1.1.3 or newer (under 'Papyrus Extras (Other)')
 +
** Papyrus C++ profile, view and code generation Developer Resources (Incubation) 1.1.3 or newer (under 'Papyrus Extras (Other)')
  
 +
* From the '''PapyrusRT''' ''releases - mars'' update-site:
 +
** Papyrus RT Core Feature (Incubation) 0.7.2 or newer
 +
** Papyrus RT Core Feature (Incubation) Developer Resources 0.7.2 or newer
 +
** Papyrus RT Feature (Incubation) 0.7.2 or newer
 +
** Papyrus RT Feature (Incubation) Developer Resources 0.7.2 or newer
 +
** Papyrus RT Profile Feature (Incubation) 0.7.2 or newer
 +
** Papyrus RT Profile Feature (Incubation) Developer Resources 0.7.2 or newer
 +
** Papyrus RT Tooling Feature (Incubation) 0.7.2 or newer
 +
** Papyrus RT Tooling Feature (Incubation) Developer Resources 0.7.2 or newer
  
==Clone the repositories==
+
{{Note|You can install the tooling features from the PapyrusRT ''tooling/profile nightly'' update site if you prefer.|}}
 +
 
 +
== Optional features (recommended) ==
 +
 
 +
The following features, found in the "Mars" releases update-site, 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/ http://download.eclipse.org/releases/mars/]
 +
** Ecore Diagram Editor SDK 3.0.1 or newer (found under 'Modeling'; aka EcoreTools; includes Sirius)
 +
** Mylyn Task List 3.17.0 or newer (under 'Collaboration')
 +
** Mylyn Task-Focused Interface 3.17.0 or newer (under 'Collaboration')
 +
** Mylyn Tasks Connector: Bugzilla 3.17.0 or newer (under 'Collaboration')
 +
** Mylyn Tasks Connector: Gerrit 3.17.0 or newer (under 'Collaboration')
 +
** Eclipse XML Editors and Tools 3.7.1 or newer (found under 'Programming Languages' and 'Web, XML, Java EE and OSGi Enterprise Development')
 +
** m2e - Maven Integration for Eclipse 1.6.2 or newer (under 'General Purpose Tools')
 +
 
 +
* From the FindBugs update-site at [http://findbugs.cs.umd.edu/eclipse http://findbugs.cs.umd.edu/eclipse]:
 +
** FindBugs 3.0.1 or newer
 +
 
 +
= Clone the repositories =
 +
 
 +
You need to clone the PapyrusRT repository ([https://git.eclipse.org/r/papyrus-rt/org.eclipse.papyrus-rt.git https://git.eclipse.org/r/papyrus-rt/org.eclipse.papyrus-rt.git]), and optionally the Papyrus repository ([http://git.eclipse.org/gitroot/papyrus/org.eclipse.papyrus.git http://git.eclipse.org/gitroot/papyrus/org.eclipse.papyrus.git]) if you want to work on the tooling side.
  
 
Git repositories are cloned from the "Git Perspective" (Window -> Perspective -> Open Perspective -> Other... and select "Git")
 
Git repositories are cloned from the "Git Perspective" (Window -> Perspective -> Open Perspective -> Other... and select "Git")
Line 50: Line 100:
 
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.
 
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.
+
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 if you clone the Papyrus repository 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:
+
== Clone the PapyrusRT repository ==
**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.
+
The following needs to be provided:
  
*Clone the Papyrus-RT git repositories:
+
{| class="wikitable"
**https://git.eclipse.org/r/papyrus-rt/org.eclipse.papyrus-rt.git
+
|-
**Host: git.eclipse.org
+
| URI || [https://git.eclipse.org/r/papyrus-rt/org.eclipse.papyrus-rt.git https://git.eclipse.org/r/papyrus-rt/org.eclipse.papyrus-rt.git]
**Repository path: /r/papyrus/org.eclipse.papyrus.git:
+
|-
**Protocol: https
+
| Host || git.eclipse.org
**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.
+
| Repository path || /r/papyrus/org.eclipse.papyrus.git
**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.
+
| Protocol || https
**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.
+
|-
 +
| 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.
 +
|}
  
'''Note''': The protocol is https rather than http, and the repository path begins with /r/ rather than /gitroot/.
+
# Click the <code>Next</code> button.
 +
# Select the appropriate branch. For most users it should be only the "master" branch. You can clone all branches if you like.
 +
# Click the <code>Next</code> button.
 +
# 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.
 +
# Click the <code>Finish</code> button.
  
'''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.
+
{{Note|
 +
* The protocol is https rather than http, and the repository path begins with /r/ rather than /gitroot/.
 +
* 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==
+
== Clone the Papyrus repository (optional) ==
 +
 
 +
You don't need the Papyrus git repository but it may be useful, specially if you are going to work on the tooling side of PapyrusRT.
 +
 
 +
{| class="wikitable"
 +
|-
 +
| URI || [http://git.eclipse.org/gitroot/papyrus/org.eclipse.papyrus.git 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.
 +
|}
 +
 
 +
# Click the <code>Next</code> button.
 +
# Select the appropriate branch. For most users it should be only the "streams/1.1-maintainance" branch for the Mars release (the master branch is for the Neon release).
 +
# Click the <code>Next</code> button.
 +
# Select a target directory where the git cloned local repository will be stored.
 +
# Click the <code>Finish</code> button.
 +
 
 +
{{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.|}}
 +
 
 +
= Configure your git repositories =
  
 
On each of the repositories you should do a "Gerrit Configuration":
 
On each of the repositories you should do a "Gerrit Configuration":
  
#Select and unfold the repository
+
# Select and unfold the repository
#Select and unfold "Remotes"
+
# Select and unfold "Remotes"
#Right-click on "origin"
+
# Right-click on "origin"
#Click on "Gerrit Configuration" (a small green icon appears on the repository)
+
# Click on "Gerrit Configuration" (a small green icon appears on the repository)
#Click on "Finish".
+
# Click on "Finish".
#Select and unfold "Branches"
+
# Select and unfold "Branches"
#Select and unfold "Local"
+
# Select and unfold "Local"
#Right-click "master"
+
# Right-click "master"
#Click on "Configure Branch..."
+
# Click on "Configure Branch..."
#Set "Remote" to "origin"
+
# Set "Remote" to "origin"
#Set "Upstream branch" to "refs/heads/master"
+
# Set "Upstream branch" to "refs/heads/master"
#Set "Rebase" (tick the checkbox)
+
# Set "Rebase" (tick the checkbox)
#Click "OK"
+
# Click "OK"
  
==Configure your preferences==
+
= 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.
 
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.
  
#Go to <code>Window->Preferences...</code> (or <code>Eclipse->Preferences...</code> on a Mac)
+
# Go to <code>Window->Preferences...</code> (or <code>Eclipse->Preferences...</code> on a Mac)
#Navigate to <code>Team->Git->Configuration</code>
+
# Navigate to <code>Team->Git->Configuration</code>
#Under "User settings" check if there is a "user" field with "name" and "email" sub-fields.  
+
# Under "User settings" check if there is a "user" field with "name" and "email" sub-fields.  
##If the fields are present and the values correct, nothing needs to be done.
+
## If the fields are present and the values correct, nothing needs to be done.
##If the fields are present and the values are incorrect, edit them by clicking on the value.
+
## If the fields are present and the values are incorrect, edit them by clicking on the value.
##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.
+
## 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.
 
To be able to compile Xtend code from the code generator, the Eclipse editors must be set to use UTF-8 encoding.
  
#Go to <code>Window->Preferences...</code> (or <code>Eclipse->Preferences...</code> on a Mac)
+
# Go to <code>Window->Preferences...</code> (or <code>Eclipse->Preferences...</code> on a Mac)
#Navigate to <code>General->Workspace</code>
+
# Navigate to <code>General->Workspace</code>
#Under "Text file encoding" check that it is UTF-8. If not, select UTF-8 from the listbox and click OK.
+
# 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.
 
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.
  
#Go to <code>Window->Preferences...</code> (or <code>Eclipse->Preferences...</code> on a Mac)
+
# Go to <code>Window->Preferences...</code> (or <code>Eclipse->Preferences...</code> on a Mac)
#Navigate to <code>Java->Editor->Save Actions</code>
+
# Navigate to <code>Java->Editor->Save Actions</code>
#Ensure that "Perform the selected actions on save" is unchecked.  
+
# Ensure that "Perform the selected actions on save" is unchecked.  
  
==Generate code for EMF models==
+
= 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:
 
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:
  
 
* <code>org.eclipse.papyrusrt.xtumlrt.common.model</code>
 
* <code>org.eclipse.papyrusrt.xtumlrt.common.model</code>
* <code>org.eclipse.papyrusrt.xtumlrt.platform.model</code>
+
* <code>org.eclipse.papyrusrt.xtumlrt.statemach.model</code>
* <code>org.eclipse.papyrusrt.xtumlrt.platform.cpp.model</code>
+
* <code>org.eclipse.papyrusrt.xtumlrt.statemach.ext.model</code>
 
* <code>org.eclipse.papyrusrt.xtumlrt.umlrt.model</code>
 
* <code>org.eclipse.papyrusrt.xtumlrt.umlrt.model</code>
  
 
To generate these source code you need to do the following for each of these projects:
 
To generate these source code you need to do the following for each of these projects:
  
#Open the project <code>org.eclipse.papyrusrt.xtumlrt.XXXX.model</code>
+
# Open the project <code>org.eclipse.papyrusrt.xtumlrt.XXXX.model</code>
#Open the folder model
+
# Open the folder model
#Open the file called <code>XXXX.genmodel</code> (e.g. <code>common.genmodel</code>)
+
# Open the file called <code>XXXX.genmodel</code> (e.g. <code>common.genmodel</code>)
#A tree editor appears, showing the root element. Right-click on the root element.
+
# A tree editor appears, showing the root element. Right-click on the root element.
#Select "Generate Model Code"
+
# Select "Generate Model Code"
  
Once you finish, you might want to do a clean build: <code>Project -> Clean...</code>.
+
= Generate Xtext artifacts =
 +
 
 +
# Go to the <code>org.eclipse.papyrusrt.xtumlrt.xtext</code> project
 +
# Navigate to the <code>src/org.eclipse.papyrusrt.xtumlrt.xtext</code> folder
 +
# Right-click on the <code>Tumlrt.xtext</code> file
 +
# Select <code>Generate Xtext Artifacts</code>
 +
# In the console window it may ask you if you agree to download and install ANTLR (the parser generator). Type 'y' (for yes).
 +
 
 +
= Clean all =
 +
 
 +
Once you finish, do a clean build: <code>Project -> Clean...</code> and select all projects.
  
 
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.
 
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.
 +
 +
* If you are working on the code generator or runtime, you may choose to close (or remove from your workspace) all the tooling projects (their name starts with <code>org.eclipse.papyrusrt.umlrt</code>.
 +
* If you are working on the tooling, you may close all the code generator projects (their name starts with <code>org.eclipse.papyrusrt.codegen</code> and <code>org.eclipse.papyrusrt.xtumlrt</code>). However, you may still need to import several projects from the Papyrus repository to resolve compilation errors.
 +
* You may also choose to close or remove the test models (their name does not have a prefix).
 +
 +
 +
= Define run/debug configurations (optional) =
 +
 +
To quickly launch PapyrusRT either as an Eclipse product or as a stand-alone generator, it is convenient to define debug/run configurations. This can be done by selecting <code>Run->Run Configurations...</code> or <code>Run->Debug Configurations...</code>. Below, we describe the settings for an Eclipse-based run, and for a stand-alone run.
 +
 +
== Eclipse-based run/debug configuration ==
 +
 +
On the left pane select "Eclipse Application" and click the <code>New</code> button.
 +
 +
* On top, enter the name for the new run configuration, e.g. "papyrusrt".
 +
* On the Main tab:
 +
** Under "Workspace Location" choose a location of your preference.
 +
** Under "Program to Run" select "Run a product" and choose <code>org.eclipse.sdk.ide</code>
 +
** Under "Execution Environment" choose Java 1.7
 +
* On the Arguments tab:
 +
** Under "VM Arguments" add <code>-XX:MaxPermSize=512m -Xms512m -Xmx2048m</code>
 +
 +
== Standalone run/debug configuration ==
 +
 +
On the left pane select "Java Application" and click the <code>New</code> button.
 +
* On top, enter the name for the new run configuration, e.g. "papyrusrt - standalone".
 +
* On the Main tab:
 +
** Under "Project" select <code>org.eclipse.papyrusrt.codegen.standalone</code>
 +
** Under "Main class" select <code>org.eclipse.papyrusrt.codegen.standalone.StandaloneUMLRTCodeGenerator</code>
 +
* On the Arguments tab:
 +
** Under "Program Arguments" enter
 +
:::-d -l ALL -s -p ''<path-to-eclipse-plugins-folder>'' -o ''<output-folder>'' ''<input-model>''
 +
 +
where
 +
 +
The ''<input-model>'' is the <code>.uml</code> file.
 +
 +
Flags:
 +
 +
::*-d : debug mode
 +
::*-l ALL : log all messages (debug, info, warning, error)
 +
::*-s : print the stack trace in case of an exception
 +
::*-p ''<path-to-eclipse-plugins-folder>'' : specify the ''<path-to-eclipse-plugins-folder>'' which can be a ':' separated list. It's useful to include the <code>plugins/umlrt</code> folder of your local git repository (e.g. .../git/org.eclipse.papyrus-rt/plugins/umlrt)
 +
::*-o ''<output-folder>'' : The ''<output-folder>'' can be any folder. It's a good idea to make it specific for your model.

Latest revision as of 13:03, 17 November 2016

PapyrusForRealTime-Logo-Icon.png

Setting up the Mars Development Environment


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. Install Java 1.7 (other Java versions may cause trouble) from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
  2. Download the plain Eclipse SDK 4.5 (Mars) from http://download.eclipse.org/eclipse/downloads/, selecting the one specific to your development platform.
  3. Decompress the archive in some target folder. For example: ~/dev/papyrusrt
  4. Start Eclipse
  5. Go to Preferences -> Java -> Installed JRE and select one that is 1.7
  6. Go to Preferences -> Java -> Compiler and under "Compiler compliance level" select 1.7


Installing required development features

Adding required update sites

Go to Help -> Install New Software..., and add each of the following update sites (by clicking on the Add... button).

Name Location
Xtext http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/
Papyrus releases - mars http://download.eclipse.org/modeling/mdt/papyrus/updates/releases/mars/
PapyrusRT releases - mars http://download.eclipse.org/papyrus-rt/updates/releases/mars/
PapyrusRT codegen/rts nightly - mars http://download.eclipse.org/papyrus-rt/builds/nightly/
PapyrusRT tooling/profile nightly - mars https://hudson.eclipse.org/papyrus-rt/job/Papyrus-RT-Master-All/lastSuccessfulBuild/artifact/repository/
Note.png
  • The Xtext update site is needed in order to obtain the required version 2.9 as the Eclipse Mars update site only has version 2.8.4
  • The different PapyrusRT repositories will give you the possibility of installing allow you to install features depending on what part of PapyrusRT you want to work on.


Installing the required features

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:
    • EMF Eclipse Modeling Famework SDK 2.11.1 or newer (found under 'Modeling')
    • C/C++ Development Tools 8.8.0 or newer (found under 'Programming Languages')
    • EGit Team Provider 4.0.3 or newer (found under 'Collaboration')
  • From the Xtext update-site:
    • Xtext Complete SDK 2.9.1 or newer (found under 'Xtext')
    • Xtext Redistributable 2.9.1 or newer (found under 'Xtext')
  • From the Papyrus releases - mars update-site:
    • Papyrus UML 1.1.3 or newer (under 'Papyrus')
    • Papyrus UML Developer Resources 1.1.3 or newer (under 'Papyrus')
    • Papyrus C++ profile, view and and code generation (Incubation) 1.1.3 or newer (under 'Papyrus Extras (Other)')
    • Papyrus C++ profile, view and code generation Developer Resources (Incubation) 1.1.3 or newer (under 'Papyrus Extras (Other)')
  • From the PapyrusRT releases - mars update-site:
    • Papyrus RT Core Feature (Incubation) 0.7.2 or newer
    • Papyrus RT Core Feature (Incubation) Developer Resources 0.7.2 or newer
    • Papyrus RT Feature (Incubation) 0.7.2 or newer
    • Papyrus RT Feature (Incubation) Developer Resources 0.7.2 or newer
    • Papyrus RT Profile Feature (Incubation) 0.7.2 or newer
    • Papyrus RT Profile Feature (Incubation) Developer Resources 0.7.2 or newer
    • Papyrus RT Tooling Feature (Incubation) 0.7.2 or newer
    • Papyrus RT Tooling Feature (Incubation) Developer Resources 0.7.2 or newer
Note.png
You can install the tooling features from the PapyrusRT tooling/profile nightly update site if you prefer.


Optional features (recommended)

The following features, found in the "Mars" releases update-site, 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.1 or newer (found under 'Modeling'; aka EcoreTools; includes Sirius)
    • Mylyn Task List 3.17.0 or newer (under 'Collaboration')
    • Mylyn Task-Focused Interface 3.17.0 or newer (under 'Collaboration')
    • Mylyn Tasks Connector: Bugzilla 3.17.0 or newer (under 'Collaboration')
    • Mylyn Tasks Connector: Gerrit 3.17.0 or newer (under 'Collaboration')
    • Eclipse XML Editors and Tools 3.7.1 or newer (found under 'Programming Languages' and 'Web, XML, Java EE and OSGi Enterprise Development')
    • m2e - Maven Integration for Eclipse 1.6.2 or newer (under 'General Purpose Tools')

Clone the repositories

You need to clone the PapyrusRT repository (https://git.eclipse.org/r/papyrus-rt/org.eclipse.papyrus-rt.git), and optionally the Papyrus repository (http://git.eclipse.org/gitroot/papyrus/org.eclipse.papyrus.git) if you want to work on the tooling side.

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 if you clone the Papyrus repository 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 PapyrusRT repository

The following needs to be provided:

URI 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.
  1. Click the Next button.
  2. Select the appropriate branch. For most users it should be only the "master" branch. You can clone all branches if you like.
  3. Click the Next button.
  4. Select a target directory where the git cloned local repository will be stored.
  5. 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.
  6. Click the Finish button.
Note.png
  • The protocol is https rather than http, and the repository path begins with /r/ rather than /gitroot/.
  • 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.


Clone the Papyrus repository (optional)

You don't need the Papyrus git repository but it may be useful, specially if you are going to work on the tooling side of PapyrusRT.

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.
  1. Click the Next button.
  2. Select the appropriate branch. For most users it should be only the "streams/1.1-maintainance" branch for the Mars release (the master branch is for the Neon release).
  3. Click the Next button.
  4. Select a target directory where the git cloned local repository will be stored.
  5. Click the Finish button.
Note.png
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.


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.statemach.model
  • org.eclipse.papyrusrt.xtumlrt.statemach.ext.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"

Generate Xtext artifacts

  1. Go to the org.eclipse.papyrusrt.xtumlrt.xtext project
  2. Navigate to the src/org.eclipse.papyrusrt.xtumlrt.xtext folder
  3. Right-click on the Tumlrt.xtext file
  4. Select Generate Xtext Artifacts
  5. In the console window it may ask you if you agree to download and install ANTLR (the parser generator). Type 'y' (for yes).

Clean all

Once you finish, do a clean build: Project -> Clean... and select all projects.

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.

  • If you are working on the code generator or runtime, you may choose to close (or remove from your workspace) all the tooling projects (their name starts with org.eclipse.papyrusrt.umlrt.
  • If you are working on the tooling, you may close all the code generator projects (their name starts with org.eclipse.papyrusrt.codegen and org.eclipse.papyrusrt.xtumlrt). However, you may still need to import several projects from the Papyrus repository to resolve compilation errors.
  • You may also choose to close or remove the test models (their name does not have a prefix).


Define run/debug configurations (optional)

To quickly launch PapyrusRT either as an Eclipse product or as a stand-alone generator, it is convenient to define debug/run configurations. This can be done by selecting Run->Run Configurations... or Run->Debug Configurations.... Below, we describe the settings for an Eclipse-based run, and for a stand-alone run.

Eclipse-based run/debug configuration

On the left pane select "Eclipse Application" and click the New button.

  • On top, enter the name for the new run configuration, e.g. "papyrusrt".
  • On the Main tab:
    • Under "Workspace Location" choose a location of your preference.
    • Under "Program to Run" select "Run a product" and choose org.eclipse.sdk.ide
    • Under "Execution Environment" choose Java 1.7
  • On the Arguments tab:
    • Under "VM Arguments" add -XX:MaxPermSize=512m -Xms512m -Xmx2048m

Standalone run/debug configuration

On the left pane select "Java Application" and click the New button.

  • On top, enter the name for the new run configuration, e.g. "papyrusrt - standalone".
  • On the Main tab:
    • Under "Project" select org.eclipse.papyrusrt.codegen.standalone
    • Under "Main class" select org.eclipse.papyrusrt.codegen.standalone.StandaloneUMLRTCodeGenerator
  • On the Arguments tab:
    • Under "Program Arguments" enter
-d -l ALL -s -p <path-to-eclipse-plugins-folder> -o <output-folder> <input-model>

where

The <input-model> is the .uml file.

Flags:

  • -d : debug mode
  • -l ALL : log all messages (debug, info, warning, error)
  • -s : print the stack trace in case of an exception
  • -p <path-to-eclipse-plugins-folder> : specify the <path-to-eclipse-plugins-folder> which can be a ':' separated list. It's useful to include the plugins/umlrt folder of your local git repository (e.g. .../git/org.eclipse.papyrus-rt/plugins/umlrt)
  • -o <output-folder> : The <output-folder> can be any folder. It's a good idea to make it specific for your model.

Back to the top