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 14: Line 14:
 
   http://git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git
 
   http://git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git
  
[http://git.eclipse.org/c/cdt/org.eclipse.cdt Click here] for further information on the Git repos available to to CDT developers
+
[http://git.eclipse.org/c/cdt/org.eclipse.cdt Click here] for further information on the Git repos available to CDT developers
  
 
== Screencasts  ==
 
== Screencasts  ==

Revision as of 16:42, 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 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.

One thing to keep in mind is that as development enters the new year, the CDT team typically starts making use of new API in the platform. The platform releases new API first via milestone releases. If someone in the CDT development team commits code to the master branch that uses that new API, all CDT developers (working on the master branch) are required to use the latest Eclipse SDK milestone from that point on. Typically such decisions/changes are discussed on the CDT dev list, so check there when in doubt. Alternatively, just use the latest platform milestone for building the master branch of CDT.

Launching

After all the CDT projects have successfully built, you'll probably want to run and/or do source-level debugging of the CDT code. Open 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.

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