Main Content

matlab.project.convertDefinitionFiles

Change definition file type of project

Since R2020b

    Description

    matlab.project.convertDefinitionFiles(projectRoot,definitionType) converts the definition file type of the project stored in projectRoot to a new type specified by definitionType. matlab.project.convertDefinitionFiles preserves the source control history of your project.

    Warning

    To avoid merge issues, do not convert the definition file type more than once for a project.

    example

    Examples

    collapse all

    Check which definition file management your project uses currently.

    projectRoot = "C:/projects/myproject";
    proj = openProject(projectRoot);
    currentDefinitionFileType = proj.DefinitionFilesType
    currentDefinitionFileType = 
    
      DefinitionFiles enumeration
    
        MultiFile

    Close your project before converting the project definition file management.

    close(proj);

    Programmatically convert the project definition file management to use fixed-path multiple project files.

    matlab.project.convertDefinitionFiles(projectRoot,matlab.project.DefinitionFiles.FixedPathMultiFile)

    Check the new project definition file management.

    proj = openProject(projectRoot);
    newDefinitionFileType = proj.DefinitionFilesType
    newDefinitionFileType = 
    
      DefinitionFiles enumeration
    
        FixedPathMultiFile

    Input Arguments

    collapse all

    Full path to project root folder, specified as a character vector or string scalar.

    Example: "C:/projects/myproject"

    Data Types: char | string

    Definition file type, specified as matlab.project.DefinitionFiles.SingleFile, matlab.project.DefinitionFiles.MultiFile, or matlab.project.DefinitionFiles.FixedPathMultiFile.

    Choose a definition file type based on your use case:

    • MultiFile - Helps to avoid file conflicts when performing merge on shared projects

    • SingleFile - Is faster but is likely to cause merge issues when two users submit changes in the same project to a source control tool

    • FixedPathMultiFile - Is better if you need to work with long paths

    Version History

    Introduced in R2020b