Main Content

padv.util.saveArtifactDatabase

Save copy of artifact database file

Since R2023b

    Description

    padv.util.saveArtifactDatabase(destination) saves a copy of the artifact database file in the destination specified by destination.

    The artifact database file, artifacts.dmr, is saved in the derived folder in the project root. This file tracks the project artifacts and their dependencies. Manually copying this file can lead to inconsistencies or incorrect behavior due to pending artifact changes.

    You can use this function to create base artifact database files and save copies of artifact database files from different feature branches or CI pipeline jobs.

    The function requires an open project and requires CI/CD Automation for Simulink Check.

    Note

    Only supported in R2023b Update 5 and later releases.

    example

    Examples

    collapse all

    Process Advisor and the build system are able to detect changes to project files and identify outdated tasks by using the information in the artifact database file artifacts.dmr. When your team works on a project with multiple feature branches, you might need to merge different versions of artifacts.dmr into a single file that contains the latest project analysis. To create the file, you need to save a copy of the base artifact database file and then merge the artifacts.dmr files from each branch.

    When your team members clone the project from source control, have them download the latest derived files, including the artifacts.dmr file that contains the latest analysis of the project. By default, digital thread stores the artifact database file inside the derived folder in the project root.

    You can use a database or repository management tool to handle derived files effectively.

    To resolve conflicts between the artifact database files from the different feature branches, you need to create a base artifact database file. Use the most recent artifacts.dmr file from the derived files as the base because that file represents the latest shared state of project analysis across the feature branches.

    Create a copy of the artifact database file inside the derived folder and name the file base.dmr.

    padv.util.saveArtifactDatabase(fullfile("derived","base.dmr"))

    As each team member works on their separate branches, the digital thread updates the artifacts.dmr file in their copy of the project to reflect their changes.

    After a team member makes the changes on their branch, use the function padv.util.saveArtifactDatabase in each branch to save a copy of the artifact database file from that branch. For example, you might have artifact database files like featureA.dmr and featureB.dmr.

    Merge the artifact database files into a new artifacts.dmr file by using the function padv.util.mergeArtifactDatabases. The base artifact database file is base.dmr and the artifact database files from the branches are featureA.dmr and featureB.dmr.

    padv.util.mergeArtifactDatabases(...
    Base = fullfile("derived","base.dmr"),...
    Branches = [fullfile("derived","featureA.dmr"), fullfile("derived","featureB.dmr")],...
    Merged = fullfile("derived","artifacts.dmr"))

    Input Arguments

    collapse all

    File destination for copied artifact database file, specified as a string.

    The path must be relative to the project root or an absolute path and must include the .dmr extension.

    Example: fullfile("derived", "base.dmr")

    Data Types: string

    Version History

    Introduced in R2023b