<mkdir>

The <mkdir> task (see Table 4.62) enables you to create a new directory in the file system. All nonexistent directories in the provided path will be created, so there is no need to create each directory in the path separately.

A common use of <mkdir> in a project is as an initialization target to set up the project directory structure.

Table 4.62. Table of <mkdir> Attributes
Attributes (Required) Description
Dir The directory to be created.

Example

The following example illustrates how you use <mkdir> to create a directory named project/lib/ext in the base directory. If the project and lib directories in the path don’t exist, they are created also.

<mkdir dir = "project/lib/ext"/> 

Get Ant Developer’s Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.