addDependency - Add dependency to package - MATLAB (original) (raw)

Main Content

Add dependency to package

Since R2024b

Syntax

Description

addDependency([pkg](#mw%5F9ca9a4c7-589b-4c84-866b-9beb9ef54281),[dep](#mw%5Fc0dbe0b1-058e-4664-af7c-3d437053e320)) adds the packages in dep as dependencies to the packagepkg and updates the Dependencies property of the package object. The package pkg must be in editable mode.

example

Examples

collapse all

Create packages named MyPackage andMyOtherPackage.

pkg = mpmcreate("MyPackage","C:\MyCode\MyPackage"); dep = mpmcreate("MyOtherPackage","C:\MyCode\MyOtherPackage");

Make MyOtherPackage a dependency ofMyPackage.

addDependency(pkg,dep) pkg.Dependencies

ans = Dependency with properties:

           Name: "MyOtherPackage"
   VersionRange: ""
             ID: "89529df1-1fb9-46a5-8ea3-731edb9ab4f8"
ResolvedVersion: 1.0.0 (1×1 Version)

Input Arguments

Version History

Introduced in R2024b