blob: ee3771a942b901d99083efd1aa9f334f8854c761 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Sharing Parse Results of a Large C/C++ Project</title>
<meta name="DESCRIPTION" content="A short guide to sharing parse results of a C/C++ project in NetBeans IDE and Oracle Solaris Studio IDE.">
<meta name="keywords" content="NetBeans, Oracle Solaris Studio, IDE, integrated development environment,
tutorial, guide, user, documentation, open source, parse, results, share, C, C++">
<link rel="stylesheet" type="text/css" href="../../../netbeans.css">
<link rel="stylesheet" type="text/css" href="../../../print.css" media="print">
<link rel="stylesheet" type="text/css" href="../../../lytebox.css" media="screen">
<script type="text/javascript" src="../../../images_www/js/lytebox-compressed.js"></script>
</head>
<body>
<a name="top"></a>
<h1>Sharing Parse Results of a Large C/C++ Project</h1>
<div style="margin-left: 0px; font-style: italic;" class="articledate">
<p>Contributed by Vladimir Kvashin, maintained by Alyona Stashkova<br>
October 2013 [Revision number: V7.4-1]</p>
</div>
<p>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.</p>
<h3>Contents</h3>
<img src="../../../images_www/articles/73/netbeans-stamp-74-73.png" class="stamp"
alt="Content on this page applies to NetBeans IDE 7.3 and 7.4" title="Content on this page applies to the NetBeans IDE 7.3 and 7.4">
<ul class="toc">
<li><a title="Requirements" href="#requirements">Requirements</a></li>
<li><a title="Code Assistance Cache" href="#cache">Code Assistance Cache</a></li>
<li><a title="Sharing Code Assistance Cache" href="#share">Sharing Code Assistance Cache</a></li>
<li><a title="Dealing with Multiple Operating Systems or Compilers" href="#multiple">Sharing Cache between Machines with Different Operating Systems or Compilers</a></li>
<li><a title="More Information about C/C++/Fortran Support" href="#info">More Information about C/C++/Fortran Support</a></li>
</ul>
<h2><A NAME="requirements"></a>Requirements</h2>
<p><b>To follow this tutorial, you need the following software.</b></p>
<table>
<tbody>
<tr>
<th class="tblheader" scope="col">Software</th>
<th class="tblheader" scope="col">Version Required</th>
</tr>
<tr>
<td class="tbltd1"><a href="https://netbeans.org/downloads/index.html">NetBeans IDE (including C/C++ support)</a></td>
<td class="tbltd1">version 7.3 or 7.4</td>
</tr>
<tr>
<td class="tbltd1"><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">Java Development Kit (JDK)</a></td>
<td class="tbltd1">Version 6 or 7</td>
</tr>
</tbody>
</table>
<br>
<p>See the <a href="../../../community/releases/74/install.html">NetBeans IDE
Installation Instructions</a> and <a
href="../../../community/releases/74/cpp-setup-instructions.html">
Configuring the NetBeans IDE for C/C++/Fortran</a> for information about downloading and installing the required software.</p>
<a id="cache"></a>
<h2>Code Assistance Cache</h2>
<p>The NetBeans IDE stores parse results on a disk when parsing C/C++ source code. The saved data on a disk is called <tt>Code Assistance Cache</tt>.</p>
<p>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.</p>
<h2><a id="share"></a>Sharing Code Assistance Cache</h2>
<p>By default the Code Assistance Cache resides in the <code>${userdir}/var/cache</code>
folder (where <code><a href="http://wiki.netbeans.org/FaqWhatIsUserdir">${userdir}</a></code>
stands for the <a href="http://wiki.netbeans.org/FaqWhatIsUserdir">NetBeans user directory</a>)
and can be neither shared nor copied to another location.</p>
<p> 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: </p>
<div class="indent">
<ul>
<li>the operating system is identical to the operating system on the machine where the code was parsed on</li>
<li>the tool collection used by the project exists on the machine the cache is copied to and resides in the same location</li>
</ul>
</div>
<p><b>To instruct the NetBeans IDE to place the Code Assistance Cache inside your project metadata:</b></p>
<ol>
<li>Add the <code>cache.location=nbproject/private/cache</code> line to either:
<ul>
<li>the project properties file (<code>nbproject/project.properties</code>)</li>
<li>
the private properties file (<code>nbproject/private/private.properties</code>)</li>
</ul>
<p class="notes"><b>Note:</b> The difference between the project properties and private properties files is that the public one (<code>nbproject/project.properties</code>) is shared via version control system by default, while the private one (<code>nbproject/private/private.properties</code>)
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.</p>
</li>
<li>After the properties file is modified, close and reopen the project.<br> The IDE will parse the project and the Code Assistance Cache
will be placed into a private subdirectory in the project metadata.</li>
<li>
Close the project and archive your <code>nbproject/private/cache</code>
or copy it to a shared location.
<p class="notes"><b>Note:</b> Do not forget to close a project before copying or zipping,
otherwise some data will not be flushed to cache.</p>
</li></ol>
<p>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.</p>
<p>If there are some newer files on the machine the cache is being copied to,
only newer files are going to be parsed.</p>
<h2><a id="multiple"></a>Sharing Cache between Machines with Different Operating Systems or Compilers</h2>
<p>
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). </p>
<h2><a id="info"></a>More Information about C/C++/Fortran Support</h2>
<p>Please visit the <a href="../../../trails/cnd.html">C/C++ Learning Trail</a> for more information about using the C/C++ features of the NetBeans IDE.</p>
<p>Join the <a href="http://forums.netbeans.org/cnd-users.html">NetBeans C/C++ User Forum</a> to take part in discussions related to C/C++ development using the NetBeans IDE or ask for help. </p>
<p>You can file a bug or suggest an enhancement to <a href="https://netbeans.org/bugzilla/enter_bug.cgi?component=cnd">Bugzilla</a> (netbeans.org registration is required).</p>
<div class="feedback-box"><a href="mailto:users@cnd.netbeans.org?subject=Feedback:%20Sharing%20Parse%20Results%20of%20a%20Large%20C/C++%20Project%20-%20NetBeans%20IDE%207.3%20Tutorial">Send Feedback on This Tutorial</a></div>
<br style="clear: both;">
</body></html>