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 "Platform/How to Contribute"

(Getting the code into your workspace)
 
(147 intermediate revisions by 31 users not shown)
Line 1: Line 1:
This page is a starting point for where to begin when wanting to contribute to the project. The goal is to educate and to be as up front as possible with expectations so that the process can be as efficient as possible.
+
{{Note|This page may contain outdated information. Please go to https://github.com/eclipse-platform/.github/blob/main/CONTRIBUTING.md for uptodate information.}}
 +
 
 +
This page is a starting point for where to begin when wanting to contribute to the project. The goal is to educate and to be as up front as possible with expectations so that the process can be as efficient as possible.
 
{{Platform UI}}
 
{{Platform UI}}
 
== Bugs==
 
== Bugs==
If you find a bug, log it.  See the FAQ entry [[../FAQ#How_do_I_report_a_bug.3F|"How to Report a Bug"]], and a description of how a [http://borisoneclipse.blogspot.com/2005/10/great-bug-report.html great bug report] looks like. If you find a bug that you think is a duplicate, is not a bug, etc. feel free to comment saying so.
+
If you find an issue file it [here https://github.com/eclipse-platform/.github/issues]. There is a description of how a [http://borisoneclipse.blogspot.com/2005/10/great-bug-report.html great bug report] looks like. If you find a bug that you think is a duplicate, is not a bug, etc. feel free to comment saying so.
  
If wanting to track bug changes in Platform UI there are a few ways:
+
== Bug triage==
* Via email.  If you want to receive email when a bug is logged you can watch the '''Platform-UI-Inbox@eclipse.org''' user.  You will receive email anytime a new bug is logged to this user or an update is made while assigned to this user.  To set this up see Preferences -> Email Preferences -> User Watching.  This will email you for all incoming Platform UI bugs; to follow all changes for Platform UI and IDE for bugs that an individual has not yet taken, watch '''platform-ui-triaged@eclipse.org''' as well.
+
* Via Atom.  You can convert any query in bugzilla to a feed that will update when a matched bug changes.  To convert a search to a feed perform a search and select "Feed" at the bottom of the search results.
+
  
== Contributing Code==
+
If you are interested to help with bug solving, the Eclipse platform project has a huge backlog of existing bug reports. It is often not possible for the committer to re-test all old bug reports. A contributor can re-test bug reports and report if they are already solved. If you want to help in this area, please send a message to the [https://accounts.eclipse.org/mailing-list/platform-dev platform-dev@eclipse.org mailing list].
Whether you're wanting to fix a typo in javadoc or to implement the next whiz bang feature for Platform UI you'll need to know a few things before you contribute code.
+
  
Platform UI has switched to git as its SCM.  For the old CVS instructions, check out [[Platform UI/How to Contribute/CVS]].
+
== Setting up your SDK for code contributions ==
  
=== Getting the code into your workspace ===
+
There are two main ways to prepare your IDE to contribute to the Eclipse Platform.
  
See [[Platform-releng/Git_Workflows#Gerrit_workflow_for_a_committer]].  Even if you are a contributor, the workflows should give you an idea of how to get set up.
+
# Oomph automated SDK setup: Automated installation and updating of SDK and workspace. It makes it easy to contribute to multiple Platform projects. Good for occasional contributors as well as for committers.
 +
# Manual SDK setup: The classic way. Mostly used by committers with custom IDEs.  
  
 +
=== Oomph automated SDK setup ===
  
Our code is now contained in the git repo at
+
If you are interested in contributing with Oomph, read:
git://git.eclipse.org/gitroot/platform/eclipse.platform.ui.git
+
https://<userid>@git.eclipse.org/r/platform/eclipse.platform.ui
+
ssh://<userid>@git.eclipse.org:29418/platform/eclipse.platform.ui
+
  
The Dependency Injection and runtime Eclipse Context code is in
+
* Platform UI: [https://wiki.eclipse.org/Platform_UI/How_to_Contribute/Oomph How to Contribute to Eclipse Platform using Oomph]
git://git.eclipse.org/gitroot/platform/eclipse.platform.runtime.git
+
* Platform SDK: [https://wiki.eclipse.org/Eclipse_Platform_SDK_Provisioning Eclipse Platform SDK Provisioning]
https://<userid>@git.eclipse.org/r/platform/eclipse.platform.runtime
+
ssh://<userid>@git.eclipse.org:29418/platform/eclipse.platform.runtime
+
  
 +
These provisioning setups automatically run all steps and apply all settings from the manual setup. Though additional information in the manual setup still applies, so please have a look at the manual steps too.
  
Use git or [[EGit]] to clone this repo.  See the instructions on setting up your repo for Gerrit for both EGit and/or the command line [[Gerrit#Doing Code Reviews with Gerrit]].
+
=== Manual SDK setup ===
  
If using EGit, see [[Platform-releng/Git Workflows#Clone a repo]] on suggestions on how to clone a repo and set up a branch.
+
The rest of this section explains the manual setup.
  
Our current branches:
+
First, you need to set up your environment. You need to:
  
* master - development towards Luna/4.4
+
# Get an Eclipse SDK
* R4_3_maintenance - fixes for 4.3.x/Kepler service releases
+
# Install the tools we use during development
* R4_2_maintenance - fixes for 4.2.x/Juno service releases
+
# Get the code for Platform UI
* R3_8_maintenance - fixes for 3.8.x/Juno service releases
+
# Use the correct target platform
  
For more information on our development, see [[Platform UI/Git#Development in Juno]]
 
  
Note: we also maintain some E4-specific tools, hosted in the e4 incubator at (supports Gerrit):
+
Active branches
  git://git.eclipse.org/gitroot/e4/org.eclipse.e4.tools.git
+
  
And we support User Assistance (Help) contributions at:
+
Our currently active branches:
git://git.eclipse.org/gitroot/platform/eclipse.platform.ua.git
+
https://<userid>@git.eclipse.org/r/platform/eclipse.platform.ua
+
ssh://<userid>@git.eclipse.org:29418/platform/eclipse.platform.ua
+
  
=== Creating a patch ===
+
* master - development towards the next release
  
Once a Gerrit change set is created, the change set should be posted on the bugzilla it came from so it can be reviewed.
+
=== [1] Get an Eclipse SDK ===
  
The preferred method of contributions is now [[Gerrit]] but we can accept patches on [https://bugs.eclipse.org/bugs bugzilla] or from public git repos as wellPlease see [[Platform-releng/Git Workflows#Create a patch]] for more information on the Eclipse Foundation IP process as it relates to both bugzilla and git repos.
+
To get the required updates from other subprojects it is recommended to use a recent I-Build for the Eclipse SDK for contributions. See http://download.eclipse.org/eclipse/downloads/ for the latest download.
 +
 
 +
=== [2] Install the development tools ===
 +
 
 +
The Eclipse SDK development requires that certain plug-ins are installed in your IDE. The Eclipse platform team provides a file from which these plug-ins can be installed. Download the following file onto your computer: https://raw.githubusercontent.com/eclipse-platform/eclipse.platform.ui/master/releng/org.eclipse.ui.releng/platformUiTools.p2f
 +
 
 +
You can install the plug-ins described by this file by using ''File>Import...>Install>Install Software Items from File''.
 +
 
 +
=== [3] Get the code for Platform UI ===
 +
 
 +
Detailed explanation is available at [https://github.com/eclipse-platform/.github/blob/main/CONTRIBUTING.md GitHub].
 +
 
 +
=== [4] Prepare API tooling ===
 +
 
 +
Eclipse provides rich set of API's.
 +
Read about what an API is and how API's are evolving here:
 +
* https://wiki.eclipse.org/Evolving_Java-based_APIs
 +
* https://wiki.eclipse.org/Evolving_Java-based_APIs_2
 +
 
 +
API changes need to be properly reflected in bundle versions.
 +
Read about this here:
 +
* https://wiki.eclipse.org/Version_Numbering
 +
 
 +
If we contribute code to Eclipse, we always should make sure that our changes do not break API and do not violate version rules!
 +
 
 +
If the commit you want to merge contains an API change, '''before''' merge you should '''always''' load the patch into the IDE and run a clean build on related project.
 +
 
 +
Before doing so you should also make sure API tooling is properly configured. To achieve this you have to have the following preferences set under Window>Preferences:
 +
 
 +
* Plug in Development: tick [x] "Workspace Plug-Ins override target platform plug-ins with the same id"
 +
* Plug in Development: untick [ ] "Disable API analysis builder"
 +
* Plug in Development>Target Platform: This must bet set to "Running Platform" and you are using a recent nightly SDK build.
 +
* Plug in Development>API Baselines: The latest release must be ticked. This must be created manually and point to plain SDK installation of the last official SDK release.
 +
 
 +
If after that you see API errors in the workspace, please consider to read the proposed solution, compare that with the information you can get at [1], [2] and [3] and apply appropriated fix (or "-1" on the Gerrit patch).
 +
 
 +
There can be multiple possible API error fixes proposed by PDE, but only one can be the right one - unfortunately we still require the power of human brain to apply the '''right''' fix.
 +
 
 +
Basic rule is: during a development cycle (e.g. 4.12) we only increment one version segment '''one time''' according to the rules [1], [2] and [3]. Only in case of human errors we have to bump the same version segment
 +
twice (once the wrong version is built and '''published''' we can't simply revert it so we must increase again...).
 +
'''Note''': We never decrement versions if they were already published via official SDK build.
 +
 
 +
Decision about '''which''' bundle version segment to change should be always based on [1], [2] and [3], not just on PDE "quick fix" proposals. In doubt - ask on the [https://accounts.eclipse.org/mailing-list/platform-dev platform-dev mailing list].
 +
 
 +
[1] https://wiki.eclipse.org/Version_Numbering
 +
 
 +
[2] https://wiki.eclipse.org/Evolving_Java-based_APIs
 +
 
 +
[3] https://wiki.eclipse.org/Evolving_Java-based_APIs_2
 +
 
 +
=== [5] Tweaks for after your environment is set up ===
 +
 
 +
'''Running the tests''': you should be able to run a couple of pre-filled launch configs from ''Run>Run Configurations''.
 +
 
 +
'''On Linux''': The launch configs often come with DISPLAY=:1.0. You should either run a vnc server or remove that variable from the environment tab. An example of a $HOME/.vnc/xstartup that works for the Platform UI tests is:
 +
 
 +
#!/bin/sh
 +
 +
# Uncomment the following two lines for normal desktop:
 +
# unset SESSION_MANAGER
 +
# exec /etc/X11/xinit/xinitrc
 +
 +
  [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
 +
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
 +
xsetroot -solid grey
 +
#vncconfig -iconic &
 +
xterm -geometry 80x24+10+10 -sb -sl 5000 -ls -title "$VNCDESKTOP Desktop" &
 +
#gnome-session --sm-disable --failsafe --disable-sound &
 +
 +
exec metacity --replace --sm-disable
 +
 
 +
== Contributing Code==
 +
Whether you're wanting to fix a typo in javadoc or to implement the next whiz bang feature for Platform UI you'll need to know a few things before you contribute code.
 +
 
 +
Platform UI is using Git as version control system.
  
 
=== Unit Testing===
 
=== Unit Testing===
Testing is imperative to the health of the project. We have a significant amount of tests. The quantity of tests will keep growing as more functionality is added to Platform UI. If you are contributing a fix or writing an enhancement, it is a requirement that tests are written. If you don't write them a committer will have to and that could slow down the contribution process.
+
Testing is imperative to the health of the project. We have a significant amount of tests. The quantity of tests will keep growing as more functionality is added to Platform UI. If you are contributing a fix or writing an enhancement, it is a requirement that tests are written. If you don't write them a committer will have to and that could slow down the contribution process.  
  
 
There are a couple of things that you should know about our testing process:
 
There are a couple of things that you should know about our testing process:
Line 64: Line 130:
 
* To run tests, open the Run Configurations dialog (Ctrl+3, 'run...') and expand the "JUnit Plug-in Test" category to see the launch configurations we use to run the tests.
 
* To run tests, open the Run Configurations dialog (Ctrl+3, 'run...') and expand the "JUnit Plug-in Test" category to see the launch configurations we use to run the tests.
 
* If you create a new TestCase make sure to add it to the correct test suite. The test suite class can be found by looking at the launch configuration on the "Test" tab under "Test class". For example, the test suite for JFace is called org.eclipse.jface.tests.AllTests; the main UI test suite is org.eclipse.ui.tests.UiTestSuite.
 
* If you create a new TestCase make sure to add it to the correct test suite. The test suite class can be found by looking at the launch configuration on the "Test" tab under "Test class". For example, the test suite for JFace is called org.eclipse.jface.tests.AllTests; the main UI test suite is org.eclipse.ui.tests.UiTestSuite.
* If you want to make a good impression, write tests. This goes for any project, of course.
+
* If you want to make a good impression, write tests. This goes for any project, of course.
  
 
=== Coding Conventions ===
 
=== Coding Conventions ===
* Follow the Eclipse Platform's [http://dev.eclipse.org/conventions.html Standards, Conventions and Guidelines].
+
* Follow the Eclipse Platform's [[Development Conventions and Guidelines]].
* Every file must contain a copyright header, as described in [http://dev.eclipse.org/conventions.html Standards, Conventions and Guidelines]. The copyright header goes before the package declaration, starting in the very first line. For new files, list "yourself and others" instead of "IBM and others" in the first line. For changed files, add a contribution comment in the copyright header with your name and affiliation, and a bug id.
+
* Every file must contain a copyright header, as described in [[Development Conventions and Guidelines]]. The copyright header goes before the package declaration, starting in the very first line. For new files, list "yourself and others" instead of "IBM and others" in the first line.
* UI will need you to use project-specific settings for compiler warnings/errors, code formatting etc. that are copied from the other UI plug-ins' settings.
+
 
 +
For instance:
 +
{{codeblock|/*******************************************************************************
 +
* Copyright (c) 2015, 2016 [Your Company or your name] and others.
 +
*
 +
* This program and the accompanying materials
 +
* are made available under the terms of the Eclipse Public License 2.0
 +
* which accompanies this distribution, and is available at
 +
* https://www.eclipse.org/legal/epl-2.0/
 +
*
 +
* SPDX-License-Identifier: EPL-2.0
 +
*
 +
* Contributors:
 +
*    [Your Company or your name] - initial API and implementation
 +
*******************************************************************************/}}
 +
 
 +
* UI will need you to use project-specific settings for compiler warnings/errors, code formatting, save actions etc. These settings are typically copied into new projects from an existing one.
 +
* Avoid formatting the whole files - as this can generate pseudo-changes (white-space related) when committing changes to existing source files.
 +
** The easiest way, for Java files, is to have "Format edited lines" activated in the Preferences -> Java -> Editor -> Save Actions (this ''should'' be already pre-configured in the project settings).
 +
** One can also format just the needed block by selecting it and using "format" (Ctrl+Shift+F).
 
* Use "organize imports" (Ctrl-Shift-O) to clean up the imports (we do not use org.eclipse.* type notation).
 
* Use "organize imports" (Ctrl-Shift-O) to clean up the imports (we do not use org.eclipse.* type notation).
 
* It is considered good practice to write code that does not have warnings. If possible, fix warnings existing whenever you see them.
 
* It is considered good practice to write code that does not have warnings. If possible, fix warnings existing whenever you see them.
Line 76: Line 161:
 
* Avoid adding trailing whitespace. You can use the save actions in Eclipse to auto-remove them, via the Preferences -> Java -> Editor -> Save Actions. Activate them and as additional action select Configure and select "Remove trailing whitespace"
 
* Avoid adding trailing whitespace. You can use the save actions in Eclipse to auto-remove them, via the Preferences -> Java -> Editor -> Save Actions. Activate them and as additional action select Configure and select "Remove trailing whitespace"
 
* Write/update Javadoc for all API you introduce/change. See [http://wiki.eclipse.org/index.php/Evolving_Java-based_APIs Evolving Java-based APIs] by Jim des Rivières to understand what it means to maintain an API.
 
* Write/update Javadoc for all API you introduce/change. See [http://wiki.eclipse.org/index.php/Evolving_Java-based_APIs Evolving Java-based APIs] by Jim des Rivières to understand what it means to maintain an API.
* Use the following format for your commit message:
 
  
Bug XXXX - bug title<br />
+
 
<space><br />
+
=== Optional: Update the copyright header for existing files ===
Short description of what the fix contains, or the direction of the fix<br />
+
For changed files, you can optionally add a contribution comment in the copyright header with your name and affiliation, and a bug id. If the top "Copyright (c)" line does not contain the current year, update it by changing the second year to be the current year or by adding a comma and the current year after the initial year.
<space><br />
+
For instance:
Signed-off-by: email-with-CLA
+
{{codeblock|/*******************************************************************************
 +
* Copyright (c) 2008, 2016 IBM Corporation and others.
 +
*
 +
* This program and the accompanying materials
 +
* are made available under the terms of the Eclipse Public License 2.0
 +
* which accompanies this distribution, and is available at
 +
* https://www.eclipse.org/legal/epl-2.0/
 +
*
 +
* SPDX-License-Identifier: EPL-2.0
 +
*
 +
* Contributors:
 +
*    IBM Corporation - initial API and implementation
 +
*    John Doe <John.Doe@eclipse.org> - Bug 429728
 +
*******************************************************************************/}}
  
 
=== Before You Check In ===
 
=== Before You Check In ===
  
* Commit comments are required for all code commits, bugs should be logged to track work and the bug number and a description is then used in the commit comment to describe the change. For example when fixing a bug, use exactly: &quot;Fixed bug xxx: &lt;title of bug&gt;&quot;. The &quot;bug xxxx&quot; part is really important as this is what is used to relate the bugs to the build submissions, so it must be formatted exactly that way (uppercase or lowercase bug should work).
+
* Commit comments are required for all code commits, bugs should be logged to track work and the bug number and a description is then used in the commit comment to describe the change. For example when fixing a bug, use exactly: &quot;Fixed bug xxx: &lt;title of bug&gt;&quot;. The &quot;bug xxxx&quot; part is really important as this is what is used to relate the bugs to the build submissions, so it must be formatted exactly that way (uppercase or lowercase bug should work).
 
* Before committing changes, catch up to all changes made by others, and then run the tests.
 
* Before committing changes, catch up to all changes made by others, and then run the tests.
 
* Don't commit your changes if this will cause compile errors for others.
 
* Don't commit your changes if this will cause compile errors for others.
  
 
=== The Build===
 
=== The Build===
The Eclipse build is a bit of a mystery to newcomers. But rest assured that if you break something everyone will know about it and we will laugh at you (not really but we might tease you, or send you a [http://dev.eclipse.org/mhonarc/lists/platform-releng-dev/msg09764.html clown nose] if it was really bad). If you do one thing it should be to sign up for the [https://dev.eclipse.org/mailman/listinfo/platform-releng-dev platform-releng-dev mailing list]. You'll receive emails when builds complete and when build and test failures occur. It's always good to pay extra special attention on the mornings after you make a commit or someone makes a commit on your behalf. The normal reaction to "breaking the build" is to log a bug, notify the platform-releng-dev list about it so that others can gauge the quality of the build, and then fix the bug.
+
The Eclipse build is a bit of a mystery to newcomers. But rest assured that if you break something everyone will know about it and we will laugh at you (not really but we might tease you, or send you a [http://dev.eclipse.org/mhonarc/lists/platform-releng-dev/msg09764.html clown nose] if it was really bad). If you do one thing it should be to sign up for the [https://dev.eclipse.org/mailman/listinfo/platform-releng-dev platform-releng-dev mailing list]. You'll receive emails when builds complete and when build and test failures occur. It's always good to pay extra special attention on the mornings after you make a commit or someone makes a commit on your behalf. The normal reaction to "breaking the build" is to log a bug, notify the platform-releng-dev list about it so that others can gauge the quality of the build, and then fix the bug.
 +
 
 +
===Adding a Note and Noteworthy entry===
 +
 
 +
To add to the N&N clone the repo listed here: https://git.eclipse.org/r/#/admin/projects/www.eclipse.org/eclipse/news
 +
Check existing entries for how to describe new entries.
 +
 
 +
The plug-in is "platform news" and it contains instructions.html. Frequently the following rules are missed:
 +
 
 +
* The image should be no more than 720 pixels wide and in png format
 +
* Use the [http://validator.w3.org/#validate_by_input Markup Validation Service] to check your document's markup submitting.
 +
 
 +
=== Contributing to maintenance release branches ===
 +
 
 +
In order to push commit to R4_XX_maintenance branch, one must follow RC2 criteria, which are:
 +
 +
"All fixes submitted must have a project lead or PMC vote on the bug report, and the fix must be reviewed by an additional committer (any committer other than the one who made the fix). A positive review from a project lead or PMC member means implicit approval and no vote is needed on the bug report."
 +
 +
So the algorithm to follow is:
 +
 +
# On gerrit with backported patch ask for the "+1" review from or from PL/PMC or from a committer that was not the original patch owner. The committer who backports the patch but is not the owner of the original patch, is also allowed to vote with "+1".
 +
# If the "+1" reviewer on gerrit is not PL/PMC, ask them in a comment on original bug for an explicit "+1" for backporting.
 +
# If 1) and 2) are successfully done, and tests are OK, gerrit can be merged.
 +
# API changes or new features backported require additionally explicit PMC approval.
 +
 +
See also https://www.eclipse.org/lists/platform-releng-dev/msg36074.html and https://www.eclipse.org/eclipse/development/plans/freeze_plan_4_15.php
 +
 
 +
== Suggested information sources ==
 +
Being well informed is a must for an active community member. Following information sources can be useful:
 +
* One can watch the following PRs in GitHub https://github.com/pulls?user=eclipse-platform
 +
* One can watch the following issues in Github https://github.com/issues?user=eclipse-platform
 +
* One can subscribe to the following mailing lists:
 +
[1] https://accounts.eclipse.org/mailing-list/eclipse-dev
 +
 
 +
[2] https://accounts.eclipse.org/mailing-list/ide-dev
  
== Forum ==
+
[3] https://accounts.eclipse.org/mailing-list/pde-dev
We try to be prompt and responsive on the [http://www.eclipse.org/forums/?group=eclipse.platform forum] (newsgroup) but there's always room for improvement.  If you know the answer to a query feel free to respond.
+
  
== Wiki==
+
[4] https://accounts.eclipse.org/mailing-list/platform-dev
The wiki is open and can be edited by all.  If you find a typo, a broken link, or anything that you view as a small issue feel free to fix it.  If wanting to contribute a significant amount of information or create a new article we request that you [[../FAQ#How_do_I_report_a_bug.3F|log a bug]] so that we're aware of what you're contributing.  This is so that we can ensure consistency structurally and in the message conveyed.
+
  
== IRC ==
+
[5] https://accounts.eclipse.org/mailing-list/cross-project-issues-dev
  
Many Platform UI committers hang out on [[IRC]], on both #eclipse-dev and #eclipse-e4. Feel free to ask questions there, or join into development discussions.
+
[6] https://accounts.eclipse.org/mailing-list/platform-releng-dev (5 mails a day)
  
 
[[Category:Platform UI]][[Category:How to Contribute]]
 
[[Category:Platform UI]][[Category:How to Contribute]]
Line 107: Line 236:
 
== Meetings ==
 
== Meetings ==
  
The team has bi-weekly phone calls for development discussions and planning. Anyone is welcome to join in. For call in details and minutes see [[E4/Meeting_Minutes]].
+
There are currently no calls scheduled. They can be arranged upon request.
 +
For call in details and minutes see [[E4/Meeting_Minutes]].

Latest revision as of 03:47, 29 August 2022

Note.png
This page may contain outdated information. Please go to https://github.com/eclipse-platform/.github/blob/main/CONTRIBUTING.md for uptodate information.


This page is a starting point for where to begin when wanting to contribute to the project. The goal is to educate and to be as up front as possible with expectations so that the process can be as efficient as possible. Template:Platform UI

Bugs

If you find an issue file it [here https://github.com/eclipse-platform/.github/issues]. There is a description of how a great bug report looks like. If you find a bug that you think is a duplicate, is not a bug, etc. feel free to comment saying so.

Bug triage

If you are interested to help with bug solving, the Eclipse platform project has a huge backlog of existing bug reports. It is often not possible for the committer to re-test all old bug reports. A contributor can re-test bug reports and report if they are already solved. If you want to help in this area, please send a message to the platform-dev@eclipse.org mailing list.

Setting up your SDK for code contributions

There are two main ways to prepare your IDE to contribute to the Eclipse Platform.

  1. Oomph automated SDK setup: Automated installation and updating of SDK and workspace. It makes it easy to contribute to multiple Platform projects. Good for occasional contributors as well as for committers.
  2. Manual SDK setup: The classic way. Mostly used by committers with custom IDEs.

Oomph automated SDK setup

If you are interested in contributing with Oomph, read:

These provisioning setups automatically run all steps and apply all settings from the manual setup. Though additional information in the manual setup still applies, so please have a look at the manual steps too.

Manual SDK setup

The rest of this section explains the manual setup.

First, you need to set up your environment. You need to:

  1. Get an Eclipse SDK
  2. Install the tools we use during development
  3. Get the code for Platform UI
  4. Use the correct target platform


Active branches

Our currently active branches:

  • master - development towards the next release

[1] Get an Eclipse SDK

To get the required updates from other subprojects it is recommended to use a recent I-Build for the Eclipse SDK for contributions. See http://download.eclipse.org/eclipse/downloads/ for the latest download.

[2] Install the development tools

The Eclipse SDK development requires that certain plug-ins are installed in your IDE. The Eclipse platform team provides a file from which these plug-ins can be installed. Download the following file onto your computer: https://raw.githubusercontent.com/eclipse-platform/eclipse.platform.ui/master/releng/org.eclipse.ui.releng/platformUiTools.p2f

You can install the plug-ins described by this file by using File>Import...>Install>Install Software Items from File.

[3] Get the code for Platform UI

Detailed explanation is available at GitHub.

[4] Prepare API tooling

Eclipse provides rich set of API's. Read about what an API is and how API's are evolving here:

API changes need to be properly reflected in bundle versions. Read about this here:

If we contribute code to Eclipse, we always should make sure that our changes do not break API and do not violate version rules!

If the commit you want to merge contains an API change, before merge you should always load the patch into the IDE and run a clean build on related project.

Before doing so you should also make sure API tooling is properly configured. To achieve this you have to have the following preferences set under Window>Preferences:

  • Plug in Development: tick [x] "Workspace Plug-Ins override target platform plug-ins with the same id"
  • Plug in Development: untick [ ] "Disable API analysis builder"
  • Plug in Development>Target Platform: This must bet set to "Running Platform" and you are using a recent nightly SDK build.
  • Plug in Development>API Baselines: The latest release must be ticked. This must be created manually and point to plain SDK installation of the last official SDK release.

If after that you see API errors in the workspace, please consider to read the proposed solution, compare that with the information you can get at [1], [2] and [3] and apply appropriated fix (or "-1" on the Gerrit patch).

There can be multiple possible API error fixes proposed by PDE, but only one can be the right one - unfortunately we still require the power of human brain to apply the right fix.

Basic rule is: during a development cycle (e.g. 4.12) we only increment one version segment one time according to the rules [1], [2] and [3]. Only in case of human errors we have to bump the same version segment twice (once the wrong version is built and published we can't simply revert it so we must increase again...). Note: We never decrement versions if they were already published via official SDK build.

Decision about which bundle version segment to change should be always based on [1], [2] and [3], not just on PDE "quick fix" proposals. In doubt - ask on the platform-dev mailing list.

[1] https://wiki.eclipse.org/Version_Numbering

[2] https://wiki.eclipse.org/Evolving_Java-based_APIs

[3] https://wiki.eclipse.org/Evolving_Java-based_APIs_2

[5] Tweaks for after your environment is set up

Running the tests: you should be able to run a couple of pre-filled launch configs from Run>Run Configurations.

On Linux: The launch configs often come with DISPLAY=:1.0. You should either run a vnc server or remove that variable from the environment tab. An example of a $HOME/.vnc/xstartup that works for the Platform UI tests is:

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
#vncconfig -iconic &
xterm -geometry 80x24+10+10 -sb -sl 5000 -ls -title "$VNCDESKTOP Desktop" &
#gnome-session --sm-disable --failsafe --disable-sound &

exec metacity --replace --sm-disable

Contributing Code

Whether you're wanting to fix a typo in javadoc or to implement the next whiz bang feature for Platform UI you'll need to know a few things before you contribute code.

Platform UI is using Git as version control system.

Unit Testing

Testing is imperative to the health of the project. We have a significant amount of tests. The quantity of tests will keep growing as more functionality is added to Platform UI. If you are contributing a fix or writing an enhancement, it is a requirement that tests are written. If you don't write them a committer will have to and that could slow down the contribution process.

There are a couple of things that you should know about our testing process:

  • The most tests are included in org.eclipse.ui.tests, but you will need the other test plug-ins as well to avoid missing dependencies.
  • If looking for tests for a specific class look for a class named {THECLASS}Test.java (e.g. UpdateStrategy.java -> UpdateStrategyTest.java).
  • To run tests, open the Run Configurations dialog (Ctrl+3, 'run...') and expand the "JUnit Plug-in Test" category to see the launch configurations we use to run the tests.
  • If you create a new TestCase make sure to add it to the correct test suite. The test suite class can be found by looking at the launch configuration on the "Test" tab under "Test class". For example, the test suite for JFace is called org.eclipse.jface.tests.AllTests; the main UI test suite is org.eclipse.ui.tests.UiTestSuite.
  • If you want to make a good impression, write tests. This goes for any project, of course.

Coding Conventions

For instance:

/*******************************************************************************
* Copyright (c) 2015, 2016 [Your Company or your name] and others.
* 
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
* 
* Contributors:
*     [Your Company or your name] - initial API and implementation
*******************************************************************************/
  • UI will need you to use project-specific settings for compiler warnings/errors, code formatting, save actions etc. These settings are typically copied into new projects from an existing one.
  • Avoid formatting the whole files - as this can generate pseudo-changes (white-space related) when committing changes to existing source files.
    • The easiest way, for Java files, is to have "Format edited lines" activated in the Preferences -> Java -> Editor -> Save Actions (this should be already pre-configured in the project settings).
    • One can also format just the needed block by selecting it and using "format" (Ctrl+Shift+F).
  • Use "organize imports" (Ctrl-Shift-O) to clean up the imports (we do not use org.eclipse.* type notation).
  • It is considered good practice to write code that does not have warnings. If possible, fix warnings existing whenever you see them.
  • Non-externalized strings are considered errors, do not ship non-externalized strings or use the NON-NLS tag to indicate that you are not relevant for translation
  • Use unix line delimiters (In Eclipse select Window-> Properties -> Workspace and set the file delimiter to Unix
  • Avoid adding trailing whitespace. You can use the save actions in Eclipse to auto-remove them, via the Preferences -> Java -> Editor -> Save Actions. Activate them and as additional action select Configure and select "Remove trailing whitespace"
  • Write/update Javadoc for all API you introduce/change. See Evolving Java-based APIs by Jim des Rivières to understand what it means to maintain an API.


Optional: Update the copyright header for existing files

For changed files, you can optionally add a contribution comment in the copyright header with your name and affiliation, and a bug id. If the top "Copyright (c)" line does not contain the current year, update it by changing the second year to be the current year or by adding a comma and the current year after the initial year. For instance:

/*******************************************************************************
* Copyright (c) 2008, 2016 IBM Corporation and others.
* 
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
* 
* Contributors:
*     IBM Corporation - initial API and implementation
*     John Doe <John.Doe@eclipse.org> - Bug 429728
*******************************************************************************/

Before You Check In

  • Commit comments are required for all code commits, bugs should be logged to track work and the bug number and a description is then used in the commit comment to describe the change. For example when fixing a bug, use exactly: "Fixed bug xxx: <title of bug>". The "bug xxxx" part is really important as this is what is used to relate the bugs to the build submissions, so it must be formatted exactly that way (uppercase or lowercase bug should work).
  • Before committing changes, catch up to all changes made by others, and then run the tests.
  • Don't commit your changes if this will cause compile errors for others.

The Build

The Eclipse build is a bit of a mystery to newcomers. But rest assured that if you break something everyone will know about it and we will laugh at you (not really but we might tease you, or send you a clown nose if it was really bad). If you do one thing it should be to sign up for the platform-releng-dev mailing list. You'll receive emails when builds complete and when build and test failures occur. It's always good to pay extra special attention on the mornings after you make a commit or someone makes a commit on your behalf. The normal reaction to "breaking the build" is to log a bug, notify the platform-releng-dev list about it so that others can gauge the quality of the build, and then fix the bug.

Adding a Note and Noteworthy entry

To add to the N&N clone the repo listed here: https://git.eclipse.org/r/#/admin/projects/www.eclipse.org/eclipse/news Check existing entries for how to describe new entries.

The plug-in is "platform news" and it contains instructions.html. Frequently the following rules are missed:

  • The image should be no more than 720 pixels wide and in png format
  • Use the Markup Validation Service to check your document's markup submitting.

Contributing to maintenance release branches

In order to push commit to R4_XX_maintenance branch, one must follow RC2 criteria, which are:

"All fixes submitted must have a project lead or PMC vote on the bug report, and the fix must be reviewed by an additional committer (any committer other than the one who made the fix). A positive review from a project lead or PMC member means implicit approval and no vote is needed on the bug report."

So the algorithm to follow is:

  1. On gerrit with backported patch ask for the "+1" review from or from PL/PMC or from a committer that was not the original patch owner. The committer who backports the patch but is not the owner of the original patch, is also allowed to vote with "+1".
  2. If the "+1" reviewer on gerrit is not PL/PMC, ask them in a comment on original bug for an explicit "+1" for backporting.
  3. If 1) and 2) are successfully done, and tests are OK, gerrit can be merged.
  4. API changes or new features backported require additionally explicit PMC approval.

See also https://www.eclipse.org/lists/platform-releng-dev/msg36074.html and https://www.eclipse.org/eclipse/development/plans/freeze_plan_4_15.php

Suggested information sources

Being well informed is a must for an active community member. Following information sources can be useful:

[1] https://accounts.eclipse.org/mailing-list/eclipse-dev

[2] https://accounts.eclipse.org/mailing-list/ide-dev

[3] https://accounts.eclipse.org/mailing-list/pde-dev

[4] https://accounts.eclipse.org/mailing-list/platform-dev

[5] https://accounts.eclipse.org/mailing-list/cross-project-issues-dev

[6] https://accounts.eclipse.org/mailing-list/platform-releng-dev (5 mails a day)

Meetings

There are currently no calls scheduled. They can be arranged upon request. For call in details and minutes see E4/Meeting_Minutes.

Back to the top