Login | Register
My pages Projects Community openCollabNet

On Friday, May 18, the normal maintenance window (17:00 Pacific time) will be extended for data center maintenance until 23:00 Pacific. No extended down-time is planned, but brief delays and interruptions are possible throughout the period.

Description

This document describes the types offered in svnAnt.

Supported svn types

svnFilesetsvnSetting

svnFileset

FileSet replacement that operates on list of files obtained from Subversion.

AttributeDescriptionRequired
dir

Specifies the root directory used by the file set. It should specify a directory managed by Subversion.

One of these
file

If used, specifies a fileset that contains a single file.

username

username that will be used for all nested svn commands.
Deprecated. This attribute won't work with SVNANT 1.3.2+ . Use refid for svnSetting instead.

password

password that will be used for all nested svn commands.
Deprecated. This attribute won't work with SVNANT 1.3.2+ . Use refid for svnSetting instead.

javahl

Set to "false" to use command line client interface instead of JNI JavaHL binding.
Deprecated. This attribute won't work with SVNANT 1.3.2+ . Use refid for svnSetting instead.


Default: true
svnkit

Set to "false" to use command line client interface instead of SVNKit binding.
Deprecated. This attribute won't work with SVNANT 1.3.2+ . Use refid for svnSetting instead.


Default: false
failonerror

Controls whether an error stops the build or is merely reported to the screen.
Deprecated. This attribute won't work with SVNANT 1.3.2+ . Use refid for svnSetting instead.


Default: true
refid

If set the configuration for this task is taken from a svnSetting object. Such a settings instance simply provides default values, so they will be overridden in case the corresponding attribute on this task has been set.

includes

Comma-seperated or space-separated list of patterns, which describe files that are included. If this attribute if not specified, then all files are included.

No
excludes

Comma-seperated or space-separated list of patterns, which describe files that are excluded. If this attribute if not specified, then no files are excluded.

No
Nested elements
ElementDescription
exclude

The type svnFileSet can include the nested type 'exclude', similar to a classic FileSet.

include

The type svnFileSet can include the nested type 'include', similar to a classic FileSet.

patternSet

The type svnFileSet can include the nested type 'patternSet', similar to a classic FileSet.

selector

The type svnFileSet can include the any file selector, such as contains, date size, or any file selector defined by svn-ant

This type implements a FileSet. Instances of FileSet are used in tasks that operates on a number of files. The files selected by a FileSet can be tailored by a number of patterns and selectors. More information about file sets is available with the Ant documentation.

The motivation with creating a replacement FileSet that is based on Subversion was to have the ability of creating sets of files that include deleted and missing files. In fact, the classic fileset operates only on files that are reported by the file system and can not predict deleted and missing files. Furthermore, there are useful commands that can be performed on deleted and missing files, such as 'revert', 'delete', 'update' and others.

At the present time, svnFileSet is experimental. It supports selectors but it does not yet accept any patterns (include, exclude). Those enhancements are to come later.

svnFileSet can be used within any svn-ant task that supports a nested file sets. It can also be used in any task that is based on a file set. If you have a problem using svnFileSet within a task that works well with the classic fileset, then report the problem to the author of the task. However, for the time being, there is a work around your problem. Instead of using a svnFileSet directly in the targeted task, use it indirectly via a classic fileset and a reference. For example, if ANT complains about a task similar to the following:

    <target name="example">
        <mkdir dir="test"/>
        <copy todir="test">
            <svnFileSet dir="workingcopy">
                <svnAdded/>
            </svnFileSet>
        </copy>
    </target>
  

you can rewrite it, using a reference, as:

    <target name="example">
        <svnFileSet id="svnFileSetId_1" dir="workingcopy">
            <svnAdded/>
        </svnFileSet>
        <mkdir dir="test"/>
        <copy todir="test">
            <fileset refid="svnFileSetId_1"/>
        </copy>
    </target>
  

If you are the author of a fileset-based task and that you can not understand why your task does not accept svnFileSet while it works perfectly well with the classic fileset, here is a thing you can check. If your task accepts instances of FileSet with a method similar to:

    public void addFileset(FileSet set) {
        ...
    }
  

then adding the following method should fix the problem:

    public void add(FileSet set) {
        addFileSet(set);
    }
  

Examples:

The following ant script can be used to remove all missing files from the associated repository:

    <svn>
        <delete>
            <svnFileSet dir="workingcopy">
                <svnMissing/>
            </svnFileSet>
        </delete>
        <commit 
            dir="workingcopy" 
            message="automatically removing missing files"
        />
    </svn>
  

The following ant script can be used to add all new files to the associated repository:

    <svn>
        <add>
            <svnFileSet dir="workingcopy">
                <svnUnversioned/>
            </svnFileSet>
        </add>
        <commit
            dir="workingcopy" 
            message="automatically adding files"
        />
    </svn>
  

The following ant script can be used to restore all deleted files:

    <svn>
        <revert>
            <svnFileSet dir="workingcopy">
                <svnDeleted/>
            </svnFileSet>
        </revert>
    </svn>
  

If, in the previous example, you wanted svn-ant to use the command line adapter:

    <svn javahl="false" svnkit="false">
        <revert>
            <svnFileSet 
                dir="workingcopy" 
                javahl="false" 
                svnkit="false"
            >
                <svnDeleted javahl="false" svnkit="false"/>
            </svnFileSet>
        </revert>
    </svn>
  

svnSetting

Allows to configure the access to the subversion repository within a <svnSetting> elements.

AttributeDescriptionRequired
dateFormatter

formatter definition used to format/parse dates (e.g. when revision is specified as date).


Default: MM/DD/YYYY HH:MM AM_PM
No
dateTimeZone

time zone used to format/parse dates (e.g. when revision is specified as date).


Default: local
No
id

The Id which is used to refer to these settings.

Yes
username

username that will be used for all nested svn commands.

No
password

password that will be used for all nested svn commands.

No
javahl

Set to "false" to use command line client interface instead of JNI JavaHL binding.


Default: true
No
svnkit

Set to "false" to use command line client interface instead of SVNKit binding.


Default: false
No
failonerror

Controls whether an error stops the build or is merely reported to the screen.


Default: true
No
sshkeypath

Specifies the location of a SSH private key.
UNTESTED FEATURE: NOT SUPPORTED BY THE COMMANDLINE CLIENT ! SUBJECT TO CHANGE !

No
sshpassphrase

Specifies the passphrase for the SSH private key.
UNTESTED FEATURE: NOT SUPPORTED BY THE COMMANDLINE CLIENT ! SUBJECT TO CHANGE !

No
sshport

The port to be used when connecting using SSH. If the connection URL contains a port number this will be used instead.
UNTESTED FEATURE: NOT SUPPORTED BY THE COMMANDLINE CLIENT ! SUBJECT TO CHANGE !


Default: 22
No
sslclientcertpath

The path of a SSL client certificate.
UNTESTED FEATURE: NOT SUPPORTED BY THE COMMANDLINE CLIENT ! SUBJECT TO CHANGE !

No
sslpassword

The password for the SSL connection.
UNTESTED FEATURE: NOT SUPPORTED BY THE COMMANDLINE CLIENT ! SUBJECT TO CHANGE !

No
certreject

Boolean which allows to reject untrusted certificates in general. By default they are accepted temporarily (we don't want to break with previous implementations).
UNTESTED FEATURE: NOT SUPPORTED BY THE COMMANDLINE CLIENT ! SUBJECT TO CHANGE !


Default: false
No