Create Project in Polyspace Desktop User Interface Using Configuration Template
This topic shows how to export and reuse a configuration in the user interface of the Polyspace® desktop products.
If using the Polyspace Server products, see Set Up Bug Finder Analysis on Servers During Continuous Integration.
If using Polyspace as You Code, see Set Up Polyspace Analysis in IDEs.
A configuration template is a predefined set of analysis options for a specific compilation environment.
Why Use Templates
Use templates to simplify your project setup. For instance, after you configure a project for a specific compilation environment, you can create a template out of the configuration. Using the template, you can reuse the configuration for projects that have the same compilation environment.
When creating a new project, you can do one of the following:
Use an existing template to automatically set analysis options for your compiler.
Polyspace software provides predefined templates for common compilers such as
IAR
,Kiel
,Visual
andVxWorks
. For additional templates, see Polyspace Compiler Templates.Set analysis options manually. You can then save your options as a template and reuse them later. You can also share the template with other users and enforce consistent usage of Polyspace Bug Finder™ in your organization.
Use Predefined Template
Select File > New Project.
On the Project – Properties dialog box, after specifying the project name and location, under Project configuration, select Use template.
On the next screen, select the template that corresponds to your compiler. For further details on a template, select the template and view the Description column on the right.
If your compiler does not appear in the list of predefined templates, select Baseline_C or Baseline_C++.
On the next screen, add your source files and include folders.
Create Your Own Template
This example shows how to save a configuration from an existing project and create a new project using the saved configuration.
To create a template from a project that is open on the Project Browser pane:
Right-click the project configuration that you want to use, and then select Save As Template.
Enter a description for the template, then click Proceed. Save your template file.
Suppose you create a Code Prover configuration template that runs Code Prover analysis to a precision level of 1 and a verification level of 1. See:
Precision level (-O0 | -O1 | -O2 | -O3)
(Polyspace Code Prover)Verification level (-to)
(Polyspace Code Prover)
You can enter this description for the template.
When you create a new project, to use a saved template:
Select .
Navigate to the template that you saved earlier, and then click Open. The new template appears in the Custom templates folder on the Templates browser. Select the template for use.
Sharing Project Templates
A configuration template stores all options set on the Configuration pane in the Polyspace desktop user interface. If you share the template, another user who uses the template can benefit from those options.
Note however that options that refer to specific files point to their absolute paths. If a shared template sets one of those options, the corresponding file must also be shared. Preferably, the shared file must be in the same location as when the template was created, otherwise end-users have to modify the template to point to a new location. If you set one of those options in a configuration template that is meant to be shared with other users, make sure that the corresponding file is in a location accessible to the end-users. Some common options that refer to specific files are:
Command/script to apply to preprocessed files (-post-preprocessing-command)
andCommand/script to apply after the end of the code verification (-post-analysis-command)
Set checkers by file (-checkers-selection-file)
andCheckers activation file (-checkers-activation-file)
Command-line-only options such as
-options-file
and-code-behavior-specifications
. In the Polyspace user interface, you enter these options in theOther
field.