Specifies the destination of a copy.
Type | Name and description |
---|---|
CopyProcessingSpec |
eachFile(Action<? super FileCopyDetails> action) Adds an action to be applied to each file as it is about to be copied into its destination. |
CopyProcessingSpec |
eachFile(Closure closure) Adds an action to be applied to each file as it about to be copied into its destination. |
Integer |
getDirMode() Returns the Unix permissions to use for the target directories. |
Integer |
getFileMode() Returns the Unix permissions to use for the target files. |
CopyProcessingSpec |
into(Object destPath) Specifies the destination directory for a copy. |
CopyProcessingSpec |
rename(Closure closure) Renames a source file to a different relative location under the target directory. |
CopyProcessingSpec |
rename(String sourceRegEx, String replaceWith) Renames files based on a regular expression. |
CopyProcessingSpec |
rename(Pattern sourceRegEx, String replaceWith) Renames files based on a regular expression. |
CopyProcessingSpec |
setDirMode(Integer mode) Sets the Unix permissions to use for the target directories. |
CopyProcessingSpec |
setFileMode(Integer mode) Sets the Unix permissions to use for the target files. |
Methods inherited from class | Name |
---|---|
interface ContentFilterable |
expand, filter, filter, filter |
Adds an action to be applied to each file as it is about to be copied into its destination. The action can change the destination path of the file, filter the contents of the file, or exclude the file from the result entirely. Actions are executed in the order added, and are inherited from the parent spec.
action
- The action to execute.Adds an action to be applied to each file as it about to be copied into its destination. The given closure is called with a FileCopyDetails as its parameter. Actions are executed in the order added, and are inherited from the parent spec.
closure
- The action to execute. Returns the Unix permissions to use for the target directories. null
means that existing
permissions are preserved. It is dependent on the copy action implementation whether these permissions
will actually be applied.
null
if existing permissions should be preserved. Returns the Unix permissions to use for the target files. null
means that existing
permissions are preserved. It is dependent on the copy action implementation whether these permissions
will actually be applied.
null
if existing permissions should be preserved.Specifies the destination directory for a copy. The destination is evaluated as per Project.file.
destPath
- Path to the destination directory for a CopyRenames a source file to a different relative location under the target directory. The closure will be called with a single parameter, the name of the file. The closure should return a String object with a new target name. The closure may return null, in which case the original name will be used.
closure
- rename closureRenames files based on a regular expression. Uses java.util.regex type of regular expressions. Note that the replace string should use the '$1' syntax to refer to capture groups in the source regular expression. Files that do not match the source regular expression will be copied with the original name.
Example:
rename '(.*)_OEM_BLUE_(.*)', '$1$2'would map the file 'style_OEM_BLUE_.css' to 'style.css'
sourceRegEx
- Source regular expressionreplaceWith
- Replacement string (use \$ syntax for capture groups)Renames files based on a regular expression. See rename(String, String).
sourceRegEx
- Source regular expressionreplaceWith
- Replacement string (use \$ syntax for capture groups) Sets the Unix permissions to use for the target directories. null
means that existing
permissions are preserved. It is dependent on the copy action implementation whether these permissions
will actually be applied.
mode
- The directory permissions. Sets the Unix permissions to use for the target files. null
means that existing
permissions are preserved. It is dependent on the copy action implementation whether these permissions
will actually be applied.
mode
- The file permissions.