As per reference ( https://wiki.eclipse.org/Platform_UI/How_to_Contribute ) ..

You’ll need to know few things before you contribute code

Environment Setup

Get Eclipse SDK (I-Build or M-Build) from the download page, unpack it and open the workspace you use to contribute.

Download the platformUiTools.p2f  provided by the Eclipse platform team and install the required plug-ins from that file, by using the Import menu: Install > Install Software Items.

IDE Properties Setup

on Preferences > General > Workspace, set text file delimiters to Unix line delimiters

on Preferences > Java  > Editor > Save Actions, enable the “Perform the selected actions ..” and set:

  • Format Source Code > Format Edited Lines: to avoid formatting the whole file, but limit the changes to edited lines.
  • Additional Actions > Remove Trailing Whitespaces: to avoid adding trailing whitespaces

Contributing Code

To contribute to Platform UI you will need to get the project source code, stored in eclipse repositories. If you are not a committer and you want to contribute, it is better you use the Gerrit URL to clone the remote repositories. So doing you will be able to get the latest source code from Eclipse master repositories, and commit your changes to Gerrit, so the Committers can validate your work before committing in into Eclipse codebase.

The image above represents the workflow for contribution in 5 steps:

  1. clone from master to local (use gerrit repo)
  2. fix the code and commit on local repository (until ok)
  3. push changes from local repo to gerrit repo
  4. a committer will review the change (until +2)
  5. a committer will commit the change

Note: To ensure work on sources> fetch from remote and rebase to fetched master (or pull)

Get source code

Connect to Local Git repositories if they already exists.

Otherwise you will need to clone the needed remote repositories to your local Git folder.

Clone Platform UI Repositories

To contribute to Platform UI you will need to get the project source code, hosted in the three Git repositories below.

The above URLs contain with fake Gerrit userid to be replaced with your real one.

The first time I clone repositories I provided Gerrit username and password and I chose to store in Secure Store. So doing the future commit operations will not require the password again.

At the end of the import you can see the Gerrit icon over cloned repos.

After cloning, download psf-import-file , and edit it, by replacing all ssh URLs with the Gerrit URLs containing your real username.

Fix Setup Errors:

To fix API Baseline Errors: unzip latest stable version of eclipse, and set it as baseline for development

  • on Preferences > Plug-in Development > API Baseline, set the Eclipse installation directory as API Baseline.

To fix build path problems: install missing JREs (1.6, 1.7 .. ) and reference them.

  • on Preferences > Java > Installed JREs. reference missing jre/jdk

Fix Bugs and Contribute

The code contribution are mainly done by fixing bugs, which are listed in eclipse bugzilla (https://bugs.eclipse.org/bugs/)

Usually a contributor starts by fixing very simple bugs (typos, simple files) and proceed toward more complex stuffs.

The Git workflow for contributions is not immediate, and it can be frustrating, especially at the beginning.

Bug Search

below there are some of the common bug searches I perform when I intend to fix bug on Eclipse Platform UI / Runtime

[link] : Eclipse Platform UI and Runtime, with status UNCONFIRMED, NEW, ASSIGNED and REOPENED, ordered by ID desc.

[link] – Eclipse Platform UI and Runtime, UNCONFIRMED, NEW, ASSIGNED and REOPENED, ordered by ID desc, keyword: bugday | helpwanted

Prepare your workspace to Code

Pull latest version from Eclipse remote master to your local repository. Gerrit will work like a proxy (is transparent) when getting the source code from Eclipse master repository.

Branch immediately the repository you will work on. This is very convenient for several reasons:

  • working on your bug without risks
  • getting back to the master branch just by click on switch branch > master
  • work at the same time on multiple bugs without code loss
  • allow the committers to examine your code and merge it easily

This post describes how I install Java, Ant and Maven on my Windows PC, and how I setup the environment variables for development.

Install Java, Ant and Maven

When installing Java, Ant and Maven, I’m using “C:\opt” as basefolder, instead of the standard “C:\Program Files (x86)” directory.

Install Java, Multiple Versions

To install multiple java versions, I first uninstall any java installation from my PC, then i start installing the different versions, starting with the one with the lowest version number.

As install location, I’m used to change the default install directory, to have base path without spaces. As example:

C:\opt\java\x86\jdk1.6.0_45\
C:\opt\java\x86\jre6\

C:\opt\java\x86\jdk1.7.0_67\
C:\opt\java\x86\jre7\

C:\opt\java\x86\jdk1.8.0_40\
C:\opt\java\x86\jre1.8.0_40\

After installing Java I set the JAVA_HOME enviroment variable, and I add the java binaries entry ( %JAVA_HOME%\bin ) to the path.

To test it is working, I type from command prompt :

The result is below

 Install Ant

The installation consists in download the latest binary, and unpack the file into a directory in my PC. As example:

C:\opt\apache\ant-1.9.4

After unpacking I set the ANT_HOME environment variable and I add the %ANT_HOME%\bin entry to the path

To test the setup, I type from command prompt:

The result are below

Install Maven

As for Ant the installation consists in download the latest binary and unpack the file on a directory. As example:

C:\opt\apache\maven-3.2.5

Then I set Maven environment variables, and I add the maven binaries (%M2%) to the PATH.

To test it, I type from command prompt:

The result is below

Environment Variables

Supposing we installed java in C:\opt\java\x86\jdk1.8.0_40 ; we unpacked Ant in C:\opt\apache\ant-1.9.4 and Maven in C:\opt\apache\maven-3.2.5,  we should have set the below environment variables:

We can test the tools are working using command prompt, as follows:

java -version
ant -version
mvn –version

Search for eclipse.plaform.ui in eclipse git repositories.

Click on project name to see the main page for the git project repository: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/

In this page are listed the commits. In the bottom left there are three alternative URLs for getting the source code. I choose the git one, then clone via command line.

 

 

Learning Git, by reading Lars’ book on Git ; Sopot’s suggested Git official documentation and Dani’s recommended Git Parable.

Install Git On Windows

The easy way to install Git for Windows is by installing GitHub for Windows (ref). After verifying the connection with my GitHub repository, I can start Eclipse, and connected to the same repo using EGit.

Using EGit

Mos of topics are covered in Eclipse Wiki, under EGit/User Guide. The most important for me are: Rebasing.

I’m following the Lars’ book “Contributing to Eclipse Platform”, and these are some synthetic notes on the content. These notes can be exploded into a real-life tutoria on contribution, by adding images, notes and personal experience.

Plugins and Features

create eclipse plugin, no activator, template hello world command
manifest.mf > launch eclipse application
export plugin > current eclipse installation
create feature, initialize from previous plugin
add category.xml, add category and feature
export deployable feature to local repository, install feature from local repo

Git and Eclipse

Most important thing to learn from me, since I’m an experienced Eclipse developer, but I’m not very “fluent” with Git.