listRequiredFiles

Get project file dependencies

Description

example

files = listRequiredFiles(proj,file) returns the names of the files that the specified file requires to run.

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;

Get the files required by the Times Table app file.

file = "source/timestable.mlapp"
files = listRequiredFiles(proj, file);
files = 

  2×1 string array

    "C:\myProjects\examples\TimesTableApp\source\timestable.mlapp"
    "C:\myProjects\examples\TimesTableApp\source\timesTableGame.m"

Input Arguments

collapse all

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

Path of the file, including the file extension, specified as a character vector, string scalar, or a ProjectFile object. Specify file as an absolute file path or a path relative to the project root folder. The file must be within the root folder.

Output Arguments

collapse all

Required files, returned as a string array.

Introduced in R2019a