Difference between revisions of "OpenOffice and Eclipse"

From Apache OpenOffice Wiki
Jump to: navigation, search
(New page)
 
m (Include solver/.../inc/offuh to list of include paths.)
Line 43: Line 43:
 
*Click 'Add...' and in the new dialog 'File system...' and browse to <code>main/solver/VERSION/PLATFORM/inc</code>.
 
*Click 'Add...' and in the new dialog 'File system...' and browse to <code>main/solver/VERSION/PLATFORM/inc</code>.
 
*Click 'OK' two times to get back to the properties dialog.
 
*Click 'OK' two times to get back to the properties dialog.
 +
*Repeat the last two steps to add <code>main/solver/VERSION/PLATFORM/inc/offuh</code> for the header created for the UNO IDL files.  Note that these includes only exist when the <code>offuh/</code> module has been built.browse to <code>main/solver/VERSION/PLATFORM/inc</code>.
 
*Go to the 'Symbols' tab page.
 
*Go to the 'Symbols' tab page.
 
*Click 'Add...' and add macro definitions
 
*Click 'Add...' and add macro definitions

Revision as of 09:09, 17 December 2013

With current versions of Eclipse (4.3) it is possible to create C/C++ projects for OpenOffice modules and use code assist, refactoring, lookup of definitions and declarations and all the other nice things that a modern IDE provides.

There are two different approaches to import the OpenOffice source code into Eclipse:

  • The whole repository at once.
You will need a not-yet-released nightly build of CDT to prevent major memory leaks and still have to increase memory limits for Eclipse.
  • Module by module.
This approach works with vanilla Eclipse. You only import individual modules (say sw/ and sfx/ into your workspace).

Module by Module

The following describes how to set up Eclipse for the module by module approach.

Install Eclipse

Install a current version of Eclipse (http://www.eclipse.org/downloads/).

  • Version 4.3 (Kepler) is known to work. Older 4.* versions may also work.
  • A version with focus on C/C++ (titled "Eclipse IDE for C/C++ Developers) works best but other versions with the CDT addon installed should work also.

Prepare a workspace

Start Eclipse and select or create an empty workspace. The empty workspace is not a hard requirement but with one Eclipse project per OpenOffice module you may loose track otherwise. You can freely choose the location of the workspace, just don't use the OpenOffice source code directory.


Add module to workspace

  • Open the import wizard via menu File->New->Other.
  • In the dialog choose the C/C++ -> Makefile Project with Existing Code wizard.
  • In the 'Import Existing Code' wizard
    • use the 'Browse...' button to set the 'Existing Code Location' to the top-level directory of a module. This will also set the 'Project Name'.
    • Select the correct tool chain for your platform.
Tool chains for the individual platforms:
Windows : Microsoft Visual C++
    • Close the import wizard via the Finish button to start the module import.

Setup project properties

A few changes to the project properties are necessary for the indexer to find all include files and use the correct compiler definitions.

  • Open the properties dialog via the menu Project->Properties.
  • Activate the C/C++ General->Paths and Symbols page.
  • In the 'Languages' list (left center) activate 'GNU C++', (for some reason this name does not change even when you use the MSVC tool chain).
  • Click 'Add...' and in the new dialog 'File system...' and browse to main/solver/VERSION/PLATFORM/inc.
  • Click 'OK' two times to get back to the properties dialog.
  • Repeat the last two steps to add main/solver/VERSION/PLATFORM/inc/offuh for the header created for the UNO IDL files. Note that these includes only exist when the offuh/ module has been built.browse to main/solver/VERSION/PLATFORM/inc.
  • Go to the 'Symbols' tab page.
  • Click 'Add...' and add macro definitions
Windows: WNT (empty value)
  • Click OK to close the dialog.
  • Rebuild the index via 'Project->C/C++ Index->Rebuild'. This time the indexer should runs longer because it has to index no only the files in the module but also all include files in solver/
Personal tools