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 thefilter
task) using any global buildfile filters takes place. Nested filters that are specified using<filterset>
are always applied, regardless of this attribute. Defaults tofalse
.-
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 tofalse
.-
includeemptydirs
(all, boolean, N) If
true
, empty directories are also copied. Defaults totrue
.-
overwrite
(all, boolean, N) If
true
, files are copied even when destination files are newer. Defaults tofalse
.-
preservelastmodified
(1.3, 1.4, String, N) If
true
, destination files are given the same last modified timestamp as source files. Defaults tofalse
.-
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.