Skip to main content
Jump to: navigation, search

Difference between revisions of "ETrice/Development/GettingStartedWithEtrice"

m (Local Build and Tests)
 
(50 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= Preconditions =
+
= Oomph eTrice Setup =
* get the sources ([[ETrice/Development/Repository | work with GIT repository ]])
+
* download the latest version of Eclipse Modeling Tools (e.g. http://eclipse.org/downloads/packages/eclipse-modeling-tools-includes-incubating-components/indigom7)
+
* make sure you are using a JDK (in Eclipse: Window->Preferences->Java->Installed JREs->e.g. jdk1.6.0_24), attention: do not use jdk1.6.0_18 or jdk1.6.0_22!
+
* check out all projects from your local GIT clone to your Workspace (with EGit plugin)
+
* build eTrice with our target platform ([[ETrice/Development/TargetPlatform | target platform ]])
+
  
= Getting Started =
+
Prerequisites: Java 1.8 (for developers preferably a JDK).
== Setting up Runtime Workspace ==
+
* start the runtime workspace: org.eclipse.etrice.core.room.ui -> eTrice-rt.launch (contextmenu -> Run As)
+
* check out the runtime projects from your local GIT clone
+
** org.eclipse.etrice.doc.tutorials
+
** org.eclipse.etrice.modellib
+
** org.eclipse.etrice.runtime.java
+
  
== Editing the Model ==
+
1. Download and run [https://wiki.eclipse.org/Eclipse_Installer Oomph installer] in ''Advanced Mode''
* the first model you find in org.eclipse.etrice.doc.tutorials/model/scratch/PingPong.room (doubleclick for editor)
+
[[File:eTrice_oomph_advancedMode.png|thumbnail|upright|center]]
* if the room editor has the focus, you can see all your model elements in the outline view
+
* with a right click on an actor (e.g. MrPingActor) you can
+
** Edit Structure
+
** Edit Behavior
+
* Important: You have to save every "dirty" editor before opening another editor
+
  
== Code Generator ==
 
* org.eclipse.etrice.doc.tutorials -> genAllTutorials.mwe2.launch -> (contextmenu)Run As -> genAllModels.mwe2
 
* you will find the generated code in org.eclipse.etrice.doc.tutorials/src-gen
 
* you can see the instance tree of your actor  org.eclipse.etrice.doc.tutorials/src-gen
 
*
 
SubSystem_PingPong.jpg
 
  
== Run ==
+
2. Select desired Eclipse product + version, e.g. product ''Eclipse IDE for Eclipse Committer'' and version from build config in git: [http://git.eclipse.org/c/etrice/org.eclipse.etrice.git/tree/releng/org.eclipse.etrice.parent/pom.xml Tycho/Maven pom.xml]
* start generated application: org.eclipse.etrice.doc.tutorials/src-gen/PingPong/SubSystem_PingPongRunner.java -> Run As -> Java Application
+
* in the View Console you can see the debugging output of the running model
+
* enter "quit" and <enter> in the Console to stop the running application (you should see ***  T H E  E N D  *** )
+
  
 +
3. Optional for commiters: set your git ssh key
 +
[[File:eTrice_oomph_etrice_ssh.png|thumbnail|upright|center]]
  
== Debug
+
 
 +
4. Download the eTrice setup file [http://git.eclipse.org/c/etrice/org.eclipse.etrice.git/plain/team/ETrice.setup ETrice.setup] and add & select it in the oomph catalog
 +
[[File:eTrice_oomph_eTriceSetup.png|thumbnail|upright|center]]
 +
 
 +
 
 +
6. Configure your personal installation
 +
[[File:eTrice_oomph_etriceConfig.png|thumbnail|upright|center]]
 +
 
 +
 
 +
TODO: add eTrice to official Eclipse catalog
 +
 
 +
= Local Build and Tests =
 +
 
 +
Once you performed the above steps and have checked 'Build Automatically' Eclipse PDE will do the build for you and you will be able to launch a runtime workbench containing the eTrice plug-ins.
 +
 
 +
Junit based tests can be launched directly from Eclipse as usual.
 +
 
 +
However, there are also end-to-end tests for the generators which have to be executed using Gradle. In order to do so you can e.g. execute Gradle from a command shell. On windows it is recommended to substitute the root directory of the eTrice sources with a drive letter (<code>subst X: C:/path/to/etrice/sources</code>).
 +
 
 +
Then execute
 +
 
 +
<code>
 +
gradle --rerun-tasks clean build
 +
</code>
 +
 
 +
To execute a single test, e.g. for runtime.c, excute
 +
 
 +
<code>
 +
gradlew.bat tests:org.eclipse.etrice.runtime.c.tests:build
 +
</code>
 +
 
 +
This will compile, link and execute the tests and finally convert the etu result into an xUnit xml file.
 +
 
 +
[[Category:eTrice]]

Latest revision as of 08:55, 10 May 2019

Oomph eTrice Setup

Prerequisites: Java 1.8 (for developers preferably a JDK).

1. Download and run Oomph installer in Advanced Mode

ETrice oomph advancedMode.png


2. Select desired Eclipse product + version, e.g. product Eclipse IDE for Eclipse Committer and version from build config in git: Tycho/Maven pom.xml

3. Optional for commiters: set your git ssh key

ETrice oomph etrice ssh.png


4. Download the eTrice setup file ETrice.setup and add & select it in the oomph catalog

ETrice oomph eTriceSetup.png


6. Configure your personal installation

ETrice oomph etriceConfig.png


TODO: add eTrice to official Eclipse catalog

Local Build and Tests

Once you performed the above steps and have checked 'Build Automatically' Eclipse PDE will do the build for you and you will be able to launch a runtime workbench containing the eTrice plug-ins.

Junit based tests can be launched directly from Eclipse as usual.

However, there are also end-to-end tests for the generators which have to be executed using Gradle. In order to do so you can e.g. execute Gradle from a command shell. On windows it is recommended to substitute the root directory of the eTrice sources with a drive letter (subst X: C:/path/to/etrice/sources).

Then execute

gradle --rerun-tasks clean build

To execute a single test, e.g. for runtime.c, excute

gradlew.bat tests:org.eclipse.etrice.runtime.c.tests:build

This will compile, link and execute the tests and finally convert the etu result into an xUnit xml file.

Back to the top