matlab.mpm.Dependency
Description
A dependency is a package that a different package depends on. Use
matlab.mpm.Dependency
objects to specify package dependencies for a
matlab.mpm.Package
object.
Creation
Description
Input Arguments
name
— Dependency name
string scalar | character vector
Dependency name, specified as a string scalar or character vector containing the name of the dependency.
This argument sets the Name
property.
Example: "MyOtherPackage"
verRange
— Version range
string scalar | character vector | matlab.mpm.Version
object
Version range, specified as a string scalar, character vector, or matlab.mpm.Version
object. This option limits the output to only packages
whose Version
property is within the specified version range.
Version syntax follows the Semantic
Versioning 2.0.0 format:
,
where each version number must be a nonnegative integer, for example
<major
version>
.<minor
version>
.<patch version>
1.2.3
. You can optionally specify a pre-release version by adding
-
to the end
of the version, for example <pre-release version>
1.2.3-alpha
. Optionally specify a build
version by adding +
<build
version>
.
Specify a range of versions by including the <
,
<=
, >
, or >=
operators
in front of a version number. For example, >2.1.13
specifies all
versions greater than 2.1.13
. Specify more than one range separated
by white space to further limit matches. For example, >2.1.13
<=2.1.15
includes versions 2.1.14
and
2.1.15
, but not 2.1.13
or
2.1.16
. Use the ||
operator to designate
multiple acceptable version ranges. For example, <2.1.13 ||
>2.1.15
includes versions less than 2.1.13
and greater
than 2.1.15
, but not 2.1.14
.
Example:
"1.2.3"
Example:
"1.2.3-alpha"
Example:
"1.2.3-alpha+exp"
Example:
">2.1.13"
Example:
">2.1.13 <=2.1.15"
Example:
"<2.1.13 || >2.1.15"
id
— Package identifier
string scalar | character vector
Package identifier, specified as a string scalar or character vector containing a unique identifier of the dependency.
This argument sets the ID
property.
Example: "9ecfea6b-1710-4fb9-aa66-e4750f0e8251"
Properties
Name
— Dependency name
string scalar | character vector
Dependency name, specified as a string scalar or character vector containing the name of the dependency.
VersionRange
— Version range
"*" (default) | string scalar | character vector | matlab.mpm.Version
object
Version range, specified as a string scalar, character vector, or matlab.mpm.Version
object. By default, this property is "*", which
represents all versions.
Version syntax follows the Semantic
Versioning 2.0.0 format:
,
where each version number must be a nonnegative integer, for example
<major
version>
.<minor
version>
.<patch version>
1.2.3
. You can optionally specify a pre-release version by adding
-
to the end
of the version, for example <pre-release version>
1.2.3-alpha
. Optionally specify a build
version by adding +
<build
version>
.
Specify a range of versions by including the <
,
<=
, >
, or >=
operators in
front of a version number. For example, >2.1.13
specifies all
versions greater than 2.1.13
. Specify more than one range separated
by white space to further limit matches. For example, >2.1.13
<=2.1.15
includes versions 2.1.14
and
2.1.15
, but not 2.1.13
or
2.1.16
. Use the ||
operator to designate
multiple acceptable version ranges. For example, <2.1.13 ||
>2.1.15
includes versions less than 2.1.13
and greater
than 2.1.15
, but not 2.1.14
.
ID
— Package identifier
string scalar
Package identifier, returned as a string scalar containing a unique identifier of the dependency.
ResolvedVersion
— Resolved dependency version
matlab.mpm.Version
object
Resolved dependency version, returned as a matlab.mpm.Version
object. When installing the dependency package, MATLAB sets this property using the
installed version of the dependency.
Example: matlab.mpm.Version("1.2.3")
Examples
Create Package Dependency
Create a package dependency using a package named
MyPackageDependency
.
dep = matlab.mpm.Dependency("MyPackageDependency","1.2.3","4ca03e45-70d0-44b3-b0e5-ac18cf32d534")
dep = Dependency with properties: Name: "MyPackageDependency" VersionRange: "1.2.3" ID: "4ca03e45-70d0-44b3-b0e5-ac18cf32d534" ResolvedVersion: <missing>
Version History
Introduced in R2024b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)