Msbuild and SVN update

放肆的年华 提交于 2019-12-01 06:12:44

Here is an example (taken from the MSBuild Community Tasks Build) that does exactly that:

<ItemGroup>
    <CommitFiles Include="www\index.html" />
    <CommitFiles Include="www\MSBuild.Community.Tasks.Nightly.zip" />
    <CommitFiles Include="www\MSBuild.Community.Tasks.Nightly.msi" />
 </ItemGroup>    

<SvnCommit Targets="@(CommitFiles)" Message="AutoBuild"
     Username="$(CommitUser)" Password="$(CommitPassword)">
    <Output TaskParameter="Revision" PropertyName="Revision" />
</SvnCommit>

Of course you need to import the MSBUild Community tasks for this to work:

<Import Project="MSBuild.Community.Tasks.Targets" />

This example is only committing a couple of files, but by setting the Targets property on the task it could easily be more.

We use nant and while there are svn specific tasks you have alot more control using an exec task.

If you install the svn client CLI onto your build server you will be able to use the exec task in MSBuild to run the svn update command. Here is a snippet from our Nant build script which I am sure you could easily adapt to an MSBuild script.

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!