Sharing Parse Results of a Large C/C++ Project

This document describes how to do parsing of a large project once and then share results with your team members to save time and resources.

Contents

Content on this page applies to NetBeans IDE 7.3 and 7.4

Requirements

To follow this tutorial, you need the following software.

Software Version Required
NetBeans IDE (including C/C++ support) version 7.3 or 7.4
Java Development Kit (JDK) Version 6 or 7

See the NetBeans IDE Installation Instructions and Configuring the NetBeans IDE for C/C++/Fortran for information about downloading and installing the required software.

Code Assistance Cache

The NetBeans IDE stores parse results on a disk when parsing C/C++ source code. The saved data on a disk is called Code Assistance Cache.

When you open a project, the NetBeans IDE examines the cache and checks whether the latter is up to date. If the cache is up to date, the NetBeans IDE does not parse your project and just loads the required data for code navigation from the Code Assistance Cache.

Sharing Code Assistance Cache

By default the Code Assistance Cache resides in the ${userdir}/var/cache folder (where ${userdir} stands for the NetBeans user directory) and can be neither shared nor copied to another location.

If the Code Assistance Cache is placed inside a project, it can be copied to another machine, provided that the machine it is copied to meets the following requirements:

  • the operating system is identical to the operating system on the machine where the code was parsed on
  • the tool collection used by the project exists on the machine the cache is copied to and resides in the same location

To instruct the NetBeans IDE to place the Code Assistance Cache inside your project metadata:

  1. Add the cache.location=nbproject/private/cache line to either:
    • the project properties file (nbproject/project.properties)
    • the private properties file (nbproject/private/private.properties)

    Note: The difference between the project properties and private properties files is that the public one (nbproject/project.properties) is shared via version control system by default, while the private one (nbproject/private/private.properties) is not. So if you modify private properties, you will need to synchronize the private properties file with the identical file on another machine. If a project properties file is modified, a version control system can automatically synchronize it with the one on another machine for you.

  2. After the properties file is modified, close and reopen the project.
    The IDE will parse the project and the Code Assistance Cache will be placed into a private subdirectory in the project metadata.
  3. Close the project and archive your nbproject/private/cache or copy it to a shared location.

    Note: Do not forget to close a project before copying or zipping, otherwise some data will not be flushed to cache.

The Code Assistance Cache can now be copied to other projects on other machines and be used. instead of waiting until NetBeans parses the project.

If there are some newer files on the machine the cache is being copied to, only newer files are going to be parsed.

Sharing Cache between Machines with Different Operating Systems or Compilers

If the Code Assistance Cache needs to be shared between machines that run different operating systems or different compilers, you must create separate cache for each pair (Operating System, Compiler Collection).

More Information about C/C++/Fortran Support

Please visit the C/C++ Learning Trail for more information about using the C/C++ features of the NetBeans IDE.

Join the NetBeans C/C++ User Forum to take part in discussions related to C/C++ development using the NetBeans IDE or ask for help.

You can file a bug or suggest an enhancement to Bugzilla (netbeans.org registration is required).


get support for the NetBeans

Support


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2015, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo