The following topics are covered in this tutorial:
- Installation of Eclipse and all necessary plug-ins
- Retrieving the source code for Preesm and related projects
- Execution of Preesm
Prerequisite: Install and Configure git
Note: if you need to work with Graphiti and/or DFTools source code, please read these instructions first.
Follow the instructions of the Eclipse Preparation tutorial to obtain an Eclipse installation, in which you will install all necessary tools for Preesm development.
Install XTend, GEF SDK, Graphiti, Maven, DFTools, ...
- Go to "Help > Install New Software...";
- In "work with:", add a new location named "Preesm" with location "http://preesm.sourceforge.net/eclipse/update-site/"
- Select the "Developper Resources > PREESM Developper Requirements (Meta Feature)"
(this Eclipse feature contains all requirements for developping Preesm)
- Click Next twice, agree on the terms of the license, and click on Finish to install the features. This step will take a few minutes.
- During the installation process, a security warning for unsigned content will appear. Click on OK to continue the installation.
- Restart eclipse to complete the installation.
Import Preesm projects
Clone the following repository (git clone <url>, in the folder where you want to place your local repository):
- Preesm: https://github.com/preesm/preesm.git (https) or firstname.lastname@example.org:preesm/preesm.git (SSH)
Switch to the develop branch (git checkout develop) to get the latest developer version of our source.
Connect your local repository obtained through git clone to your Eclipse workspace
- Window > Perspective > Open Perspective > Other ... then select Git
- Add an existing local repository to this view (GIT button with a green plus symbol), then browes to the local repositories
- Check the box and click on finish.
Import the projects :
- In the Java perspetive, clic on File > Import... then Maven > Existing Maven Projects;
- In the next window, browse to the git repository location (the Preesm root folder);
- The project import wizard should automatically find all the projects;
- Note : releng/* projects are for Release Engineering, and can be omitted.
- Clic on finish.
Compilation of Preesm
For a better user experience in eclipse, we strongly advice that you use the "Plug-In Development" perspective of eclipse. To use this perspective, select "Plug-In Development" in Windows > Open Perspective > Others...
If there still are errors after applying the previous operations, try again to clean, refresh and build the projects.
The Preesm code base respects some coding policy. If you intend to develop within Preesm, we strongly advise you to follow these policy to prevent the continuous integration server to reject your contributions. These policies are simple :
- Follow the checkstyle format provided in the git repository (./releng/VAADER_checkstyle.xml);
- Make sure all the tests run without failure (run 'mvn clean integration-test' in the root folder of the git repository.
To help enforcing the checkstyle format, you can enable the "on-the-fly" checkstyle analyser using the Eclipse plug-in (automatically installed with the meta feature, but not configured), and enable the automatic format and cleanup refactoring tools of Eclipse:
On-the-fly checkstyle feeedback
- Window > Preferences, then on the left list clic on Checkstyle;
- In the "Global Check Configuration" frame, click on new;
- In the opened wizard, set Type to 'Project Relative Configuration', and select the location
and name it as you please (i.e. 'IETR'), then clic on OK;
- Make it the default global configuration by clicking on "Set as Default";
- Click on OK to close the Preference window, rebuild the project if asked;
- Finally select all the projects in the workspace (all Preesm plugins), right-click on them, and select Checkstyle > Activate Checkstyle.
Automatic Format and Cleanup setup
- In any perspective, clic on File > Import ... then General > Preferences
- Browse the Git repository until /releng/ to find the 'VAADER_eclipse_preferences.epf' file;
- Make sur 'Import all' is checked, and click on Finish.
With this setup, checkstyle will show errors directly in the Eclipse editor when some code does not respect the coding policy, and Eclipse offers to fix most of the issues automatically by using the cleanup functionality from the Java perspective (right clic on a Java resource > Source > Clean Up).
Execution of Preesm
In the Java or 'Plug-in Development' perspective, right-click on the 'org.ietr.preesm.ui' plug-in, the clic on Debug As > Eclipse Application. A new Eclipse session is launched that behaves like the one obtained by Preesm users from the update site. The difference is that you can debug and modify code in the first Eclipse and test at the same time in the second Eclipse. You can see the tutorials to learn how to use the second Eclipse, import Preesm projects and test.