Skip to content

Commit

Permalink
Conditional target frameworks
Browse files Browse the repository at this point in the history
  • Loading branch information
pglombardo committed Jan 17, 2025
1 parent 96eaee2 commit ded20c3
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions Source/HiveMQtt/HiveMQtt.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Label="Build">
<TargetFrameworks>net6.0;net7.0;net8.0;</TargetFrameworks>
<TargetFrameworks Condition="'$(NETCoreSdkVersion)' >= '9.0.0'">net9.0</TargetFrameworks>
<!-- Include net6.0 only if the SDK supports it -->
<TargetFrameworks Condition="'$(NETCoreSdkVersion)' >= '6.0.0'">net6.0</TargetFrameworks>

<!-- Add net7.0 conditionally if the SDK supports it -->
<TargetFrameworks Condition="'$(NETCoreSdkVersion)' >= '7.0.0'">
$(TargetFrameworks);net7.0
</TargetFrameworks>

<!-- Add net8.0 conditionally if the SDK supports it -->
<TargetFrameworks Condition="'$(NETCoreSdkVersion)' >= '8.0.0'">
$(TargetFrameworks);net8.0
</TargetFrameworks>

<!-- Add net9.0 conditionally if the SDK supports it -->
<TargetFrameworks Condition="'$(NETCoreSdkVersion)' >= '9.0.0'">
$(TargetFrameworks);net9.0
</TargetFrameworks>

<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

Expand Down

0 comments on commit ded20c3

Please sign in to comment.