open class Sync : AbstractCopyTask
Synchronizes the contents of a destination directory with some source directories and files.
This task is like the Copy task, except the destination directory will only contain the files copied. All files that exist in the destination directory will be deleted before copying files, unless a #preserve(Action)
is specified.
Examples:
// Sync can be used like a Copy task // See the Copy documentation for more examples task syncDependencies(type: Sync) { from 'my/shared/dependencyDir' into 'build/deps/compile' } // You can preserve output that already exists in the // destination directory. Files matching the preserve // filter will not be deleted. task sync(type: Sync) { from 'source' into 'dest' preserve { include 'extraDir/**' include 'dir1/**' exclude 'dir1/extra.txt' } }
Sync()
Synchronizes the contents of a destination directory with some source directories and files. This task is like the Copy task, except the destination directory will only contain the files copied. All files that exist in the destination directory will be deleted before copying files, unless a Examples:
|
open fun getDestinationDir(): File
Returns the directory to copy files into. |
|
open fun getPreserve(): PatternFilterable
Returns the filter that defines which files to preserve in the destination directory. |
|
open fun getRootSpec(): DestinationRootCopySpec |
|
open fun preserve(action: Action<in PatternFilterable>): Sync
Configures the filter that defines which files to preserve in the destination directory. |
|
open fun setDestinationDir(destinationDir: File): Unit
Sets the directory to copy files into. This is the same as calling |
open fun eachFile(action: Action<in FileCopyDetails>): AbstractCopyTask open fun eachFile(closure: Closure<Any>): AbstractCopyTask
{@inheritDoc} |
|
open fun exclude(vararg excludes: String): AbstractCopyTask open fun exclude(excludes: MutableIterable<String>): AbstractCopyTask open fun exclude(excludeSpec: Spec<FileTreeElement>): AbstractCopyTask open fun exclude(excludeSpec: Closure<Any>): AbstractCopyTask
{@inheritDoc} |
|
open fun expand(properties: MutableMap<String, *>): AbstractCopyTask
{@inheritDoc} |
|
open fun filesMatching(pattern: String, action: Action<in FileCopyDetails>): AbstractCopyTask open fun filesMatching(patterns: MutableIterable<String>, action: Action<in FileCopyDetails>): AbstractCopyTask
{@inheritDoc} |
|
open fun filesNotMatching(pattern: String, action: Action<in FileCopyDetails>): AbstractCopyTask open fun filesNotMatching(patterns: MutableIterable<String>, action: Action<in FileCopyDetails>): AbstractCopyTask
{@inheritDoc} |
|
open fun filter(properties: MutableMap<String, *>, filterType: Class<out FilterReader>): AbstractCopyTask open fun filter(filterType: Class<out FilterReader>): AbstractCopyTask open fun filter(closure: Closure<Any>): AbstractCopyTask open fun filter(transformer: Transformer<String, String>): AbstractCopyTask
{@inheritDoc} |
|
open fun from(vararg sourcePaths: Any): AbstractCopyTask open fun from(sourcePath: Any, c: Closure<Any>): AbstractCopyTask open fun from(sourcePath: Any, configureAction: Action<in CopySpec>): AbstractCopyTask
{@inheritDoc} |
|
open fun getDirMode(): Int
{@inheritDoc} |
|
open fun getDuplicatesStrategy(): DuplicatesStrategy
{@inheritDoc} |
|
open fun getExcludes(): MutableSet<String>
{@inheritDoc} |
|
open fun getFileMode(): Int
{@inheritDoc} |
|
open fun getFilteringCharset(): String
{@inheritDoc} |
|
open fun getIncludeEmptyDirs(): Boolean
{@inheritDoc} |
|
open fun getIncludes(): MutableSet<String>
{@inheritDoc} |
|
open fun getSource(): FileCollection
Returns the source files for this task. |
|
open fun include(vararg includes: String): AbstractCopyTask open fun include(includes: MutableIterable<String>): AbstractCopyTask open fun include(includeSpec: Spec<FileTreeElement>): AbstractCopyTask open fun include(includeSpec: Closure<Any>): AbstractCopyTask
{@inheritDoc} |
|
open fun into(destDir: Any): AbstractCopyTask open fun into(destPath: Any, configureClosure: Closure<Any>): AbstractCopyTask open fun into(destPath: Any, copySpec: Action<in CopySpec>): CopySpec
{@inheritDoc} |
|
open fun isCaseSensitive(): Boolean
{@inheritDoc} |
|
open fun rename(closure: Closure<Any>): AbstractCopyTask open fun rename(renamer: Transformer<String, String>): AbstractCopyTask open fun rename(sourceRegEx: String, replaceWith: String): AbstractCopyTask open fun rename(sourceRegEx: Pattern, replaceWith: String): AbstractCopyTask
{@inheritDoc} |
|
open fun setCaseSensitive(caseSensitive: Boolean): Unit
{@inheritDoc} |
|
open fun setDirMode(mode: Int): AbstractCopyTask
{@inheritDoc} |
|
open fun setDuplicatesStrategy(strategy: DuplicatesStrategy): Unit
{@inheritDoc} |
|
open fun setExcludes(excludes: MutableIterable<String>): AbstractCopyTask
{@inheritDoc} |
|
open fun setFileMode(mode: Int): AbstractCopyTask
{@inheritDoc} |
|
open fun setFilteringCharset(charset: String): Unit
{@inheritDoc} |
|
open fun setIncludeEmptyDirs(includeEmptyDirs: Boolean): Unit
{@inheritDoc} |
|
open fun setIncludes(includes: MutableIterable<String>): AbstractCopyTask
{@inheritDoc} |
|
open fun with(vararg sourceSpecs: CopySpec): CopySpec
{@inheritDoc} |