Relocating the Code Assistance Cache For Version Controlled Projects

See Also 

When you create a project with existing sources the project is parsed to support the code assistance features of the IDE. The parsing data is saved on disk in the code assistance cache. Each time you open the project the IDE examines the cache and if necessary parses any changed or new files to update the cache.

By default the IDE creates one code assistance cache for all your projects in your user directory. The cache in your user directory cannot be copied or shared.

Parsing can be triggered when you update a project from a code repository in a version control system such as Subversion or Mercurial. For large projects, it can take a long time.

A solution is for one developer using this version of the IDE to create a project-specific cache and copy it to a shared location where other developers using this version of the IDE can copy it to their computer. Then each developer can modify their project properties to reference the copied cache. After this, the parsing when you open the project is much faster.

In order to use a code assistance cache copied from another computer, your computer must meet the following requirements:

Note that if your team uses several different versions of operating systems and tool collections, you must create a different version of the cache for each combination of operating systems and tool collections.

To instruct the IDE to create the code assistance cache in a non-default location:

  1. Open the Files window (Window > Files or Ctrl-2) and navigate to the nbproject directory of your project.
  2. Specify the new path for the cache by setting the cache.location property. For example, if you want the cache to be located in nbproject/private/cache:

    Add the line cache.location=nbproject/private/cache to one of the following files:

  3. Save the properties file.
  4. Close and reopen the project.

    The IDE parses the project and places the code assistance cache in nbproject/private/cache. For very large projects this can take a long time.

  5. When parsing is complete, close the project and exit the IDE.
  6. Zip or tar the nbproject/private/cache to make it easier to move.
  7. Copy the zip or tar file of your nbproject/private/cache in a shared location where other developers can copy it.

    Note: It is important to exit the IDE before zipping or copying to ensure all data is flushed to cache.

  8. Push your changes to the repository if you have set the property in nbproject/project.properties.


To use a pre-generated code assistance cache:

  1. If your computer has the same operating system and tool collection, copy the archive of the cache from the shared location and extract it to a location that is not in your IDE user directory or managed by version control. Following the example, you should copy it to the project's nbproject/private/cache directory.
  2. Pull the project changes from the repository.
  3. If you have decided to use the private properties, add the cache.location property to the project's nbproject/private/private.properties file.
    Following the example, you should add the line:
    cache.location=nbproject/private/cache
  4. Open the project in the IDE.

    The IDE uses the copied code assistance cache instead of reparsing the project. If there are some newer files on the machine to which you copied the cache, only newer files are parsed.

See also
  Configuring Code Assistance Settings for C and C++ Projects
Using Properties Files for Version Controlled Projects

Copyright © 2014, Oracle and/or its affiliates. All rights reserved.