polyspace.project.BuildConfigurationRef Class
R2026bNamespace: polyspace.project
(Python) Manage references from project to external build configurations
Since R2026a
Description
This Python® class contains information about an external build configuration that is saved
in a separate file, referenced by a Polyspace® Platform project. Polyspace supports two file formats for external configurations: the native JSON-based
format (.pscfg) and the human-readable TOML format (.toml.pscfg). Saving your build configurations in
external files and referencing those files from one or more projects enables you to create a
modular project structure that improves sharing and version control workflows. For more
information about project structure, see Modularize Project by Using External Configurations, Test References, and External Stub Files.
To work with external build configurations, use this class, which contains the name of the
build configuration and the path to the external configuration file where it is saved,
together with the polyspace.project.BuildConfiguration class, which contains the build
configuration.
To work with build configurations that are attached to a specific project, see polyspace.project.OwnedBuildConfiguration.
Creation
Syntax
Description
Import Configuration by Reference
buildConfigRef = proj.BuildConfigurationRefs.add(
adds a reference from the project to the build configuration
buildConfig, buildConfigRefName)buildConfig, which is an existing external configuration file
(.pscfg or .toml.pscfg) or a
polyspace.project.BuildConfiguration object. The
Name property of the resulting
polyspace.project.BuildConfigurationRef object is set to
buildConfigRefName.
buildConfigRef = proj.BuildConfigurationRefs.add(
adds a reference from the project to an existing
buildConfigRefObj)polyspace.project.BuildConfigurationRef object
buildConfigRefObj and inherits the configuration name.
buildConfigRef = proj.BuildConfigurationRefs.add(
adds a reference from the project to an existing
buildConfigRefObj, buildConfigRefName)polyspace.project.BuildConfigurationRef object
buildConfigRefObj. Use the buildConfigRefName
argument to set the Name property of the resulting
buildConfigRef object.
Convert Configuration
buildConfigRef = proj.BuildConfigurationRefs.moveAsRef(
converts the existing ownedBuildConfigObj,buildConfigFile)ownedBuildConfigObj to a
polyspace.project.BuildConfigurationRef object in the same project.
After conversion, the project references the external configuration saved in
buildConfigFile. You can specify
buildConfigFile as an absolute or relative path, where relative
paths are considered relative to the location of the .psprjx project
file. The resulting polyspace.project.BuildConfigurationRef object
has its Path property set to buildConfigFile and
its Name property is inherited from the owned build
configuration.
buildConfigRef = proj.BuildConfigurationRefs.moveAsRef(
converts the existing ownedBuildConfigObj,buildConfigFile, buildConfigRefName)ownedBuildConfigObj to a
polyspace.project.BuildConfigurationRef object in the same project.
After conversion, the project references the external configuration saved in
buildConfigFile. You can specify
buildConfigFile as an absolute or relative path, where relative
paths are considered relative to the location of the .psprjx project
file. The resulting polyspace.project.BuildConfigurationRef object
has its Path property set to buildConfigFile and
its Name property is set by the
buildConfigRefName argument you provide.
buildConfigRef = proj.BuildConfigurationRefs.moveAsRef(
converts the existing ownedBuildConfigObj,buildConfigFile, configFileFormat)ownedBuildConfigObj to a
polyspace.project.BuildConfigurationRef object in the same project
and saves the external configuration in the format specified by
configFileFormat.
Input Arguments
Properties
Methods
Examples
Version History
Introduced in R2026aSee Also
polyspace.project.Project | polyspace.project.CodeInfo | polyspace.project.BuildConfiguration | polyspace.project.OwnedBuildConfiguration | polyspace.project.StaticAnalysisConfigurationRef | polyspace.project.TestConfigurationRef
Topics
- Get Started with Python API for Polyspace
- Create Easily Shareable Projects for Version Control
- Share and Reuse Configuration Variants
- Modularize Project by Using External Configurations, Test References, and External Stub Files
- Modularize Existing Project by Using Polyspace Python API
- Create Project Dynamically by Using Polyspace Python API