Skip to content

Commit

Permalink
Merge pull request dotnet#22232 from nguerrera/fix-doc-xml-build-race
Browse files Browse the repository at this point in the history
Fix build parallelism issue with documentation file generation
  • Loading branch information
nguerrera committed Sep 25, 2017
2 parents c1e62d1 + fddce6c commit 49f9176
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions build/Targets/Imports.targets
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,16 @@

<!--
DocumentationFile needs to be set before importing common targets.
C# common targets (unlike VB) prefix DocumentationFile path with IntermediateOutputPath.
C# common targets (unlike VB) prefix DocumentationFile path with IntermediateOutputPath. However, using that here does not work with multi-targeting as
the IntermediateOutputPath will not yet have the TargetFramework appended, which will lead to a race where parallel builds for different TargetFrameworks
attempt to write the doc xml to the same xml location. Instead, we can simply set GenerateDocumentationFile=true and let the SDK pick the correct path.
Ideally, we'd just use the same construct for VB here, but that is currently blocked by https://github.com/dotnet/sdk/issues/1598.
-->
<PropertyGroup Condition="'$(DocumentationFile)' == '' AND '$(NoDocumentationFile)' != 'true' AND '$(AssemblyName)' != ''">
<PropertyGroup Condition="'$(GenerateDocumentationFile)' == '' AND '$(DocumentationFile)' == '' AND '$(NoDocumentationFile)' != 'true' AND '$(AssemblyName)' != ''">
<DocumentationFile Condition="'$(ProjectLanguage)' == 'VB'">$(AssemblyName).xml</DocumentationFile>
<DocumentationFile Condition="'$(ProjectLanguage)' == 'CSharp'">$(IntermediateOutputPath)\$(AssemblyName).xml</DocumentationFile>
<GenerateDocumentationFile Condition="'$(ProjectLanguage)' == 'CSharp'">true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup>
Expand Down

0 comments on commit 49f9176

Please sign in to comment.