Skip to main content
Jump to: navigation, search

Difference between revisions of "ETrice/Development/GettingStartedWithEtrice"

(Local Build and Tests)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Quick Development Setup =
+
= Oomph eTrice Setup =
# Java Setup
+
#* Lastest [http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html Java SE Development Kit 7 - JDK 7] (recommended 64bit)
+
# Eclipse Setup
+
#* [https://www.eclipse.org/downloads/packages/release/Luna/SR2 Eclipse Luna SR2] (recommended Modeling Tools)
+
#* Download [http://git.eclipse.org/c/etrice/org.eclipse.etrice.git/plain/team/LunaSoftwareItems.p2f LunaSoftwareItems.p2f] to install plugins (Import -> Install -> Install Software Items from File)
+
# Clone eTrice sources into workspace (see [[ETrice/Development/Repository |Git and eTrice]])
+
# (To be added) Settings
+
  
 +
Prerequisites: Java 1.8 (for developers preferably a JDK).
  
----
+
1. Download and run [https://wiki.eclipse.org/Eclipse_Installer Oomph installer] in ''Advanced Mode''
 +
[[File:eTrice_oomph_advancedMode.png|thumbnail|upright|center]]
  
  
= Development Setup with with all eTrice features =
+
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]
# get the sources ([[ETrice/Development/Repository |see how]])
+
# download the [http://www.eclipse.org/downloads/packages/eclipse-modeling-tools/lunasr2 Eclipse Modeling Tools package] from Luna SR2
+
# start Eclipse
+
# Install additional Plugins (if not already installed)
+
## might be already there: Apache Commons IO for file operations (e.g. for incremental code generator)
+
### Help -> Install New Software : http://download.eclipse.org/tools/orbit/downloads/drops/R20130118183705/repository/ (the link is a p2 update site of Orbit)
+
### Apache Commons IO 2.0.1
+
## Google Guava (needed for Kieler Plugins)
+
### Help -> Install New Software : Guava - http://guava-osgi.googlecode.com/svn/trunk/repository/
+
### deselect "show only the latest versions of available software", because we need an older version
+
### select Guava 8.0.0
+
## Kieler for automatic layout of graphical editors
+
### Help -> Install New Software : http://download.eclipse.org/etrice/KIELER/kieler-0.7.1
+
### if "there are no categorized items" in the list, de-select "Group items by category" -> do not forget to -> select after installation
+
### select all Kieler Plugins
+
# import all projects from your local GIT clone to your Workspace (with EGit plugin)
+
## Git Repositories View
+
## Add Repository (local GIT clone)
+
## Context Menu of Working Directory -> Import Projects
+
## Import all Projects
+
# make sure you are using a JDK (in Eclipse: Window->Preferences->Java->Installed JREs->e.g. jdk1.6.0_24), <b>attention</b>: do not use jdk1.6.0_18 or jdk1.6.0_22!
+
  
= Working in the Runtime Workspace =
+
3. Optional for commiters: set your git ssh key
* start the runtime workspace: org.eclipse.etrice.core.room.ui -> eTrice-rt.launch (contextmenu -> Run As)
+
[[File:eTrice_oomph_etrice_ssh.png|thumbnail|upright|center]]
* follow the steps in the Tutorials chapter of the eTrice online help (use Eclipse: Help > Help Contents or view the 0.3 documentation in [http://eclipse.org/etrice/documentation/doc/etrice-doc.html HTML] or as [http://eclipse.org/etrice/documentation/manual/etrice.pdf PDF])
+
  
= Deriving from an Existing Generator =
 
  
There is a minimal example that shows how a generator can be derived from the existing eTrice Java generator.
+
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
The example shows how the derived DetailCodeTranslator handles an additional tag.
+
[[File:eTrice_oomph_eTriceSetup.png|thumbnail|upright|center]]
  
The example consist of two plugins:
 
* examples/my.etrice.generator
 
* examples/my.etrice.generator.launch
 
You will find the examples in the eTrice GIT repository: http://git.eclipse.org/c/etrice/org.eclipse.etrice.git/tree/examples
 
  
The first one overrides the Java generator, the second one overrides the Java launch configuration to launch the derived generator.
+
6. Configure your personal installation
Please have a look at the comments marked with ''EXAMPLE:'' (you can add that as a Java task tag in the preferences and use the Tasks View to locate these comments).
+
[[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.
 +
 
 +
= Linux =
 +
 
 +
After cloning in Linux you will need to make gradlew executable
 +
 
 +
<code>
 +
chmod u+x gradlew
 +
</code>
 +
 
 +
and convert the line endings from DOS to Unix style
 +
 
 +
<code>
 +
sed -i.bak 's/\r$//' gradlew
 +
</code>
  
 
[[Category:eTrice]]
 
[[Category:eTrice]]

Latest revision as of 13:50, 26 March 2020

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.

Linux

After cloning in Linux you will need to make gradlew executable

chmod u+x gradlew

and convert the line endings from DOS to Unix style

sed -i.bak 's/\r$//' gradlew

Back to the top