Get XML Documentation Files from Team Team Build script

I have a dependency replication scheme setup in our TFS environment based on http://geekswithblogs.net/jakob/archive/2009/03/05/implementing-dependency-replication-with-tfs-team-build.aspx .

Here we use the CompilationOutputs group of elements to get embedded DLL files and to branch / merge them into dependent projects. My problem is that the CompilationOutputs element group contains only DLLs, and I would also like to include XML documentation files, so I can get intellisense documentation tips when using these libraries. Is there another group of elements that contains these or another approach? Do I need to manually find the xml files and add them to the group of elements?

We are now at TFS 2010, so if there is something new there, we can try to take advantage of this (although it would be nice if I did not have to convert this whole scheme to use the Workflow process ...)

0
tfs msbuild team-build xml-documentation
source share
1 answer

In accordance with the article, you copy and check the outputs:

 <Copy SourceFiles="@(CompilationOutputs)" DestinationFolder="$(ReplicateSourceFolder)"/> <Exec Command="$(TF) checkin /comment:&quot;Checking in file from build&quot; &quot;$(ReplicateSourceFolder)&quot; /recursive"/> 

Could you add a second copy of the line before validation to copy the xml files using metadata?

 <Copy SourceFiles="%(CompilationOutputs.RootDir)%(CompilationOutputs.Directory)\%(CompilationOutputs.Filename).xml" DestinationFolder="$(ReplicateSourceFolder)"/> 

Here is another option that uses a built-in task that creates another group of elements that changes the extension, so that it only adds doc files that actually exist:

  <Target Name="Test"> <ChangeExtension InputFiles="@(CompilationOutputs)" Extension=".xml"> <Output TaskParameter="OutputFiles" ItemName="DocFiles" /> </ChangeExtension> <Copy SourceFiles="@(CompilationOutputs)" DestinationFolder="$(ReplicateSourceFolder)"/> <Copy SourceFiles="@(DocFiles)" DestinationFolder="$(ReplicateSourceFolder)"/> </Target> <UsingTask TaskName="ChangeExtension" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> <ParameterGroup> <InputFiles ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true"/> <Extension ParameterType="System.String" Required="true"/> <OutputFiles ParameterType="Microsoft.Build.Framework.ITaskItem[]" Output="true"/> </ParameterGroup> <Task> <Code Type="Fragment" Language="cs"> <![CDATA[ if (InputFiles.Length > 0) { List<TaskItem> results = new List<TaskItem>(); for (int i = 0; i < InputFiles.Length; i++) { ITaskItem item = InputFiles[i]; string path = item.GetMetadata("FullPath"); string docfile = Path.ChangeExtension(path, Extension); if (File.Exists(docfile)) { results.Add(new TaskItem(docfile)); } } OutputFiles = results.ToArray(); } ]]> </Code> </Task> </UsingTask> 
+1
source share

All Articles