我们将 TFS 2008 构建设置为签出项目中的所有 AssemblyInfo.cs 文件,使用 AssemblyInfoTask 更新它们,然后根据构建是否通过来撤消签出或签入。不幸的是,当两个构建紧密排列在一起时,这会导致构建部分完成,因为 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)"/>