updateDependency
Description
Examples
Update Package Dependency Version
The pkg
object represents the
MyPackage
, which depends on MyOtherPackage
. Update
MyPackage
so that it requires MyOtherPackage
to be
version 2.0.0
or higher.
pkg = updateDependency(pkg,"MyOtherPackage",">=2.0.0")
pkg = Package with properties: Package Definition Name: "MyPackage" DisplayName: "MyPackage" Version: 1.0.0 (1×1 Version) Summary: "" Description: "This is my first Package" Provider: <missing> Folders: PackageApp (1×1 PackageFolder) Dependencies: "MyOtherPackage@>=2.0.0" ReleaseCompatibility: "*" FormerNames: "" ID: "cabe1581-671d-40a2-8137-2b17847a9c65" Package Installation Installed: 0 Editable: 1 InstalledAsDependency: 0 PackageRoot: "C:\MyCode\MyPackage" InstalledDependencies: "" MissingDependencies: "" Repository Repository: [0×0 Repository] help MyPackage
Input Arguments
pkg
— Package
matlab.mpm.Package
object
Package, specified as a matlab.mpm.Package
object.
depName
— Package dependencies to update
string array | character vector | cell array of character vectors
Package dependencies to update, specified as a string array, character vector, or cell array of character vectors containing the name of the dependencies to update.
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:
VersionRange="1.2.3"
Example:
VersionRange="1.2.3-alpha"
Example:
VersionRange="1.2.3-alpha+exp"
Example:
VersionRange=">2.1.13"
Example:
VersionRange=">2.1.13 <=2.1.15"
Example:
VersionRange="<2.1.13 || >2.1.15"
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 (한국어)