Step 1. Create and Finalize the Project XML to Define the Task
Step 1. Create and Finalize the Project XML to Define the Task
The first step to create a custom task is to finalize how the task is defined within the project XML. For this simple task, we will use the following XML fragment to define our copy task:
When you add a custom task to a Project, the XML fragment will be created and added to the project XML.
All tasks have a unique tag name, which is defined by the task’s author. For our example task, we have chosen “copy” to be the tag name for our task. All custom tasks must also have a namespace. The namespace can be any string, but ideally should represent the entity that created the custom task. In this example, we have chosen “example” as the namespace for our task.
The following two attributes are also defined in the XML:
sourceFile – This is the path to the file that you want to copy.
destinationDirectory – The destination directory to which the source file should be copied.