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 "Getting started with CDT development"

m
m
Line 28: Line 28:
 
== Eclipse SDK  ==
 
== Eclipse SDK  ==
  
The very first thing you'll need to do to work on the CDT sources is install an Eclipse SDK (officially known as the ''Eclipse Project''). The contains the Eclipse platform plus other features that developers typically need to develop plug-ins, e.g., JDT and PDE. Which version of the SDK you need depends on which version of CDT you're building. To build the master branch of CDT today (June 25, 2011), you need Eclipse 3.7. To build an earlier version of CDT, you'll probably want to use an earlier version of Eclipse SDK. Visit the [http://www.eclipse.org/cdt/downloads.php CDT downloads page] to see which version of Eclipse/SDK matches a particular CDT version.
+
The very first thing you'll need to do to work on the CDT sources is install an Eclipse SDK (officially known as the ''Eclipse Project''). The SDK contains the Eclipse platform plus other features that developers typically need to develop plug-ins, e.g., JDT and PDE. Which version of the SDK you need depends on which version of CDT you're building. To build the master branch of CDT today (June 25, 2011), you need Eclipse 3.7. To build an earlier version of CDT, you'll probably want to use an earlier version of Eclipse SDK. Visit the [http://www.eclipse.org/cdt/downloads.php CDT downloads page] to see which version of Eclipse/SDK matches a particular CDT version.
  
 
== Launching  ==
 
== Launching  ==

Revision as of 16:18, 25 June 2011


Getting the Sources

In June 2011, CDT officially transitioned off CVS and onto Git.

Committers will want to access the master repository via ssh

  ssh://git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git

Everyone else will use either of the following URLs

  git://git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git
  http://git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git

Click here for further information on the Git repos available to to CDT developers

Screencasts

Doug Schaefer has posted numerous screencasts on using git with Eclipse

Eclipse SDK

The very first thing you'll need to do to work on the CDT sources is install an Eclipse SDK (officially known as the Eclipse Project). The SDK contains the Eclipse platform plus other features that developers typically need to develop plug-ins, e.g., JDT and PDE. Which version of the SDK you need depends on which version of CDT you're building. To build the master branch of CDT today (June 25, 2011), you need Eclipse 3.7. To build an earlier version of CDT, you'll probably want to use an earlier version of Eclipse SDK. Visit the CDT downloads page to see which version of Eclipse/SDK matches a particular CDT version.

Launching

Now, move back to the PDE (Plug-in Development Environment) perspective. Window->Perspective->Other->"Plug in Development". There, you'll see a project with the name org.eclipse.cdt.ui, right click the org.eclipse.cdt.ui project, select "Run As"->"eclipse application". You should see a new instance of eclipse - with the latest version of eclipse CDT plugins.

Alternatively, you can create a Launcher: Go to Run - Debug Configurations... Select "Eclipse Application" and click New. Give the Debug Configuration a Name and the other defaults are OK. This appears to be a more widely used launching technique. You may also want to go to the Arguments tab and add "-console" to the list of Program arguments. This will open an OSGi console and allow you to (temporarily) insert system.out.println statements in the CDT code to sanity check your plug-in development procedure. Regardless of whether you're launching an Eclipse Application using Debug As... or Run As..., or "deploying" your modified plugin(s) by Exporting them into a target Eclipse installation, you should see your debug println statements. Until you are familiar with the CDT code base, however, using a Debug Launcher and experimenting with breakpoints is probably the best way to get a warm fuzzy feeling if you have doubts about modifications you are making.

Note: On Mac OS X, you might need an additional argument in the launch configuration, see SWT FAQ

Submitting and Applying Patches

If you wish to contribute your changes to CDT see these instructions.

In order to apply a patch, right click the relevant project, and select Team->Apply Patch...

Keep in mind that each patch is a list of "before" and "after" text changes to files. These are highly version-specific. If you are trying to apply an old patch to newer code, or vice versa, you will encounter problems in the Apply Patch Wizard.

In case you've applied a patch, and you wish to revert back to the latest HEAD branch - right click the project, then "Replace With->Latest From HEAD", answer Yes to the warning message, and the patch is gone.

Creating a runtime patch

Building a working cdt distribution is very difficult, but if you want just patch up your local installation you can export plugin(s) to which source patch is applied using Export->Plugins, export as archive and use your eclipse installation as destination. Make sure after this you have 2 version of the same plugin (one from installation and one new) in the plugins directory and version qualifier of your new plugin is higher.

Back to the top