Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/GitVersionTask/build/GitVersionTask.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@

<!-- Property that enables GenerateGitVersionInformation -->
<GenerateGitVersionInformation Condition=" '$(DisableGitVersionTask)' == 'true' ">false</GenerateGitVersionInformation>
<!--
During XAML's "GenerateTemporaryTargetAssembly" a new project file is generated and compiled
which already contains the "GeneratedCodeFiles", i.e. GitVersionInformation.g.cs.
Then, when GenerateGitVersionInformation is called in this temp-build, the file is added another time, which results in an error at CSC.
Here we try to detect this situation and prevent GenerateGitVersionInformation from running.
(The global property "_TargetAssemblyProjectName" is injected by XAML's above-mentioned task)
-->
<GenerateGitVersionInformation Condition=" '$(GenerateGitVersionInformation)' == '' And '$(_TargetAssemblyProjectName)' != '' ">false</GenerateGitVersionInformation>
<GenerateGitVersionInformation Condition=" '$(GenerateGitVersionInformation)' == '' ">true</GenerateGitVersionInformation>

<!-- Property that enables GetVersion -->
Expand Down