我们已将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