qacli project roots

Manage project root entries for a project.

Usage

project roots  {-A <name>|-R <name>|-L} -P <directory> [-p <directory>] [-f] [--] [-h]

Extended Description

Code bases, in general, consist of many projects, sub-projects, components and/or modules. Often, the build of each entity is dependent on information from other entities, such as include directories. Helix QAC projects are designed to be portable.

For example, they can be checked into version control on one machine, and then checked out on another machine for analysis. However, for this to work, dependencies, such as third party and project include directories, must be capable of being located wherever the project has been checked out or moved.

Helix QAC allows you to set multiple root directories for source files. In many cases, just a single root directory is enough, but you may need more than one root directory - for example, if your project uses third party code. For more information, see Setting the Root Directory of Your Sources.

By default, a Helix QAC project will always contain at least two roots:

  • PROJECT_ROOT: Location of the Helix QAC project i.e. the directory the prqaproject.xml file resides in.
  • SOURCE_ROOT: The location of the projects source code. If none has been explicitly set then it will default to PROJECT_ROOT.

Roots are normally stored in prqaproject.xml, which makes them specific to the project. If you add a root that already exists in the project then this root will be stored in a different location, overriding the entry in prqaproject.xml. This allows a user to tailor the root to their environment, but not change the underlying project.

Options

Name, shorthand Default Description
‑‑add, ‑A   Add the given root to the project. Use the name SOURCE_ROOT to specify the location of the source code.
‑‑force, ‑f   Force the root to be specific to the project.
‑‑help, ‑h   Displays usage information and exits.
‑‑ignore‑rest, ‑‑   Ignores the rest of the labeled arguments following this flag.
‑‑list, ‑L  

Show all roots in the project.

‑‑path, ‑p   Path to the directory of the root. No manipulation of the path is done – it is passed exactly as specified.
‑‑remove, ‑R   Remove the given root from the project.
‑‑qaf‑project, ‑P . Specify a path to a valid Helix QAC project.

Examples

Setting the SOURCE_ROOT for a Project

This will change the location of the SOURCE_ROOT within the project:

qacli project roots -P . --add SOURCE_ROOT --path /home/katie/src –-force

Changing the Location of SOURCE_ROOT

This will change the location of the SOURCE_ROOT but will not change it within the project:

qacli project roots -P . --add SOURCE_ROOT --path /home/steve/src

Listing Roots in a Project

This will list all roots in the project:

qacli project roots -P . --list

Where a root exists at more than one level, only the most important entry will be shown. For example, "user" will be shown over "project".

Containing Roots Within Roots

A root can also contain another root. Take care with argument quoting to avoid the shell interpreting the variable.

qacli project roots  -P . --add THIRD_PARTY_PARENT --path ‘/home/steve’ --force
qacli project roots  -P . --add THIRD_PARTY_ROOT --path ‘${THIRD_PARTY_PARENT}/src’ --force