Main Content

listAllProjectReferences

List all projects in reference hierarchy of current project

Since R2021a

Description

example

allreferences = listAllProjectReferences(proj) returns a list of all projects in the reference hierarchy of the specified project.

Examples

collapse all

Use currentProject to create a project object from the currently loaded project.

openProject("C:/projects/myproject/");
proj = currentProject;

Get all the projects in the loaded project hierarchy.

allreferences = listAllProjectReferences(proj)
allreferences = 

  1×2 ProjectReference array with properties:

    Project
    File
    StoredLocation
    Type

Query the first referenced project.

allreferences(1)
ans = 

  ProjectReference with properties:

           Project: [1×1 matlab.project.Project]
              File: "C:\projects\myproject\referencedproject1"
    StoredLocation: "../referencedproject1"
              Type: "Relative"

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

All referenced projects, returned as an array of ProjectReference objects.

Version History

Introduced in R2021a