interface CopyProcessingSpec : ContentFilterable
Specifies the destination of a copy.
abstract fun eachFile(action: Action<in FileCopyDetails>): CopyProcessingSpec
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. abstract fun eachFile(closure: Closure<Any>): CopyProcessingSpec
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 org.gradle.api.file.FileCopyDetails as its parameter. Actions are executed in the order added, and are inherited from the parent spec. |
|
abstract fun getDirMode(): Int
Returns the Unix permissions to use for the target directories. |
|
abstract fun getFileMode(): Int
Returns the Unix permissions to use for the target files. |
|
abstract fun into(destPath: Any): CopyProcessingSpec
Specifies the destination directory for a copy. The destination is evaluated as per |
|
abstract fun rename(closure: Closure<Any>): CopyProcessingSpec
Renames a source file. 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. abstract fun rename(renamer: Transformer<String, String>): CopyProcessingSpec
Renames a source file. The function will be called with a single parameter, the name of the file. The function should return a new target name. The function may return null, in which case the original name will be used. abstract fun rename(sourceRegEx: String, replaceWith: String): CopyProcessingSpec
Renames 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: would map the file 'style_OEM_BLUE_.css' to 'style.css'
abstract fun rename(sourceRegEx: Pattern, replaceWith: String): CopyProcessingSpec
Renames files based on a regular expression. See |
|
abstract fun setDirMode(mode: Int): CopyProcessingSpec
Sets the Unix permissions to use for the target directories. |
|
abstract fun setFileMode(mode: Int): CopyProcessingSpec
Sets the Unix permissions to use for the target files. |
abstract fun expand(properties: MutableMap<String, *>): ContentFilterable
Expands property references in each file as it is copied. More specifically, each file is transformed using Groovy's groovy.text.SimpleTemplateEngine. This means you can use simple property references, such as |
|
abstract fun filter(properties: MutableMap<String, *>, filterType: Class<out FilterReader>): ContentFilterable
Adds a content filter to be used during the copy. Multiple calls to filter, add additional filters to the filter chain. Each filter should implement Filter properties may be specified using groovy map syntax. Examples:
abstract fun filter(filterType: Class<out FilterReader>): ContentFilterable
Adds a content filter to be used during the copy. Multiple calls to filter, add additional filters to the filter chain. Each filter should implement Examples:
abstract fun filter(closure: Closure<Any>): ContentFilterable
Adds a content filter based on the provided closure. The Closure will be called with each line (stripped of line endings) and should return a String to replace the line or abstract fun filter(transformer: Transformer<String, String>): ContentFilterable
Adds a content filter based on the provided transformer. The Closure will be called with each line (stripped of line endings) and should return a String to replace the line or |
interface CopySpec : CopySourceSpec, CopyProcessingSpec, PatternFilterable
A set of specifications for copying files. This includes:
In this example, the into and exclude specifications at the root level are inherited by the two child CopySpecs. Copy specs can be reused in other copy specs via #with(CopySpec...) method. This enables reuse of the copy spec instances.
|