Skip to content

Commit

Permalink
Define target framework constant always, not only for multi-targeting
Browse files Browse the repository at this point in the history
This is useful for scenarios where you switch from multi-targeting to single-targeting,
which would otherwise require code changes.
  • Loading branch information
kzu authored Mar 1, 2021
1 parent e977ded commit 872f3ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<PropertyGroup>
<!-- Define constant for TF like NET5, NET472, NETSTANDARD2, NETSTANDARD21 -->
<DefineConstants Condition="'$(TargetFramework)' != '' and '$(TargetFrameworks)' != ''">$(DefineConstants);$(TargetFramework.ToUpperInvariant().TrimEnd('0').TrimEnd('.').Replace('.', ''))</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' != ''">$(DefineConstants);$(TargetFramework.ToUpperInvariant().TrimEnd('0').TrimEnd('.').Replace('.', ''))</DefineConstants>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 872f3ab

Please sign in to comment.