qacli project create | modify
The create
subcommand creates a new Helix QAC project, and the modify
subcommand modifies an existing Helix QAC project.
Usage
project create -P <directory> [-K <config name>] [-n <name>] [-A <acf-file>] [-R <rcf-file>] [-C <cct-file>] ... [-a] [-U <user-messages-file>] [-V <vcf-file>] [--] [-h]
project modify -P <directory> [-K <config name>] [-n <name>] [-A <acf-file>] [-R <rcf-file>] [-C <cct-file>] ... [-a] [-d] [-m <replace|update|merge>] [-U <user-messages-file>] [-V <vcf-file>] [--] [-h]
Extended Description
The qacli project create
command creates a new Helix QAC project, with the following constraints:
- A Helix QAC project must not exist in the specified directory location.
- The specified directory need not exist but its parent directory must exist.
- The
‑‑qaf‑project
option is mandatory; the others are optional.
The optional ‑‑cct
argument must be a path to a valid Compiler Compatibility Template. If not specified, it will default to Helix_Generic_C.cct
and Helix_Generic_C++.cct
i.e. general purpose CCTs not tied to a specific compiler. This argument may be specified more than once to add support to a project with more than one compiler. The first compiler for any language is considered the ‘default’ compiler for the language.
The optional ‑‑rcf
argument must be a path to a valid Rule Configuration File. If not specified it will default to default‑<locale>.rcf
, so for English based systems it will be default‑en_US.rcf
and Japanese based systems it will be default‑ja_JP.rcf
.
The optional ‑‑acf
argument must be a path to a valid Analysis Configuration File. If not specified it will default to default.acf
(i.e. both C and C++).
The optional ‑‑name
argument can be used to name the project. If not specified when creating a project, it will default to the name of the parent directory. There are certain restrictions on what constitutes a valid name. See Filenames for further details.
The qacli project modify
command modifies an existing Helix QAC project, as long as the Helix QAC project exists in the specified directory location.
The optional ‑‑update‑method <replace|update|merge>
argument can be used updating a configuration file. This option specifies how the update is imported. For information on the methods of updating, see ‑‑update‑method, ‑m
The optional ‑‑default
argument can be used to indicate that the named CCTs should be marked as the default for that language.
Administration of User Messages File
A User Messages File allows you to assign your own messages for each component to existing or newly created diagnostic numbers. Optionally, you can set an associated HTML help file and references for a message. The User Messages File is a simple XML file that can be created manually or via the GUI. For more information, refer to Creating User Messages.
The ‑‑user‑messages
option, when used with qacli project create
(or modify
), will add the User Message XML file to your Helix QAC system.
Options
Name, shorthand | Default | Description |
---|---|---|
‑‑acf, ‑A
|
default.acf 1 |
Specify the path to an Analysis Configuration File. If a filename is specified instead of a path, it will be searched for in the user data location. |
‑‑auto‑cct, ‑a
|
Automatically detect and create CCTs during synchronisation of the project. | |
‑‑cct, ‑C
|
|
Specify the path to a Compiler Compatibility Template. The first CCT for each source language will be set as the default CCT. If a filename is specified instead of a path, it will be searched for in the user data location. |
‑‑config, ‑K
|
For projects with multiple configurations, specify which configuration to use. If none is specified, then the default configuration will be used. | |
( |
Indicate that the named CCTs should be marked as the default for that language. | |
‑‑help, ‑h
|
Displays usage information and exits. | |
‑‑ignore‑rest, ‑‑
|
Ignores the rest of the labeled arguments following this flag. | |
‑‑name, ‑n
|
<name of parent directory> 1 | Optional name of the project. If none is specified when creating a project, then it will default to the name of the parent directory. Only certain characters can be used. Consult the manual, Appendix C 'Filenames' for further details. |
‑‑qaf‑project, ‑P
|
Specify a path to a valid Helix QAC project to act upon. | |
‑‑rcf, ‑R
|
default-<locale>.rcf 1 |
Specify the path to a Rule Configuration File. If a filename is specified instead of a path, it will be searched for in the user data location. |
( |
Replace |
When updating a configuration file this option specifies how the update is imported. There are three methods of updating:
|
‑‑user‑messages, ‑U
|
Specify the path to a User Messages Configuration File. If a filename is specified instead of a path, it will be searched for in the user data location. | |
‑‑vcf, ‑V
|
Specify the path to a Version Control Configuration File. If a filename is specified instead of a path, it will be searched for in the user data location. |
1 Defaults when creating a project.
Examples
Basic Project Creation
This will create a new Helix QAC project, configured with primary analysers QAC and QAC++ using proxy compilers: Helix Generic C and Helix Generic C++.
The default analysis messages would be enabled (i.e. all of them). The project will be named: sample_c
Project Creation with Auto CCTs
You can create a project with the default ACF, RCF and automatically detect and create CCTs during synchronisation of the project by issuing a command such as:
Detailed Project Creation
This will create a new Helix QAC project, configured with QAC, using gcc 11.2 compiler, configured for C++11.
qacli project create --qaf-project /home/kmac/sample_c --acf default_c.acf --rcf m3cm-5.5.0-en_US.rcf --cct GNU_GCC-gcc_11.2-unknown-C-c11.cct --name "Sample MISRA"
The default MISRA messages are enabled. The project will be named: “Sample MISRA”.
Project Creation with Multiple CCTs
This will create a new Helix QAC project, configured with QAC, using g++ 11.2 compiler, configured for C++11 and C++14, with C++11 being the default compiler.
qacli project create --qaf-project /home/kmac/sample_c --cct GNU_GCC-g++_11.2-x86_64-generic-linux-C++-c++11.cct --cct GNU_GCC-g++_11.2-x86_64-generic-linux-C++-c++14.cct
The default analysis messages would be enabled (i.e. all of them). The project will be named: sample_c
Modifying Project RCF
If you have created a C project, set-up for MISRA C analysis, using a command like the following example:
qacli project create --qaf-project /home/kmac/sample_c --acf default_c.acf --rcf m3cm-5.5.0-en_US.rcf --cct GNU_GCC-gcc_11.2-unknown-C-c11.cct --name "Sample MISRA"
You can then modify it. For example, you can use the following command to add C++, set-up for MISRA C++:
qacli project modify --qaf-project /home/kmac/sample_c --acf default.acf --rcf m2cpp-1.0.0-en_US.rcf --cct GNU_GCC-g++_11.2-x86_64-generic-linux-C++-c++11.cct –name "Sample MISRA C and C++" --update-method merge
This will create a new Helix QAC project, configured with QAC, using g++ 11.2 compiler, configured for C++11 and C++14, with C++11 being the default compiler. The default analysis messages would be enabled (i.e. all of them). The project will be named: sample_c
Adding a New CCT
Assuming you had created a project with a command such as:
qacli project create --qaf-project /home/kmac/sample_c --cct GNU_GCC-g++_11.2-x86_64-generic-linux-C++-c++11.cct
You can then add C++14 (as the default), modify the project using a command such as:
qacli project modify --qaf-project /home/kmac/sample_c --cct GNU_GCC-g++_11.2-x86_64-generic-linux-C++-c++14.cct --default --update-method merge
Changing Default CCT
Assuming you had created a multiple CCT project with a command such as:
qacli project create --qaf-project /home/kmac/sample_c --cct GNU_GCC-g++_11.2-x86_64-generic-linux-C++-c++11.cct --cct GNU_GCC-g++_11.2-x86_64-generic-linux-C++-c++14.cct
The C++11 CCT will be considered the default for the C++ language – as it was the first one added. To switch to C++14 as the default, modify the project using a command such as:
qacli project modify --qaf-project /home/kmac/sample_c --cct GNU_GCC-g++_11.2-x86_64-generic-linux-C++-c++14.cct --default