Updating Polyspace Project File using Command Line Interface

8 views (last 30 days)
I have developed Windows Batch Script to run polyspace from the command-line and it is totally working fine. Syntax '-generate-launching-script-for PRJFILE' has been used to create scripts for command line execution of bug-finder and code-prover with no desktop. I have been looking for a command to update 'PRJFILE.psprj' when project 'sources' folder has new files.
  1 Comment
Matt Rhodes
Matt Rhodes on 29 Jun 2018
Edited: Matt Rhodes on 27 Jul 2018
Hi Charan-
There are a few ways to go about this, and it would be helpful to better understand your goal. For example, are you trying to keep using the psprj files outside of your script, or do you only use that psprj file as the means to launch a verification each time? Do you need to do anything else with the results once you have them, or do they simply get passed elsewhere? If you dont actually need the psprj file again for anything but launching a verification, you could just modify the launching script by removing the sources_command.txt reference from the options_command.txt file, and change it to be '-sources C:/path/to/sources/*.c' where your path is put in for C:/path/to/sources. You'll still have to keep up with changes such as new macros, new include paths, etc. This would be the case for updating the psprj anyway.
For what its worth, if you're willing to use the MATLAB API for Polyspace, it allows you to create configurations objects which you can use to generate psprj files. This becomes useful when you have more complex build schemes. The API in R2017b started letting you work with results from a verification. Starting in R2018a, a polyspace.Project was introduced, which has built in run methods to allow you to launch Polyspace, and see an associated configuration.
Alternatively, if you're stuck using the CLI, polyspace-configure, which is available on both the command line and in the MATLAB API allows you to generate psprj files based upon watching your build. This is nice because it will keep up with several kinds of changes in your build, rather than just new files in a single folder. New macros added from your build, and more complex source folder structures are much easier to manage.

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!