Creating/Importing an Offline Index

The powerful C/C++ visualization and editing features provided by IBM® Rational® Developer for AIX and Linux are based on what is called an index, which is basically a database file which stores information about the structure of your project code. Typically, your project files are parsed to populate this index database, and then later when you use any of the C/C++ source aware features of the development environment, this database is used in part to look up information about your code. The time required to parse your source code and build an index from it varies depending on the size of the project. Similar to how your code is parsed and analyzed when you compile it, a small project can be parsed and indexed in a matter of seconds, whereas a large project can take hours. In order to help minimize the time required to use the source aware features of IBM® Rational® Developer for AIX and Linux, the IDE supports creating index files at the command line on a supported remote system, which can be later imported by the IDE in order to pre-populate the index with content without having to wait for a parse to run. In this way, one user on a team can manually create an index file at the command line and then share it with his or her colleagues, or alternatively the index can be generated by an automated command line build process (e.g. as a part of a nightly build or a continuous integration system) and then imported later by developers.


Creating An Index While Offline

The offline indexer can be run by a shell script called offlineIndexer.sh which is located under the IBM® Rational® Developer for AIX and Linux server directory on a supported remote system. The command format is as follows:

offlineIndexer.sh $SOURCE_DIRECTORY_INFULLPATH $OFFLINE_INDEXER_CONFIGFILE_INFULLPATH

where $SOURCE_DIRECTORY_INFULLPATH is the absolute path to the source code directory and $OFFLINE_INDEXER_CONFIGFILE_INFULLPATH is the absolute path to an offline indexer configuration properties file (the format of this file is described below).

After indexing has completed, an offline index zip is created under a .standalone_index directory under the source code directory.

Configuring The Offline Indexer


The offline indexer is configured by a properties file, which conforms to the Java properties format (typically, each line is of the format PROPERTY=VALUE). The list of allowable properties are listed in the following table. Properties that have defaults listed receive the specified value if there is no value specified.

A template configuration properties file is provided here, offlineIndex_config.properties.

Property Default Value Description
offlineIndexer_log_filename N/A The absolute path to a file to log progress and information to. By default, the log will be output to stdout
trace_level 0 Logging trace level: 0 - Log error messages, 1 - Log error and information
build_log_filename N/A The absolute path to a build log file, which the offline indexer can parse to find include paths and macros specified by the build process. These macros and include paths are used to configure the parser when your source code is indexed.
build_directory N/A Absolute path to the working directory that was used when the build log was generated.
projectScope_language_nature C/C++ The language type of the project, C/C++ or C
projectScope_complier_name XL The compiler used to build the source code. This influences how the code is parsed, as different compilers support different language dialects. Acceptable values are XL or GNU
compiler_executable_directory /usr/vacpp/bin/ for XL
and /usr/bin/ for GNU
The compiler executable directory. This is used to invoke the compiler in order to determine the compiler's built in macros and include paths.
projectScope_includePathes N/A Additional include paths to be used when parsing the source code.
projectScope_macros   Additional macros to be used when parsing the source code.
projectScope_encoding Cp1252 The Unicode code page of the source files. This setting is the default used for all source files for which a file specific setting has not been set.
$filename_encoding   Specifies a particular Unicode code page mapping for an individual file. The file name in the properties key must be relative to the source directory that is being indexed.
indexAllFiles true Boolean indicating whether all files should be parsed, regardless of whether or not they were built. Acceptable values are true and false.
skipReferences false Boolean indicating whether the indexer should skip all identifier references. Acceptable values are true and false.
skipTypeReferences false Boolean indicating whether the indexer should skip type references. Acceptable values are true and false.
skipMacroReferences false Boolean indicating whether the indexer should skip macro references. Acceptable values are true and false.
SUPPORT_VECTOR_TYPES true Boolean indicating whether the XL compiler language extension for vector types is enabled.
SUPPORT_DECIMAL_FLOATING_POINT_TYPES true Boolean indicating whether the XL compiler language extension for decimal floating point types is enabled.
SUPPORT_COMPLEX_IN_CPP true Boolean indicating whether the XL compiler language extension for the "complex" type is enabled.
SUPPORT_RESTRICT_IN_CPP true Boolean indicating whether the XL compiler language extension for the "restrict" keyword is enabled for C++ files.
SUPPORT_STATIC_ASSERT true Boolean indicating whether the XL compiler language extension for static assertions is enabled.

Importing an Index


An index file can be imported into a remote C/C++ project during the project's creation or into an existing remote C/C++ project.

  1. During project creation:

  2. Import an Index

  3. Importing an index into an existing remote C/C++ project:

  4. Import Index

  5. After the import has completed, a message dialog will pop up to confirm the index has finished importing.

  6. Import Complete

  7. Note: The index you import may have been created using different settings than your remote C/C++ project. If this is the case, another dialog page may appear to provide two further options; to continue importing the index, or to reindex the project instead.

  8. Different Settings

  9. If the import fails, a dialog will pop up asking whether you want to rebuild the index instead.

  10. Import Failed