我期待擴展一些構建後任務,以包括檢出和檢入DLL。我們正在使用TFS,並且我知道有一些命令行工具可以執行此操作。我不知道如何做的是將這些集成到我現有的構建任務中。現在我的發佈任務很簡單,並通過項目屬性在Visual Studio中進行管理。最終,我想將我的自定義構建任務分解爲外部文件並調用它們,但這是另一個問題的主題;)Visual Studio構建任務 - TFS操作
2
A
回答
0
您可以使用Team Foundation Server client API。 TeamFoundationServer是應該允許您連接到服務器,列出和操作TFS項目的基類。
0
Msbuildtasks有一些帶有源代碼(它的開源)的msbuild擴展。您可以使用它來創建自己的簽入/簽出功能。 (在什麼達林建議組合)
4
沒有求助於自定義生成的任務,你可以嘗試使用Team Foundation Source Control Command-Line tool(tf.exe)。
下面的示例顯示瞭如何使用tf.exe從TFS檢出文件。
<PropertyGroup>
<TfCommand>
"C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\tf.exe"
</TfCommand>
</PropertyGroup>
<Target Name="AfterCompile">
<Exec Command="$(TfCommand) get /force /noprompt "$(SolutionRoot)\sources\example.cs""
ContinueOnError="true" />
<Exec Command="$(TfCommand) checkout "$(SolutionRoot)\sources\example.cs""
ContinueOnError="true"/>
</Target>
將其包含在您自己的MSBuild項目文件中。
這個例子沒有做任何有用的事情,你需要改變它以符合你的環境,但也許它給你一個開始。
我從tfsbuild.com得到了這個例子。
0
查看CodePlex上的SDC Tasks Library。這是一組定製的MSBuild任務,包括簽入和簽出任務(請參閱隨附文檔中的Microsoft.Sdc.Tasks.SourceTfs命名空間)。您可以將這些任務合併到項目文件中的「AfterBuild」目標中。
<SourceTfs.Checkout Path="Path" TfsVersion="tfsVersion"
WorkingDirectory="workingDirectory"/>
<SourceTfs.Checkin Path="Path" Comments="Comments" TfsVersion="tfsVersion"
WorkingDirectory="workingDirectory" Override="overrideText"/>
您可以根據需要將TfsVersion設置爲「2005」或「2008」。
0
我們的團隊有幾個小項目輸出其他幾個項目使用的DLL。我們發佈的一部分是發佈這些DLL。我爲此使用了AfterDropBuild目標。希望我的構建腳本代碼段中的註釋足以清楚地表明我正在做什麼。
<!-- Get a reference to the new release address finalizer DLL and the existing published address finalizer DLL -->
<PropertyGroup>
<ReleaseDLL>$(DropLocation)\$(BuildNumber)\Release\Address_Finalizer.dll</ReleaseDLL>
<PublishedFolder>$(SolutionRoot)\3rd Party\bin\PG File Import</PublishedFolder>
<PublishedDLL>$(PublishedFolder)\Address_Finalizer.dll</PublishedDLL>
</PropertyGroup>
<!-- Check out the published DLL -->
<Exec WorkingDirectory="$(SolutionRoot)" Command='$(TfCommand) checkout /lock:checkout "$(PublishedDLL)"'/>
<!-- Copy release to published -->
<Copy SourceFiles="$(ReleaseDLL)" DestinationFolder="$(PublishedFolder)"/>
<!-- Check in the published DLL -->
<Exec WorkingDirectory="$(SolutionRoot)" Command='$(TfCommand) checkin /override:Automated /noprompt /comment:"$(VersionComment)" "$(PublishedDLL)"'/>
相關問題
- 1. 在visual studio和tfs構建觸發器構建任務
- 2. TFS 2015 visual studio構建任務不支持VS 2017
- 3. TFS 2017 - 構建服務器不構建Visual Studio 2017
- 4. TFS 2015 Visual Studio構建項目變量
- 5. Visual Studio 2010 TFS構建錯誤
- 6. 構建從Visual Studio失敗TFS 2013 2010
- 7. TFS VNext構建和實體框架遷移 - Visual Studio團隊服務(Visual Studio Online)
- 8. 如何使用Visual Studio 2017與TFS Visual Studio構建步驟
- 9. 是否需要在TFS構建服務器上安裝Visual Studio?
- 10. 從構建在Visual Studio團隊服務
- 11. TFS構建2015 - 使用Visual Studio 2015構建過程
- 12. TFS 2015構建任務 - 手動干預
- 13. TFS 2015構建任務 - NuGet Packager
- 14. Visual Studio 2010 RC:構建解決方案不再執行任何操作
- 15. 如何讓其他xgsubmitted任務與Visual Studio構建任務共享cpus?
- 16. 的Visual Studio - 構建
- 17. Visual Studio 2012 TFS
- 18. TFS Visual Studio 2k13
- 19. Visual Studio團隊服務構建問題
- 20. 如何顯示Visual Studio Online構建任務Write-Verbose語句?
- 21. 幾個「構建任務」爲Visual Studio代碼(蟒蛇)
- 22. Visual Studio C#項目中的自定義構建操作屬性
- 23. Visual Studio 2008 Professional缺少構建操作屬性
- 24. visual studio團隊服務構建問題
- 25. 無法創建TFS任務
- 26. 從MSBuild任務傳遞值到TFS構建工作流程
- 27. 什麼是TFS 2012等效TFS 2008執行任務的構建?
- 28. Visual Studio 2010的工作流設計器顯示的構建任務無國界
- 29. 連接到Visual Studio Online構建/測試任務中的外部服務
- 30. Visual Studio任務列表
尼斯......你可能要添加的命令行工具,你在道路,所以如果你移動到x64構建中,您不必更新編譯文件。 –