Main Content

polyspace-project -generate-launching-script-for

(System Command) Generate files needed to run static analysis on a Polyspace Platform project

Since R2025a

Description

The polyspace-project -generate-launching-script-for system command generates files that allow you to run static analysis on a Polyspace® Platform project.

polyspace-project -generate-launching-script-for <myProject> [-product <productName>] [options] creates the files you need to run a Polyspace static analysis on the Polyspace Platform project <myProject>. By default, the command generates a launching script that runs a Polyspace Code Prover™ analysis.

Running this command generates the following files in the same directory as <myProject>:

  • launchingCommand.bat (Windows®) or launchingCommand.sh (Linux®) — Launching script that runs static analysis on <myProject>

  • options_command.txt — Information on the build configuration and static analysis configuration used by the launching script

  • source_command.txt — List of the project source files

  • temporal_exclusions.txt — If needed, a text file that contains any temporally exclusive tasks, as defined on the Static Analysis tab of the project Configuration pane

example

Examples

collapse all

Generate a launching script to run a Polyspace Code Prover analysis.

polyspace-project -generate-launching-script-for myProject.psprjx -product code-prover

Alternatively, generate a launching script to run a Polyspace Bug Finder™ analysis.

polyspace-project -generate-launching-script-for myProject.psprjx -product bug-finder

To run the static analysis, execute the launchingCommand script in your command window.

launchingCommand

Generate a launching script for static analysis and override the active build configuration with an alternative configuration BuildConfig2.

polyspace-project -generate-launching-script-for myProject.psprjx -build-config BuildConfig2

To see the build configurations for a project, open the project in the Polyspace Platform user interface. Then, in the Configuration pane, navigate to the Build tab, and expand the first drop-down list to see the names of the active build configuration and any alternatives.

To allow the command to overwrite a previously generated launching script and supporting files, use the -allow-overwrite option.

polyspace-project -generate-launching-script-for myProject.psprjx -build-config BuildConfig2 -allow-overwrite

Generate a launching script for static analysis and override the active static analysis configuration with an alternative configuration StaticConfig2.

polyspace-project -generate-launching-script-for myProject.psprjx -static-config StaticConfig2

To see the static analysis configurations for a project, open the project in the Polyspace Platform user interface. Then, in the Configuration pane, navigate to the Static Analysis tab, and expand the first drop-down list to see the names of the active static analysis configuration and any alternatives.

Generate a launching script for static analysis and override the value of the project variable PROJECTSRCDIR.

polyspace-project -generate-launching-script-for myProject.psprjx -var PROJECTSRCDIR="H:"

Overriding project variables can be helpful when sharing projects and running analyses on different machines, where file locations and paths may differ. To see the project variables for a project, open the project in the Polyspace Platform user interface. Then, in the Configuration pane, navigate to the Project tab, and scroll down to the Project Variables section.

To verify that the command successfully overrode the value of the project variable, check the generated files. Open source_command.txt and verify that the path to the source files is H:\sources\<file_name>.

Input Arguments

collapse all

Full or relative path to the Polyspace Platform project you want to generate a launching script for.

Example: myProject.psprjx

Example: "E:\dev_branch\Polyspace_projects\myProject.psprjx"

Polyspace product that the launching script uses to perform the analysis, specified as code-prover or bug-finder. If you do not specify an option, the command generates a launching script that runs a Polyspace Code Prover analysis.

Example: code-prover

Example: bug-finder

Optional Arguments

OptionDescription
-build-config <myBuildConfig>

Specify a build configuration <myBuildConfig> to override the active build configuration of the project. You can see a list of alternative build configurations for the project on the Build tab of the Configuration pane in the Polyspace Platform user interface.

-static-config <myStaticConfig>

Specify a static analysis configuration <myStaticConfig> to override the active static analysis configuration of the project. You can see a list of alternative static analysis configurations for the project on the Static Analysis tab of the Configuration pane in the Polyspace Platform user interface.

-var <newAssignment1> ... -var <newAssignmentN>

Override the value of a project variable with the new value <newAssignment1>. To override multiple variables, use this option multiple times. To learn more about project variables, see Add Resources Using Variables.

Example:-var PROJECTSRCDIR="H:"

-allow-overwrite

Allow the command to overwrite previously generated files.

Version History

Introduced in R2025a