Main Content

removeDependency

Remove dependency from package

Since R2024b

    Description

    removeDependency(pkg,dep) removes the packages in dep from the package pkg 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 and MyOtherPackage.

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

    Make MyOtherPackage a dependency of MyPackage.

    addDependency(pkg,dep)
    pkg.Dependencies
    ans = 
      Dependency with properties:
    
                   Name: "MyOtherPackage"
           VersionRange: ""
                     ID: "6d25ab96-dac2-48a6-836c-64402ca5d8d1"
        ResolvedVersion: 1.0.0 (1×1 Version)
    
    

    Remove MyOtherPackage as a dependency of MyPackage.

    removeDependency(pkg,dep)
    pkg.Dependencies
    ans = 
    
      1×0 Dependency array with properties:
    
        Name
        VersionRange
        ID
        ResolvedVersion
    

    Input Arguments

    collapse all

    Package, specified as a matlab.mpm.Package object.

    Package dependencies to remove, specified as a string array of package specifiers, a matlab.mpm.PackageSpecifier array, a matlab.mpm.Package array, or a matlab.mpm.Dependency array.

    Version History

    Introduced in R2024b