As a basic execution unit in the Hvigor build process, a task usually contains a segment of executable code, and it can depend on multiple other tasks. During task scheduling, Hvigor parses dependencies to determine the task execution sequence.
UP-TO-DATE
This task ID indicates that the task is not actually executed. Hvigor supports the incremental task skipping mechanism. If the input and output conditions of a task do not change during secondary task execution, the task is skipped to improve the build efficiency.
Example:
> hvigor UP-TO-DATE ::PackageApp...
Finished
This task ID indicates that the task is finished.
Example:
> hvigor Finished ::PackageApp... after 310 ms
A task is registered using the HvigorNode object.
// Import the module.
import { getNode, HvigorNode, HvigorTask } from '@ohos/hvigor'; // Obtain the current hvigorNode object.
const node: HvigorNode = getNode(__filename);
// Register the task.
node.registerTask({
name: 'customTask',
run() {
console.log('this is Task');
}
}); Execute the task using the Hvigor command line tool.
hvigorw customTask
