This project is read-only.

Introduction

This library extends NAnt with SVN client tasks. You can control your versioned files from within your NAnt-build file. All basic SVN actions are covered by this library. You can checkout, commit, tag and add keywords to your versioned files from within your build. Let’s say that you have a target to build a production version. Now you can tag your current version. Ths library also provides tasks to set and get your assembly version number based on your SVN revision.

Technical info

  • .NET Version: 4.0
  • This version only works on windows machines only. Mono versions will be available in Q2 2013.

Contents

What’s in the manual:

  • A brief installation manual. Links are provided to the NAnt
  • A task reference

What’s not in the manual:

  • This manual does not provide information of every used SVN command. For more information about SVN and the used SVN commands see the online Subversion book by Red Bean: http://svnbook.red-bean.com/

Installation

Prerequisites

  • Nant should be installed on your system
  • A SVN client should be installed on your machine. The SVN command should also be available from your command line. So the directory of the svn executable must be in your path variable. Do the test. Open a terminal window and type ‘svn’. If the result is Type ‘svn help’ for usage, then all is well.

The library is provided as a single DLL: NAnt.SVN.dll. You can use the library on purpose and load it using the loadtaskts tab in your project file. If you’re planning to use it everywhere, it can be more usefull to save the DLL in the extensions folder of your NAnt installation.

Using the loadtasks tag (FORCED SCAN)

Also called forced scanning. For more information, see the online NAnt manual.

Automatic discovery

You can save the DLL in your project in a tasks folder to enable automatic scanning or you can save it within your NAnt installation on your harddrive. For mor information, see the online NAnt manual.

Tasks reference

All the available svn-tasks are described in this section. For more information of the used svn client commands see: http://svnbook.red-bean.com/en/1.7/svn.ref.svn.html#svn.ref.svn.c.

autoignore

Task without attributes to ignore the bin and obj directories.

Tag:

<svnautoignore/>

checkout

Checkout a repository or URL.

Tag:

<svncheckout url=”repo-url” [revision=”specific-revision-number” user=”user-name” password=”password” nonrecursive=”bool” noauthcache=”bool” ]/>

Attribute

Description

Required

url

URL to the working copy

X

revision

Specific revision number to check out

 

user

Username to access the repository, if a user is provided, the password attribute is also required

 

password

Password to access the repository

 

noauthcache

Default false

 

Cleanup

Cleanup the current working directory.

Tag:

<svncleanup/>

Commit

Commit a working copy.

Tag:

<svncommit message=”your-message” [path=”specific-path” file=”specific-file” ]/>

Attribute

Description

Required

message

Commit message

X

path

Specific path to commit to.

 

file

Specific file to commit. If not specified, the current working directory is committed.

 

copy

Copy a repository to another url.

Tag:

<svncopy source=”source-url” destination=”destination-url” message=”copy-message”/>

Attribute

Description

Required

source

Source repository url

X

destination

Destination url

X

message

Message to log for this command

X

export

Export a working copy or repository.

Tag:

<svnexport todir=”dir-on-disk” [fromurl=”repository-url” force=”bool”]/>

Attribute

Description

Required

todir

Location to export to

X

fromurl

URL to a repository.

 

force

Force the export, default is false

 

Ignore

Set ignore properties to the working copy. Always recursive. You can optionally use a fileset element nested within the tag.

Tag:

<svnignore [ value=”ignore-pattern” file=”target-file-to-set-property” ]>

       <fileset></fileset>

</svnignore>

Attribute

Description

Required

value

SVN ignore patterns, spaced by a ‘ ‘

X

file

File to set the properties to.

 

Info

Get info from the working copy. This task stores the results in specific reusable parameters.

Tag:

<svninfo/>

Output:

Property name

Value

$revision

Current revision number of the current working directory

$remoterevision

Revision number on svn server of the currnet working directory

$repourl

Url of the repository of the current working directory

$reporooturl

The root url of the repository

$uuid

The id of the repository

$author

The author of the current working directory

Keywords

Set keywords to the the current working directory. You can optionally use a fileset element nested within the tag.

Tag:

<svnkeywords [value=””]>

       <fileset></fileset>

</svnkeywords>

Attribute

Description

Required

value

The svn keywords to set. Choose from Date, Revision, Author, HeadUrl or Id.

 

file

File to set the keyword to

 

Log

Get a log of the current working directory.

Tag:

<svnlog [limit=”integer” merginfo=”bool” verbose=”bool”] />

Attribute

Description

Required

limit

The number of lines, minimal 1, maximal 50.

 

mergeinfo

Merge the log info, default false.

 

verbose

Log verbose or not, default false

 

 

Output:

Property Name

Value

$logoutput

Xml output

Tag

Tag a working copy, based on the root repository url.

Tag:

<svntag source=”source-url” tagname=”specific tagname” />

Attribute

Description

Required

source

Repository url

 

tagname

Name of the target, the full url will automatically be found, if the SVN standard guidelines are followed.

 

verbose

Log verbose or not, default false

 

Update

Update the current working directory

Tag:

<svnupdate [accept=”mine-or-theirs” force=”bool” ] />

Attribute

Description

Required

accept

“mine” or “theirs”

 

force

Force an update, default is false

 

 

Last edited Dec 6, 2012 at 3:53 PM by GieSpaepen, version 3

Comments

ebeshah May 31, 2013 at 5:36 PM 
Where can I get NAnt.SVN.dll? I need to have svn export functionality from nant script.