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 "EMF Compare/Contributor Guide"

(Developping EMF Compare patches or code)
(Developing a new feature)
(35 intermediate revisions by 4 users not shown)
Line 2: Line 2:
  
 
==Environment==
 
==Environment==
 +
 +
* Java
 +
: EMF Compare is built against Java 1.6. Though it is compatible with later versions and will thus run flawlessly on 1.6 and 1.7 virtual machines, development should make use of 1.6 APIs and avoid any reference to more recent code so as to prevent compilation errors.
  
 
* Eclipse
 
* Eclipse
Developing on EMF Compare requires the use of Eclipse 3.5 (Galileo) at least, though it is possible to use the latest releases as well.
+
: Developing on EMF Compare requires the use of Eclipse 3.5 (Galileo) at least, though it is possible to use the latest releases as well.
It can be obtained through the [http://download.eclipse.org/eclipse/downloads/ Eclipse download page]. The easiest way to set up your environment is to download the Eclipse Modeling Tools bundle since it will already contain most of our dependencies, except for Guava.
+
: It can be obtained through the [http://download.eclipse.org/eclipse/downloads/ Eclipse download page]. The easiest way to set up your environment is to download the Eclipse Modeling Tools bundle since it will already contain most of our dependencies, except for Guava.
  
All of the following can be obtained through the simultaneous release's update site. From the Eclipse you've installed, use the ''Help > Install New Software...'' menu. In the dialog that pops up, locate the update site of your release (it should be labelled ''Eclipse <name of release> Repository''). The list that loads below will contain the necessary projects that you just have to install.
+
: All of the following can be obtained through the simultaneous release's update site. From the Eclipse you've installed, use the ''Help > Install New Software...'' menu. In the dialog that pops up, locate the update site of your release (it should be labelled ''Eclipse <name of release> Repository''). The list that loads below will contain the necessary projects that you just have to install.
  
We'll go through how to obtain them separately.
+
: We'll go through how to obtain them separately.
  
 
* Guava
 
* Guava
EMF Compare depends on version 10 of google's Guava library. It can be installed from the [http://download.eclipse.org/tools/orbit/downloads/drops/R20120526062928/repository/ Orbit update site]. Do note that EMF Compare is not compatible with version 11 or higher of Guava.
+
: EMF Compare depends on version 11 of google's Guava library. It can be installed from the [http://download.eclipse.org/tools/orbit/downloads/drops/S20130308121626/repository/ Orbit update site]. Do note that EMF Compare should also be compatible with versions 12 to 14 of Guava.
  
 
* EMF
 
* EMF
EMF Compare heavily relies on EMF and requires version 2.5 at least. We recommend using the SDK so as to have access to the sources as well.
+
: EMF Compare heavily relies on EMF and requires version 2.5 at least. We recommend using the SDK so as to have access to the sources as well.
Get it from the [http://www.eclipse.org/modeling/emf/downloads/?project=emf EMF downloads page].
+
: Get it from the [http://www.eclipse.org/modeling/emf/downloads/?project=emf EMF downloads page].
  
 
== Checking out the code ==
 
== Checking out the code ==
Line 25: Line 28:
 
The repository contains three folders at its root :
 
The repository contains three folders at its root :
  
*'''org.eclipse.emf.compare-parent''' is a non-code plugin which serves as the location of our parent pom. It otherwise contains our target platforms, checkstyle and formatter configuration...
+
*'''org.eclipse.emf.compare-parent''' is a non-code plugin which serves as the location of our parent pom. It otherwise contains our target platforms and code style. You will need this plugin in your workspace whatever you work on as it holds the checkstyle configuration of our plugins (see [[#Checkstyle|Checkstyle]] below).
 
*'''packaging''' contains all of our features as well as the project's update site.
 
*'''packaging''' contains all of our features as well as the project's update site.
 
*'''plugins''' contains the actual plugins of EMF Compare. More on these below.
 
*'''plugins''' contains the actual plugins of EMF Compare. More on these below.
Line 44: Line 47:
  
 
* ''o.e.e.c.edit''
 
* ''o.e.e.c.edit''
 +
* ''o.e.e.c.rcp''
 
* ''o.e.e.c.ide''
 
* ''o.e.e.c.ide''
* ''o.e.e.c.ide.ui''
 
 
* ''o.e.e.c.rcp.ui''
 
* ''o.e.e.c.rcp.ui''
 +
* ''o.e.e.c.ide.ui''
  
 
The unit tests of the EMF Compare user interface require SWTBot :
 
The unit tests of the EMF Compare user interface require SWTBot :
Line 87: Line 91:
 
* ''o.e.e.c.diagram.ecoretools.tests''
 
* ''o.e.e.c.diagram.ecoretools.tests''
 
* ''o.e.e.c.diagram.ide.ecoretools.tests''
 
* ''o.e.e.c.diagram.ide.ecoretools.tests''
 +
 +
== Building the code ==
 +
 +
Go the the '''org.eclipse.emf.compare-parent''' folder and just do a
 +
  mvn clean package
 +
 +
If you would like to import projects in your workspace and let Eclipse build it, you will also find several <code>.target</code> files in this project to configure your target platform. We recommend you use the one you are primarily targeting to install EMF Compare. If you don't know what is a Target Platform, we suggest you to read [http://wiki.eclipse.org/PDE/Target_Definitions this description] and the documentation of the [http://help.eclipse.org/juno/topic/org.eclipse.pde.doc.user/guide/tools/editors/target_editor/target_editor.htm target definition file edtitor].
 +
 +
If you don't want to build EMF Compare by yourself, you have access to the lastest successful build bits from [https://hudson.eclipse.org/hudson/view/Modeling/job/emf-compare-master/lastSuccessfulBuild/artifact/packaging/org.eclipse.emf.compare.update/target/ Hudson] and the promoted nightly and integration builds on the [http://www.eclipse.org/emf/compare/downloads/ EMF Compare download page].
  
 
== Developing EMF Compare patches or code  ==
 
== Developing EMF Compare patches or code  ==
 +
 +
=== Developing a new feature ===
 +
 +
When a new feature is to be developed, it should be announced to the community with the following messages:
 +
 +
* Open a feature enhancement bug on the bugzilla describing the new feature.
 +
* Create a specification page on the wiki following the [[EMF_Compare/Specifications/Template|provided template]]. A link to the bugzilla should be added to this page and a reference to this page should be added in a comment of the bugzilla. The name of the wikipage should be <code>EMF_Compare/Specification/DescribingTitle</code>. Te page should be added to the category Category:EMF Compare/Specification (Add <nowiki>[[Category:EMF Compare/Specification]]</nowiki> text at the bottom of the page).
 +
* Announce that the development has started for this feature on the [http://dev.eclipse.org/mhonarc/lists/emf-dev/ developers mailling list] and provide a link to the previously created bugzilla and the specification wiki page.
 +
 +
When the feature is completed, the community should be told:
 +
 +
* Add a comment to the bugzilla with a reference to the commit(s) and/or gerrit review(s) in which the feature has been implemented, completed.
 +
* Close the bug.
 +
* Mark the specification as ACCEPTED until the documentation has been updated and mark it as ARCHIVED once done.
  
 
=== Specifications  ===
 
=== Specifications  ===
Line 94: Line 121:
 
Every new feature or major change should be documented in a short specification, the template is [[EMF_Compare/Specifications/Template|available here]]
 
Every new feature or major change should be documented in a short specification, the template is [[EMF_Compare/Specifications/Template|available here]]
  
=== Checkstyle ===
+
=== Target Platform ===
  
The EMF Compare team uses Checkstyle with its own set of rules in order to have an homogeneous code style throughout the plugins and features.  
+
EMF Compare is downward compatible with Eclipse Galileo (3.5). Target platforms for Galileo (Eclipse 3.5), Helios (Eclipse 3.6), Indigo (Eclipse 3.7), Juno (Eclipse 4.2) and Kepler (Eclipse 4.3) are provided within the ''org.eclipse.emf.compare-parent'' plugin.
  
The Eclipse plugin for Checkstyle can be downloaded on [http://eclipse-cs.sourceforge.net/ sourceforge]. Once installed, it will be automatically applied to all existing EMF Compare plugins as they are already configured to use it. New projects can use the same set of rule&nbsp;:
+
The target platform can be set through the preference page accessible via ''Window => Preferences => Plug-in Development => Target Platform''. More information on how to set a target platform for development can be found in the [http://help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.pde.doc.user/guide/tools/preference_pages/target_platform.htm Eclipse help].
  
*Right-click on the project which has to be checked through Checkstyle and select "Properties".  
+
Please also double check that you use JDK 6 APIs. EMF Compare is built against Java 6 and will show compilation errors if using later APIs.
*In the "Checkstyle" category, go to the "Local Checkstyle configuration" tab
+
*Hit "New" and select "project-relative configuration" from the "type" drop down menu. Set the name of this configuration as you see fit ("EMF Compare" for example) and click the "Open..." button for the localisation.
+
*Browse to "org.eclipse.emf.compare/codeStyle" and select EMFCompareCheckstyleConfiguration.xml. Select "Ok" twice to end this wizard.
+
*Go back to the "General" tab, then tick "Activate Checkstyle on this project"
+
*In the drop-down below, select the configuration you just created, the click OK to close the properties dialog.
+
*That's it&nbsp;: your project will now go through the EMF Compare Chekstyle rules on each compilation.
+
  
Note that Checkstyle errors are not considered fatal compilation errors&nbsp;: you can still run code with checkstyle errors. Nearly each of EMF Compare check is set to report an error though, as we always try and comply to these rules.
+
=== Contributing the patch ===
  
=== Code Formatting  ===
+
When you are ready to contribute the patch, you can push it for review. The EMF Compare Team uses Gerrit to simplify the review and feedback process, please follow the instructions on [[EMF_Compare/Gerrit|The dedicated Page]].
  
At first, most of the checkstyle errors that will be reported will probably be formatting errors&nbsp;: you can configure your formatter to use EMF Compare configuration to avoid these.
+
=== Planning ===
  
*Click on Window =&gt; Preferences
+
We keep the [http://www.eclipse.org/projects/project-plan.php?projectid=modeling.emf.compare project plan] up to date thanks to bugzilla queries. Be sure to specify the version on which the bug occurred and the target milestone you are planning to close that bug.
*Browse to the "Java =&gt; Code Style =&gt; Formatter" category and click on the "Import" button
+
*Browse to the "&lt;workspace&gt;/org.eclipse.emf.compare/codeStyle" directory and select "EMFCompareformatter.xml"
+
*hit Ok twice to close the preferences dialog
+
  
Your formatter will now comply to EMF Compare code style. Hitting ctrl+shift+F in a java editor will format your class to follow this style.
+
= Code Style =
  
''Note'' that all EMF Compare plugins are already configured to make use of this formatter
+
== Copyright ==
  
=== Java ===
+
Every new Java file should contain a copyright as its very first lines. Copyrights should match the following form, adapted according to the contributor's company (or his own name if he is the copyright holder himself).
  
EMF Compare is built against Java 1.5&nbsp;: usage of the JDK 1.6 API will result in build errors and should be avoided.  
+
/*******************************************************************************
 +
  * Copyright (c) 2012 Obeo.
 +
  * All rights reserved. This program and the accompanying materials
 +
  * are made available under the terms of the Eclipse Public License v1.0
 +
  * which accompanies this distribution, and is available at
 +
  * http://www.eclipse.org/legal/epl-v10.html
 +
  *
 +
  * Contributors:
 +
  *    Obeo - initial API and implementation
 +
  *******************************************************************************/
  
=== Target Platform ===
+
When modifying a Java file which existing copyright does not match the contributor's, the copyright should be modified to reflect it.
 +
 
 +
/*******************************************************************************
 +
* Copyright (c) 2012 Obeo''' and others'''.
 +
* All rights reserved. This program and the accompanying materials
 +
* are made available under the terms of the Eclipse Public License v1.0
 +
* which accompanies this distribution, and is available at
 +
* http://www.eclipse.org/legal/epl-v10.html
 +
*
 +
* Contributors:
 +
*    Obeo - initial API and implementation
 +
*    '''Luca Lashnikov - bug xxxxxx (or very simple description of the change if no related bug)'''
 +
*******************************************************************************/
 +
 
 +
When modifying an older file which copyright's year range does not match the current, its first line should be updated to contain the year of the change :
 +
 
 +
Copyright (c) 2012''', 2013''' Obeo.
 +
 
 +
== Checkstyle ==
 +
 
 +
The EMF Compare team uses Checkstyle with its own set of rules in order to have an homogeneous code style throughout the plugins and features.
 +
 
 +
The Eclipse plugin for Checkstyle can be downloaded on [http://eclipse-cs.sourceforge.net/ sourceforge]. EMF Compare makes use of Checkstyle 5.*. Once installed, it will be automatically applied to all existing EMF Compare plugins as they are already configured to use it.
 +
 
 +
'''You need to have the ''org.eclipse.emf.compare-parent'' plugin in your workspace.'''
 +
 
 +
New projects should use the same set of rules :
 +
 
 +
# Right-click on the project on which to configure Checkstyle and select "Properties",
 +
# In the "Checkstyle" category, go to the "Local Checkstyle configuration" tab,
 +
# Hit "New" and select "project-relative configuration" from the "type" drop down menu. Set the name of this configuration as you see fit ("EMF Compare" for example) and click the "Open..." button for the localisation.
 +
# Browse to "org.eclipse.emf.compare-parent/codeStyle" and select ''EMFCompareCheckstyle5Configuration.xml''. Hit "Ok" twice to end this wizard.
 +
# Go back to the "General" tab, then tick "Activate Checkstyle on this project"
 +
# In the drop-down below, select the configuration you just created, then click OK to close the properties dialog.
 +
# That's it. Your project will now go through the EMF Compare Chekstyle rules on each compilation.
 +
 
 +
Note that Checkstyle errors are not considered fatal compilation errors : you can still run code with checkstyle errors. Nearly each of EMF Compare check is set to report an error though, as we always try and comply to these rules.
 +
 
 +
== Code Formatting  ==
 +
 
 +
''Note'' that all EMF Compare plugins are already configured to make use of this formatter.
  
We try our best to ensure downward compatibility towards Eclipse Europa, as such we use the following as our target platform&nbsp;:
+
At first, most of the checkstyle errors that will be reported will probably be formatting errors. You can configure your formatter to use the EMF Compare configuration to avoid these.
  
[http://archive.eclipse.org/eclipse/downloads/drops/R-3.3.2-200802211800/index.php Eclipse SDK 3.3.2]
+
# Click on ''Window > Preferences'',
 +
# Browse to the ''Java > Code Style > Formatter'' category and click on the "Import" button,
 +
# Browse to the "<workspace path>/org.eclipse.emf.compare-parent/codeStyle" directory and select "EMFCompareformatter.xml",
 +
# Hit Ok twice to close the preferences dialog.
  
[http://www.eclipse.org/downloads/download.php?file=/modeling/emf/emf/downloads/drops/2.3.2/R200802051830/emf-sdo-xsd-SDK-2.3.2.zip EMF SDK 2.3.2]
+
Your formatter will now comply to EMF Compare code style. Hitting ctrl+shift+F in a java editor will format your class to follow this style.
  
The target platform is added both UML2 and Subversive for maintenance of the examples and the subversive integration feature
+
== API Tooling  ==
  
[http://www.eclipse.org/downloads/download.php?file=/modeling/mdt/uml2/downloads/drops/2.1.1/R200708301304/mdt-uml2-SDK-2.1.1.zip UML2 SDK 2.1.1]
+
The EMF Compare development team uses the [[#Target_Platform|target platform]] augmented with the latest stable EMF Compare build to maintain API compatibility. Checks for API breakages and evolutions are set per project and committed alongside them.
  
[http://www.eclipse.org/downloads/download.php?file=/technology/subversive/0.7/builds/Subversive-incubation-0.7.7.I20090224-1900.zip Subversive 0.7.7 Archived update site]
+
== Extension Points ==
  
The target platform can be set through the preference page accessible via Window =&gt; Preferences =&gt; Plug-in Development =&gt; Target Platform. More information on how to set a target platform for development can be found in the [http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.pde.doc.user/guide/tools/preference_pages/target_platform.htm Eclipse help].  
+
Extension points must be named in camel case (e.g. <code>myExtensionPoint</code>). No pascal case (<code>MyExtensionPoint</code>) nor underscore (<code>my_extension_point</code>).
  
=== API Tooling  ===
+
= Website =
  
The EMF Compare development team uses the [[#Target_Platform|target platform]] augmented with the M6 EMF Compare build to maintain API compatibility. Checks for API breakages and evolutions are set per project and committed alongside them. All of these settings are still soft and don't ensure full API compatibility for now, they will be changed for strict API maintenance as soon as EMF Compare 1.0 is released.
+
[PENDING] git www ...
  
 
[[Category:EMF Compare]]
 
[[Category:EMF Compare]]

Revision as of 05:17, 25 March 2014


EMF Compare
Website
Download
Community
Mailing List
Forums
Bugzilla
Open
Create New
Contribute
Browse Source


Environment

  • Java
EMF Compare is built against Java 1.6. Though it is compatible with later versions and will thus run flawlessly on 1.6 and 1.7 virtual machines, development should make use of 1.6 APIs and avoid any reference to more recent code so as to prevent compilation errors.
  • Eclipse
Developing on EMF Compare requires the use of Eclipse 3.5 (Galileo) at least, though it is possible to use the latest releases as well.
It can be obtained through the Eclipse download page. The easiest way to set up your environment is to download the Eclipse Modeling Tools bundle since it will already contain most of our dependencies, except for Guava.
All of the following can be obtained through the simultaneous release's update site. From the Eclipse you've installed, use the Help > Install New Software... menu. In the dialog that pops up, locate the update site of your release (it should be labelled Eclipse <name of release> Repository). The list that loads below will contain the necessary projects that you just have to install.
We'll go through how to obtain them separately.
  • Guava
EMF Compare depends on version 11 of google's Guava library. It can be installed from the Orbit update site. Do note that EMF Compare should also be compatible with versions 12 to 14 of Guava.
  • EMF
EMF Compare heavily relies on EMF and requires version 2.5 at least. We recommend using the SDK so as to have access to the sources as well.
Get it from the EMF downloads page.

Checking out the code

The code of EMF Compare is located on a git repository. You can check it out with the command :

git clone git://git.eclipse.org/gitroot/emfcompare/org.eclipse.emf.compare.git

The repository contains three folders at its root :

  • org.eclipse.emf.compare-parent is a non-code plugin which serves as the location of our parent pom. It otherwise contains our target platforms and code style. You will need this plugin in your workspace whatever you work on as it holds the checkstyle configuration of our plugins (see Checkstyle below).
  • packaging contains all of our features as well as the project's update site.
  • plugins contains the actual plugins of EMF Compare. More on these below.

The plugins can be further divided in a number of "sets". Depending on what you are planning to do, you might not need to import all of these sets. All of our plugins' name are prefixed with org.eclipse.emf.compare. For the sake of brevity, this prefix will be abbreviated to o.e.e.c in the following.

EMF Compare Core

The core is the bare minimum you need to call for EMF Compare to compare your models. It is meant to be useable in a standalone application and has no adherence whatsoever to the Eclipse platform.

  • org.eclipse.emf.compare is the only plugin of this "set".

Likewise, all of its unit tests are standalone, though they have a wider range of dependencies (most notably, UML2 and emfstore).

  • o.e.e.c.tests

EMF Compare UI

The user interface of EMF Compare is fully integrated within the Eclipse IDE. It is comprised of the following plugins :

  • o.e.e.c.edit
  • o.e.e.c.rcp
  • o.e.e.c.ide
  • o.e.e.c.rcp.ui
  • o.e.e.c.ide.ui

The unit tests of the EMF Compare user interface require SWTBot :

  • o.e.e.c.ide.tests
  • o.e.e.c.ide.ui.tests

UML2 Integration

EMF Compare offers a customized comparison engine for UML models and their specificities. This extension is made of the following plugins :

  • o.e.e.c.uml2
  • o.e.e.c.uml2.edit
  • o.e.e.c.uml2.ide
  • o.e.e.c.uml2.ide.ui
  • o.e.e.c.uml2.tests

GMF Diagrams Comparison

EMF Compare offers a specific customization for GMF models and the graphical display of differences. This extension is implemented within these plugins.

  • o.e.e.c.diagram
  • o.e.e.c.diagram.edit
  • o.e.e.c.diagram.ide
  • o.e.e.c.diagram.ide.ui
  • o.e.e.c.diagram.ui.tests

Specific extensions for some modelers are also available :

Papyrus

  • o.e.e.c.diagram.ide.papyrus
  • o.e.e.c.diagram.ide.ui.papyrus
  • o.e.e.c.diagram.ide.ui.papyrus.tests

EcoreTools

  • o.e.e.c.diagram.ide.ecoretools
  • o.e.e.c.diagram.ide.ui.ecoretools
  • o.e.e.c.diagram.ecoretools.tests
  • o.e.e.c.diagram.ide.ecoretools.tests

Building the code

Go the the org.eclipse.emf.compare-parent folder and just do a

 mvn clean package

If you would like to import projects in your workspace and let Eclipse build it, you will also find several .target files in this project to configure your target platform. We recommend you use the one you are primarily targeting to install EMF Compare. If you don't know what is a Target Platform, we suggest you to read this description and the documentation of the target definition file edtitor.

If you don't want to build EMF Compare by yourself, you have access to the lastest successful build bits from Hudson and the promoted nightly and integration builds on the EMF Compare download page.

Developing EMF Compare patches or code

Developing a new feature

When a new feature is to be developed, it should be announced to the community with the following messages:

  • Open a feature enhancement bug on the bugzilla describing the new feature.
  • Create a specification page on the wiki following the provided template. A link to the bugzilla should be added to this page and a reference to this page should be added in a comment of the bugzilla. The name of the wikipage should be EMF_Compare/Specification/DescribingTitle. Te page should be added to the category Category:EMF Compare/Specification (Add [[Category:EMF Compare/Specification]] text at the bottom of the page).
  • Announce that the development has started for this feature on the developers mailling list and provide a link to the previously created bugzilla and the specification wiki page.

When the feature is completed, the community should be told:

  • Add a comment to the bugzilla with a reference to the commit(s) and/or gerrit review(s) in which the feature has been implemented, completed.
  • Close the bug.
  • Mark the specification as ACCEPTED until the documentation has been updated and mark it as ARCHIVED once done.

Specifications

Every new feature or major change should be documented in a short specification, the template is available here

Target Platform

EMF Compare is downward compatible with Eclipse Galileo (3.5). Target platforms for Galileo (Eclipse 3.5), Helios (Eclipse 3.6), Indigo (Eclipse 3.7), Juno (Eclipse 4.2) and Kepler (Eclipse 4.3) are provided within the org.eclipse.emf.compare-parent plugin.

The target platform can be set through the preference page accessible via Window => Preferences => Plug-in Development => Target Platform. More information on how to set a target platform for development can be found in the Eclipse help.

Please also double check that you use JDK 6 APIs. EMF Compare is built against Java 6 and will show compilation errors if using later APIs.

Contributing the patch

When you are ready to contribute the patch, you can push it for review. The EMF Compare Team uses Gerrit to simplify the review and feedback process, please follow the instructions on The dedicated Page.

Planning

We keep the project plan up to date thanks to bugzilla queries. Be sure to specify the version on which the bug occurred and the target milestone you are planning to close that bug.

Code Style

Copyright

Every new Java file should contain a copyright as its very first lines. Copyrights should match the following form, adapted according to the contributor's company (or his own name if he is the copyright holder himself).

/*******************************************************************************
 * Copyright (c) 2012 Obeo.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     Obeo - initial API and implementation
 *******************************************************************************/

When modifying a Java file which existing copyright does not match the contributor's, the copyright should be modified to reflect it.

/*******************************************************************************

* Copyright (c) 2012 Obeo and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* 
* Contributors:
*     Obeo - initial API and implementation
*     Luca Lashnikov - bug xxxxxx (or very simple description of the change if no related bug)
*******************************************************************************/

When modifying an older file which copyright's year range does not match the current, its first line should be updated to contain the year of the change :

Copyright (c) 2012, 2013 Obeo.

Checkstyle

The EMF Compare team uses Checkstyle with its own set of rules in order to have an homogeneous code style throughout the plugins and features.

The Eclipse plugin for Checkstyle can be downloaded on sourceforge. EMF Compare makes use of Checkstyle 5.*. Once installed, it will be automatically applied to all existing EMF Compare plugins as they are already configured to use it.

You need to have the org.eclipse.emf.compare-parent plugin in your workspace.

New projects should use the same set of rules :

  1. Right-click on the project on which to configure Checkstyle and select "Properties",
  2. In the "Checkstyle" category, go to the "Local Checkstyle configuration" tab,
  3. Hit "New" and select "project-relative configuration" from the "type" drop down menu. Set the name of this configuration as you see fit ("EMF Compare" for example) and click the "Open..." button for the localisation.
  4. Browse to "org.eclipse.emf.compare-parent/codeStyle" and select EMFCompareCheckstyle5Configuration.xml. Hit "Ok" twice to end this wizard.
  5. Go back to the "General" tab, then tick "Activate Checkstyle on this project"
  6. In the drop-down below, select the configuration you just created, then click OK to close the properties dialog.
  7. That's it. Your project will now go through the EMF Compare Chekstyle rules on each compilation.

Note that Checkstyle errors are not considered fatal compilation errors : you can still run code with checkstyle errors. Nearly each of EMF Compare check is set to report an error though, as we always try and comply to these rules.

Code Formatting

Note that all EMF Compare plugins are already configured to make use of this formatter.

At first, most of the checkstyle errors that will be reported will probably be formatting errors. You can configure your formatter to use the EMF Compare configuration to avoid these.

  1. Click on Window > Preferences,
  2. Browse to the Java > Code Style > Formatter category and click on the "Import" button,
  3. Browse to the "<workspace path>/org.eclipse.emf.compare-parent/codeStyle" directory and select "EMFCompareformatter.xml",
  4. Hit Ok twice to close the preferences dialog.

Your formatter will now comply to EMF Compare code style. Hitting ctrl+shift+F in a java editor will format your class to follow this style.

API Tooling

The EMF Compare development team uses the target platform augmented with the latest stable EMF Compare build to maintain API compatibility. Checks for API breakages and evolutions are set per project and committed alongside them.

Extension Points

Extension points must be named in camel case (e.g. myExtensionPoint). No pascal case (MyExtensionPoint) nor underscore (my_extension_point).

Website

[PENDING] git www ...

Back to the top