matlab.buildtool.tasks.PackageTask Class
R2026bNamespace: matlab.buildtool.tasks
Superclasses: matlab.buildtool.Task
Description
The matlab.buildtool.tasks.PackageTask class provides a built-in task for building a package
(.mltbx file) from a TOML project. A task created from the
PackageTask class automatically uses the configuration in the matlab.toml project
definition file. For more information about TOML projects, see MATLAB Projects TOML Format (.toml).
Tasks that you create with the PackageTask class support incremental
builds. For more information, see Up-to-Date Check.
Creation
Description
task = matlab.buildtool.tasks.PackageTask creates
a task for building a package from a TOML project that defines a single package.
task = matlab.buildtool.tasks.PackageTask(
creates a task for building the package with the specified name. Specifying
packageName)packageName is optional if the TOML file defines a single package.
If the TOML file defines multiple packages, you must specify the name of the package to
build.
task = matlab.buildtool.tasks.PackageTask(___,Name=Value)
sets the Description and Dependencies properties
using one or more name-value arguments in addition to any of the input argument
combinations in previous syntaxes. The class inherits these properties from the Task class. For
example, task =
matlab.buildtool.tasks.PackageTask("MyPackage",Dependencies=["pcode" "mex"])
creates a task that builds a package named "MyPackage" and that depends
on the "pcode" and "mex" tasks.
Input Arguments
Properties
Examples
More About
Tips
You cannot overwrite or remove the action of a built-in task, but you can specify additional task actions. For example, append an action to the
Actionsproperty of a built-in task.plan("myTask").Actions(end+1) = @myAction;
Version History
Introduced in R2026b
