我們已將TFS 2008設置爲檢出項目中的所有AssemblyInfo.cs文件,使用AssemblyInfoTask更新它們,然後根據以下內容撤消簽出或簽入構建是否通過。不幸的是,當兩個構建排隊在一起時,這會導致部分完成的構建,因爲AssemblyInfo.cs文件似乎在先前版本中檢出到前一次檢入。AssemblyInfo.cs文件的自動更新和檢入偶爾會導致部分失敗
爲了解決這個問題,我認爲我可以使用「獲取」任務來強制AssemblyInfo.cs文件更新它們之前的最新版本,但這似乎沒有效果。有任何想法嗎?
<Target Name="AfterGet" Condition="'$(IsDesktopBuild)'!='true'">
<Message Text="SolutionRoot = $(SolutionRoot)" />
<Message Text="OutDir = $(OutDir)" />
<!-- Set the AssemblyInfoFiles items dynamically -->
<CreateItem Include="$(SolutionRoot)\Main\Source\InputApplicationSln\**\$(AssemblyInfoSpec)">
<Output ItemName="AssemblyInfoFiles" TaskParameter="Include" />
</CreateItem>
<Message Text="$(AssemblyInfoFiles)" />
<!-- When builds are queued up successively, it is possible for the next build to be set up before the AssemblyInfoSpec is checked in so we need to force
the latest these versions of these files to be got before a checkout -->
<Get Condition=" '$(SkipGet)'!='true' " TeamFoundationServerUrl="$(TeamFoundationServerUrl)" Workspace="$(WorkspaceName)" Filespec="$(AssemblyInfoSpec)" Recursive="$(RecursiveGet)" Force="$(ForceGet)" />
<Exec WorkingDirectory="$(SolutionRoot)\Main\Source\InputApplicationSln"
Command="$(TF) checkout /recursive $(AssemblyInfoSpec)"/>
你說得對,我們簽出,修改,然後,一旦構建成功,再次登入。這是爲了確保修改後的AssemblyInfo.cs與修改後的版本號相匹配,並幫助我們重建以前的版本。我假設第二個get命令不是要走的路? – 2008-10-07 09:11:19