runChecks

Run all project checks

Description

example

checkResults = runChecks(proj) runs checks on the specified project. The checks detect problems with the project integrity such as missing files, unsaved files, files not under source control, or out-of-date derived files.

You must update the project dependencies if you want to check derived files are up to date. This can be time-consuming for larger projects. To exclude the derived files check do not update dependencies before calling runchecks.

Examples

collapse all

Open the Times Table App project. Use currentProject to create a project object from the currently loaded project.

matlab.project.example.timesTable
proj = currentProject;

For large projects, run all the project checks except the derived files check, as it can be time-consuming.

checkResults = runChecks(proj)
  11×1 ProjectCheckResult array with properties:

    ID
    Description
    Passed
    ProblemFiles

Open the Times Table App project. Use currentProject to create a project object from the currently loaded project.

matlab.project.example.timesTable
proj = currentProject;

You must first update the project dependencies if you want to check derived files are up to date.

updateDependencies(proj);

Run all the project checks.

checkResults = runChecks(proj)
 checkResults = 

  11×1 ProjectCheckResult array with properties:

    ID
    Description
    Passed
    ProblemFiles

Use the ID, Passed, and ProblemFiles properties to get information about the first check. The first check passed and found no problems. All project definition file are under source control.

id = checkResults(1).ID
status = checkResults(1).Passed
problems = checkResults(1).ProblemFiles
id = 

    "Project:Checks:ProjectDefinitionFilesUnderSourceControl"


status =

  logical

   1


problems = 

  0×0 empty string array

The check for derived files passed and detected no problem files. All derived files are up to date.

id = checkResults(9).ID
status = checkResults(9).Passed
problems = checkResults(1).ProblemFiles
id = 

    "Project:Checks:OutOfDateDerivedFiles"


status =

  logical

   1


problems = 

  0×0 empty string array

Input Arguments

collapse all

Project, specified as a matlab.project.Project object. Use currentProject to create a project object from the currently loaded project.

Output Arguments

collapse all

Project checks, returned as an array of ProjectCheckResult objects with properties.

Introduced in R2020a