HomeUser GuideDevelopmentDownloadLegal

Development: xsync

Description

Extended synchronize task.

Synchronizes files and/or directories and is (in a very limited way) aware of timestamps and revisioning keywords.

Parameters

This task supports the following parameters.

Attribute Description Required
source The source file or directory. Yes.
destination The destination file or directory. This has to be of the same type as the source parameter, i.e. files sync to files, directories to directories. Yes.
verbose Turns on verbose output mode. No; defaults to false.

Nested Elements

This task supports the following nested elements.

textmode

The textmode element specifies a single file pattern that is used to determine if a file is to be processed in textmode.

Attribute Description Required
source The source file or directory. Yes.
pattern The filename matching pattern.
Note: This is not a fileset pattern but rather a filename pattern that solely supports the wildcard '*'. Use e.g. '*.xml' to match all XML files.
Yes.

For files processed in textmode the line ending style is ignored and the file comparison is done line by line.

In addition files processed in textmode may contain magic strings that cause a complete line to be ignored. The following patterns are build-in:

CVS Keywords
$Author$, $Date$, $Header$, $Id$, $Log$, $Locker$, $Name$, $RCSfile$, $Revision$, $Source$, $State:$ (anywhere in a line)
Generated Keyword
Generated (only at the beginning of a line)
Timestamp Keyword
timestamp (anywhere in a line)

Files not explicitly enabled for textmode are processed in binary mode, which means that a CRC-32 is calculated over the two files to determine if the contents has changed.

ignore

The ignore element specifies a single file pattern that is used to determine if a file should be completely ignored.

Attribute Description Required
source The source file or directory. Yes.
pattern The filename matching pattern.
Note: This is not a fileset pattern but rather a filename pattern that solely supports the wildcard '*'. Use e.g. '*.class' to ignore all Java class files.
Yes.

Examples

The following syncs a single file in textmode:

<xsync source="foo/readme.txt" destination="bar/readme.txt">
  <textmode pattern="*.txt"/>
</xsync>

The following statement syncs two directories, processing all HTML, XML, text files and stylesheets in text mode and ignores all files (or folders) called CVS:

<xsync source="build/doc" destination="doc">
  <textmode pattern="*.html"/>
  <textmode pattern="*.xml"/>
  <textmode pattern="*.txt"/>
  <textmode pattern="*.css"/>
  <ignore pattern="CVS"/>
</xsync>