Name

copy

Synopsis

Copies files and directories to new locations. A file is copied when the destination file does not exist or when the source file is newer than the destination.

Attributes

file (all, File, *)

Specifies a single file to copy. Use nested <fileset>s to copy multiple files.

filtering (all, boolean, N)

If true, token filtering (see the filter task) using any global buildfile filters takes place. Nested filters that are specified using <filterset> are always applied, regardless of this attribute. Defaults to false.

flatten (all, boolean, N)

If true, the directory structure of the source files is not preserved, and all files are copied to a single destination directory. You can achieve the same results using a nested <mapper>. Defaults to false.

includeemptydirs (all, boolean, N)

If true, empty directories are also copied. Defaults to true.

overwrite (all, boolean, N)

If true, files are copied even when destination files are newer. Defaults to false.

preservelastmodified (1.3, 1.4, String, N)

If true, destination files are given the same last modified timestamp as source files. Defaults to false.

todir (all, File, *)

The destination directory to which files are copied.

tofile (all, File, *)

The destination file, applicable only when a single file is copied using the file attribute.

Either the file attribute must be set, or at least one nested <fileset> must be specified. When the file attribute is set, either the todir or tofile attribute is required. When nested <fileset> elements ...

Get Ant: The Definitive Guide 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.