Skip to content

Commit

Permalink
Allow forcing templated code gen for C#
Browse files Browse the repository at this point in the history
By setting UseTemplatedCode=true in the project, even for C#, you'd get the older behavior instead of the ThisAssembly-based one.
  • Loading branch information
kzu committed Mar 22, 2023
1 parent 451de40 commit a2e116a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/GitInfo/build/GitInfo.targets
Original file line number Diff line number Diff line change
Expand Up @@ -1077,9 +1077,9 @@
<Import Project="GitInfo.AssemblyMetadata.targets" Condition="'$(GitThisAssemblyMetadata)' == 'true'"/>

<!-- Legacy generation in place for non-C# or when the unsupported ThisAssemblyNamespace is in use -->
<Import Project="GitInfo.AssemblyInfo.targets" Condition="'$(Language)' != 'C#' or '$(ThisAssemblyNamespace)' != ''"/>
<Import Project="GitInfo.AssemblyInfo.targets" Condition="'$(Language)' != 'C#' or '$(ThisAssemblyNamespace)' != '' or '$(UseTemplatedCode)' == 'true'"/>
<!-- Otherwise, for C# we always use ThisAssembly instead. -->
<Import Project="GitInfo.ThisAssembly.targets" Condition="'$(Language)' == 'C#' and '$(ThisAssemblyNamespace)' == ''"/>
<Import Project="GitInfo.ThisAssembly.targets" Condition="'$(Language)' == 'C#' and '$(ThisAssemblyNamespace)' == '' and '$(UseTemplatedCode)' != 'true'"/>

<PropertyGroup>
<GitInfoImported>true</GitInfoImported>
Expand Down

0 comments on commit a2e116a

Please sign in to comment.