Valid TaskActions are:

Version (Required: Item Output: Info Optional: UserName, UserPassword)

Info (Required: Item Output: Info Optional: UserName, UserPassword)

GetProperty (Required: Item, PropertyName Output: PropertyValue Optional: UserName, UserPassword)

SetProperty (Required: Item, PropertyName, PropertyValue Optional: UserName, UserPassword)

Checkout (Required: Items, Destination Optional: UserName, UserPassword)

Update (Required: Items Optional: UserName, UserPassword)

Add (Required: Items Optional: UserName, UserPassword)

Copy (Required: Items, Destination Optional: UserName, UserPassword)

Delete (Required: Items Optional: UserName, UserPassword)

Move (Required: Items, Destination Optional: UserName, UserPassword)

Commit (Required: Items Optional: UserName, UserPassword)

Export (Required: Item, Destination Optional: UserName, UserPassword)

Namespace: MSBuild.ExtensionPack.Subversion
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 3.5.0.0

Remarks

The task needs a command-line SVN client (svn.exe and svnversion.exe) to be available. The following are supported and automatically detected:

  • any SVN client in the PATH environment variable
  • Cygwin 1.7, with the subversion package installed
  • TortoiseSVN 1.7, with the command line component installed
  • CollabNet Subversion Client 1.7
  • Slik SVN 1.7, with the Subversion client component installed

If you publish a project that uses this task, remember to notify your users that they need one of the mentioned clients in order to build your code. The PATH detection allows everyone to set a preference, the other detections are there so that it will just work for most users.

The Version action calls svnversion.exe, all other actions call subcommands of svn.exe. Some parameters also accept URL's, not just local paths. Please refer to SVN's documentation for more information.

Examples

Xml Copy imageCopy
<Project ToolsVersion="3.5" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath>
        <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath>
    </PropertyGroup>
    <Import Project="$(TPath)"/>
    <Target Name="Default">
        <!-- Version -->
        <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Version" Item="c:\path">
            <Output TaskParameter="Info" ItemName="VInfo"/>
        </MSBuild.ExtensionPack.Subversion.Svn>
        <Message Text="MinRevision: %(VInfo.MinRevision), MaxRevision: %(VInfo.MaxRevision), IsMixed: %(VInfo.IsMixed), IsModified: %(VInfo.IsModified)"/>
        <Message Text="IsSwitched: %(VInfo.IsSwitched), IsPartial: %(VInfo.IsPartial), IsClean: %(VInfo.IsClean)"/>
        <!-- Info -->
        <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Info" Item="c:\path">
            <Output TaskParameter="Info" ItemName="IInfo"/>
        </MSBuild.ExtensionPack.Subversion.Svn>
        <Message Text="EntryKind: %(IInfo.EntryKind), EntryRevision: %(IInfo.EntryRevision), EntryURL: %(IInfo.EntryURL)"/>
        <Message Text="RepositoryRoot: %(IInfo.RepositoryRoot), RepositoryUUID: %(IInfo.RepositoryUUID)"/>
        <Message Text="WorkingCopySchedule: %(IInfo.WorkingCopySchedule), WorkingCopyDepth: %(IInfo.WorkingCopyDepth)"/>
        <Message Text="CommitAuthor: %(IInfo.CommitAuthor), CommitRevision: %(IInfo.CommitRevision), CommitDate: %(IInfo.CommitDate)"/>
        <!-- GetProperty -->
        <MSBuild.ExtensionPack.Subversion.Svn TaskAction="GetProperty" Item="c:\path" PropertyName="svn:externals">
            <Output TaskParameter="PropertyValue" PropertyName="GProp"/>
        </MSBuild.ExtensionPack.Subversion.Svn>
        <Message Text="PropertyValue: $(GProp)"/>
        <!-- SetProperty -->
        <MSBuild.ExtensionPack.Subversion.Svn TaskAction="SetProperty" Item="c:\path" PropertyName="test" PropertyValue="hello"/>
        <!-- Checkout -->
        <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Checkout" Items="http://repository/url" Destination="c:\path"/>
        <!-- Update -->
        <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Update" Items="c:\path1;c:\path2"/>
        <!-- Add -->
        <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Add" Items="c:\path\newfile"/>
        <!-- Copy -->
        <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Copy" Items="c:\path\file1;c:\path\file2" Destination="c:\path\directory"/>
        <!-- Delete -->
        <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Delete" Items="c:\path\something"/>
        <!-- Move -->
        <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Move" Items="c:\path\file1;c:\path\file2" Destination="c:\path\directory"/>
        <!-- Commit -->
        <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Commit" Items="c:\path\something"/>
        <!-- Export -->
        <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Export" Item="c:\path\workingcopy" Destination="c:\path\exported"/>
    </Target>
</Project>

Inheritance Hierarchy

System..::..Object
  Microsoft.Build.Utilities..::..Task
    MSBuild.ExtensionPack..::..BaseTask
      MSBuild.ExtensionPack.Subversion..::..Svn

See Also