wiki:WebKitGTK/Eclipse

Version 1 (modified by clopez@igalia.com, 9 years ago) (diff)

--

Using Eclipse CDT for developing WebKitGTK+

This document is a howto about using Eclipse CDT to develop WebKitGTK+

Getting Eclipse

We recommend downloading and installing the last release of Eclipse CDT directly from the official website: https://eclipse.org/cdt/ At least on Debian, the packaged version of Eclipse CDT is really ancient.

Increasing memory limits

When Eclipse's indexer tries to process the WebKit source, Eclipse will need considerably more memory than it allows itself out of the box. You should increase its memory limits using the eclipse.ini in your installation directory. Set something like -Xms1G -Xmx3G -XX:MaxPermSize=1G (initial heap space of 1 GB, max heap space of 3 GB, max perm-gen space of 1 GB).

If you fail to increase these limits then you will likely find that Eclipse hangs when you try to index or work with the WebKit source later on.

Generating and importing the project into Eclipse

The build system of WebKitGTK+ comes with a feature to auto-generate an Eclipse project that later you can import directly. To get this feature working you have to take care of the following:

  1. Ensure that eclipse is in your PATH. The autogenerator only triggers when it can find eclipse on your PATH.
    $ which eclipse
    # The above command should return the complete path to your eclipse binary.
    
  1. If you have just installed eclipse (it was not on your PATH before), then start with a clean build
    rm -fr WebKitBuild/Release
    
  1. Build WebKitGTK+ as usual, and after that ensure to create the following symlinks
    $ Tools/Scripts/build-webkit --gtk
    $ ln -fs WebKitBuild/Release/.project .
    $ ln -fs WebKitBuild/Release/.cproject .
    
  1. Now import the project into eclipse
    1. File -> Import -> Existing Projects into Workspace -> Next
    2. Input the path to where WebKitGTK+ is located
    3. Select the project name that appears and click on Finish
    

Further information

Check the Mozilla wiki regarding the usage of Eclipse CDT, they have some tips that you may find useful: https://developer.mozilla.org/en-US/docs/Eclipse_CDT