Msbuild and SVN update

懵懂的女人 提交于 2020-01-29 14:28:23

问题


I want to write a simple task which will update and commit source code that was Nightly build to SVN. I was on the msbuildtasks.tigris.org page, and downloaded the dll's but I have no idea how to write it. Could you please provide some basic samples?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/1645253/msbuild-and-svn-update

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