interface CopySpec : CopySourceSpec, CopyProcessingSpec, PatternFilterable
A set of specifications for copying files. This includes:
def myCopySpec = project.copySpec { into('webroot') exclude('**/.data/**') from('src/main/webapp') { include '**/*.jsp' } from('src/main/js') { include '**/*.js' } }
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. def contentSpec = copySpec { from("content") { include "**/*.txt" } } task copy(type: Copy) { into "$buildDir/copy" with contentSpec }
See Also
org.gradle.api.tasks.Copyorg.gradle.api.Project#copy(groovy.lang.Closure)
abstract fun eachFile(action: Action<in FileCopyDetails>): CopySpec abstract fun eachFile(closure: Closure<Any>): CopySpec
{@inheritDoc} |
|
abstract fun exclude(vararg excludes: String): CopySpec abstract fun exclude(excludes: MutableIterable<String>): CopySpec abstract fun exclude(excludeSpec: Spec<FileTreeElement>): CopySpec abstract fun exclude(excludeSpec: Closure<Any>): CopySpec
{@inheritDoc} |
|
abstract fun expand(properties: MutableMap<String, *>): CopySpec
{@inheritDoc} |
|
abstract fun filesMatching(pattern: String, action: Action<in FileCopyDetails>): CopySpec
Configure the org.gradle.api.file.FileCopyDetails for each file whose path matches the specified Ant-style pattern. This is equivalent to using eachFile() and selectively applying a configuration based on the file's path. abstract fun filesMatching(patterns: MutableIterable<String>, action: Action<in FileCopyDetails>): CopySpec
Configure the org.gradle.api.file.FileCopyDetails for each file whose path matches any of the specified Ant-style patterns. This is equivalent to using eachFile() and selectively applying a configuration based on the file's path. |
|
abstract fun filesNotMatching(pattern: String, action: Action<in FileCopyDetails>): CopySpec
Configure the org.gradle.api.file.FileCopyDetails for each file whose path does not match the specified Ant-style pattern. This is equivalent to using eachFile() and selectively applying a configuration based on the file's path. abstract fun filesNotMatching(patterns: MutableIterable<String>, action: Action<in FileCopyDetails>): CopySpec
Configure the org.gradle.api.file.FileCopyDetails for each file whose path does not match any of the specified Ant-style patterns. This is equivalent to using eachFile() and selectively applying a configuration based on the file's path. |
|
abstract fun filter(properties: MutableMap<String, *>, filterType: Class<out FilterReader>): CopySpec abstract fun filter(filterType: Class<out FilterReader>): CopySpec abstract fun filter(closure: Closure<Any>): CopySpec abstract fun filter(transformer: Transformer<String, String>): CopySpec
{@inheritDoc} |
|
abstract fun from(vararg sourcePaths: Any): CopySpec abstract fun from(sourcePath: Any, c: Closure<Any>): CopySpec abstract fun from(sourcePath: Any, configureAction: Action<in CopySpec>): CopySpec
{@inheritDoc} |
|
abstract fun getDuplicatesStrategy(): DuplicatesStrategy
Returns the strategy to use when trying to copy more than one file to the same destination. The value can be set with a case insensitive string of the enum value (e.g. This strategy can be overridden for individual files by using |
|
abstract fun getFilteringCharset(): String
Gets the charset used to read and write files when filtering. By default, the JVM default charset is used. |
|
abstract fun getIncludeEmptyDirs(): Boolean
Tells if empty target directories will be included in the copy. |
|
abstract fun include(vararg includes: String): CopySpec abstract fun include(includes: MutableIterable<String>): CopySpec abstract fun include(includeSpec: Spec<FileTreeElement>): CopySpec abstract fun include(includeSpec: Closure<Any>): CopySpec
{@inheritDoc} |
|
abstract fun into(destPath: Any): CopySpec
{@inheritDoc} abstract fun into(destPath: Any, configureClosure: Closure<Any>): CopySpec abstract fun into(destPath: Any, copySpec: Action<in CopySpec>): CopySpec
Creates and configures a child |
|
abstract fun isCaseSensitive(): Boolean
Specifies whether case-sensitive pattern matching should be used. |
|
abstract fun rename(closure: Closure<Any>): CopySpec abstract fun rename(renamer: Transformer<String, String>): CopySpec abstract fun rename(sourceRegEx: String, replaceWith: String): CopySpec abstract fun rename(sourceRegEx: Pattern, replaceWith: String): CopyProcessingSpec
{@inheritDoc} |
|
abstract fun setCaseSensitive(caseSensitive: Boolean): Unit
Specifies whether case-sensitive pattern matching should be used for this CopySpec. |
|
abstract fun setDuplicatesStrategy(strategy: DuplicatesStrategy): Unit
The strategy to use when trying to copy more than one file to the same destination. Set to |
|
abstract fun setExcludes(excludes: MutableIterable<String>): CopySpec
{@inheritDoc} |
|
abstract fun setFilteringCharset(charset: String): Unit
Specifies the charset used to read and write files when filtering. |
|
abstract fun setIncludeEmptyDirs(includeEmptyDirs: Boolean): Unit
Controls if empty target directories should be included in the copy. |
|
abstract fun setIncludes(includes: MutableIterable<String>): CopySpec
{@inheritDoc} |
|
abstract fun with(vararg sourceSpecs: CopySpec): CopySpec
Adds the given specs as a child of this spec.
|
abstract fun getDirMode(): Int
Returns the Unix permissions to use for the target directories. |
|
abstract fun getExcludes(): MutableSet<String>
Returns the set of exclude patterns. |
|
abstract fun getFileMode(): Int
Returns the Unix permissions to use for the target files. |
|
abstract fun getIncludes(): MutableSet<String>
Returns the set of include patterns. |
|
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. |
fun <T : FilterReader> CopySpec.filter(vararg properties: Pair<String, Any?>): CopySpec fun <T : FilterReader> CopySpec.filter(properties: Map<String, Any?>): CopySpec |
abstract class AbstractCopyTask : ConventionTask, CopySpec, CopySpecSource
|