Kwanalysis
The kwanalysis command administers integration projects and builds and consolidates legacy executables (kwbuildproject, kwcheck, kwciagent) under one interface.
In order to use some of the following command options, you may need to have a specific permission level. See Enabling access to Klocwork projects for more information.
Usage
kwanalysis <subcommand> [<common_options>] [<subcommand_options>]
where
- <subcommand> is any of the kwanalysis subcommands covered in subsequent sections
- <common_options> are any of the options found in Options that apply to all kwanalysis subcommands
- <subcommand_options> are any of the options for the specified subcommand
You can also specify an arguments file for kwanalysis or for kwanalysis subcommands:
kwanalysis @<arguments_file> kwanalysis <subcommand> @<arguments_file>
You can create an arguments file to specify your command line arguments. Each argument must be specified on a separate line. (If the arguments file contains multibyte characters, the file must be UTF-8 encoded.)
Example
kwanalysis <subcommand> --tool-version <version> --tool-location <tool_location> <project_name> kwanalysis buildproject --tool-version 23.4 --tool-location /space/klocwork/23.4/buildtools Toolbus
Options that apply to all kwanalysis
The options in the table below apply to all of the subcommands. Subsequent sections provide information on kwanalysis subcommands and the options that apply to each.
| Name | Description |
|---|---|
| @<arguments_file> | specifies a text file containing subcommands and options. Allows a very long command line. |
| --tool-version | displays the version of Klocwork build tools you want this command to use |
| --url http(s)://<validate_server_host>:<validate_server_port>/ | URL for the Validate Server. Use https:// if a secure Validate Server connection has been configured.
|
| --verbose | print verbose information about program execution, which can help to troubleshoot errors |
| --version | get version information |
kwanalysis buildproject
The kwanalysis buildproject subcommand runs the integration build analysis and performs the following stages:
- compilation
- issue detection
- linking
- report generation
Notes
- kwanalysis buildproject automatically generates and uses precompiled header information.
- kwanalysis buildproject returns exit code 0 if the process was successful. Exit code 1 is returned when something went wrong but no tables were generated. Exit code 2 is returned when tables were generated but there was a critical error during the build (such as missing includes and compiler failures). For more information about C# exit codes, see below.
- In addition to the tables directory, during analysis kwanalysis buildproject will use additional space in your temp directory. The location of your temp directory is specified by your system's environment variables.
- kwanalysis buildproject can be run for a stream. For example:
kwanalysis buildproject --project base/stream kwinject.out -o tables
Usage
kwanalysis buildproject --tables-directory <dir> --url http://<validate_server_host>:<validate_server_port>/<server_project> [<other_options>] <build_specification_1> [<build_specification_2>...]
where:
- <dir> is the output tables directory. The --tables-directory option is mandatory.
- <validate_server_host>:<validate_server_port> and <server_project> identify the project for which you want to run the analysis, and the Klocwork Server where the project is located
- <other_options> are any of the options from the table below
- <build_specification_1> is a build specification. You can specify any number of build specifications with this command.
You can also specify an arguments file for kwanalysis buildproject:
kwanalysis buildproject @<arguments_file>
You can create an arguments file to specify your command line arguments. Each argument must be specified on a separate line. (If the arguments file contains multibyte characters, the file must be UTF-8 encoded.)
kwanalysis buildproject --tables-directory C:\Klocwork\My_tables --url http://myserver:8080/myproject --tool-version 23.4 --tool-location C:\Klocwork\23.4\buildtools MyProject C:\Klocwork\kwinject.out
| Options | Description |
|---|---|
| --sync-checkers | Syncs all custom checkers on the server with the analysis tools while running the build project command. Example: kwanalysis buildproject --sync-checkers |
For additional subcommands and options for kwanalysis buildproject, see its Kwbuildproject equivalents.
kwanalysis check
Kwanalysis check or kwcheck is a desktop analysis tool for C/C++, C#, and Java developers using IDEs and text editors that aren't supported by Klocwork in the form of an IDE plug-in. For how-to information, see Getting started with kwcheck for C/C++ and Getting started with kwcheck for Java.
Usage
kwanalysis check [<options>]
For information, subcommands, and options for kwanalysis check, see its Kwcheck equivalents.
kwanalysis ciagent
kwanalysis ciagent or kwciagent is a continuous integration (CI) analysis tool for C/C++, C#, and Java developers, similar to kwanalysis check kwcheck. Whereas kwanalysis check is used on developer's desktops, kwanalysis ciagent can be used on CI systems to analyze changed code.
Usage
kwanalysis ciagent [<options>]
For information, subcommands, and options for kwanalysis ciagent, see its Kwciagent equivalents.
kwanalysis deploy
kwanalysis deploy performs a sync of your custom checkers from project to tool. It is analogous to kwdeploy, but will sync the tools to a specified location.
Usage
kwanalysis deploy --tool-location <tool_location>
Example
kwanalysis deploy --tool-location /space/klocwork/23.4/buildtools
For additional subcommands and options for kwanalysis deploy, see its Kwdeploy equivalents.
kwanalysis wrapper
kwanalysis wrapper generates a portable environment bootstrap artifacts to enable zero local pre-install analysis.
Usage
kwanalysis wrapper --project <project-name>