Skip to content

Commit

Permalink
Compile .net 8 based on environment variable (#2122)
Browse files Browse the repository at this point in the history
  • Loading branch information
westin-m authored and brentschmaltz committed Sep 7, 2023
1 parent b2ccb7e commit 7f818c2
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 10 deletions.
5 changes: 3 additions & 2 deletions build/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@
<NoWarn>$(NoWarn);SYSLIB0050</NoWarn>
<NoWarn>$(NoWarn);SYSLIB0051</NoWarn>
</PropertyGroup>

<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'net8.0'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubVersion)" PrivateAssets="All"/>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion build/dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<AspNetCoreMinSupportedVersion>2.1.1</AspNetCoreMinSupportedVersion>
<MicrosoftAzureKeyVaultVersion>3.0.5</MicrosoftAzureKeyVaultVersion>
<MicrosoftAzureServicesAppAuthenticationVersion>1.0.3</MicrosoftAzureServicesAppAuthenticationVersion>
<MicrosoftSourceLinkGitHubVersion>1.0.0</MicrosoftSourceLinkGitHubVersion>
<NetStandardVersion>2.0.3</NetStandardVersion>
<SystemCollectionsSpecializedVersion>4.3.0</SystemCollectionsSpecializedVersion>
<SystemComponentModelTypeConverterVersion>4.3.0</SystemComponentModelTypeConverterVersion>
Expand All @@ -28,5 +27,6 @@
<PropertyGroup Condition="'$(TargetFramework)' != 'net8.0'">
<SystemSecurityCryptographyCngVersion>4.5.0</SystemSecurityCryptographyCngVersion>
<MicrosoftCSharpVersion>4.5.0</MicrosoftCSharpVersion>
<MicrosoftSourceLinkGitHubVersion>1.0.0</MicrosoftSourceLinkGitHubVersion>
</PropertyGroup>
</Project>
3 changes: 2 additions & 1 deletion build/targets.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project>
<PropertyGroup>
<SrcTargets>net461;net462;net472;netstandard2.0;net6.0;net8.0</SrcTargets>
<SrcTargets Condition="'$(TargetNet8)' == 'True'">net461;net462;net472;netstandard2.0;net6.0;net8.0</SrcTargets>
<SrcTargets Condition="'$(TargetNet8)' != 'True'">net461;net462;net472;netstandard2.0;net6.0</SrcTargets>
<SrcStandardTargets>netstandard2.0</SrcStandardTargets>
</PropertyGroup>
</Project>
3 changes: 2 additions & 1 deletion build/targetsTest.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project>
<PropertyGroup>
<TestTargets>net461;net462;net472;netcoreapp2.1;net6.0;net8.0</TestTargets>
<TestTargets Condition="'$(TargetNet8)' == 'True'">net461;net462;net472;netcoreapp2.1;net6.0;net8.0</TestTargets>
<TestTargets Condition="'$(TargetNet8)' != 'True'">net461;net462;net472;netcoreapp2.1;net6.0</TestTargets>
<TestOnlyCoreTargets>netcoreapp2.1</TestOnlyCoreTargets>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<LangVersion>latest</LangVersion>
<PackageId>Microsoft.IdentityModel.KeyVaultExtensions</PackageId>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(TargetNet8)' == 'True'">netstandard2.0;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(TargetNet8)' != 'True'">netstandard2.0;net6.0</TargetFrameworks>
<PackageTags>.NET;Windows;Authentication;Identity;Azure;Key;Vault;Extensions</PackageTags>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework Condition="'$(TargetNet8)' == 'True'">net8.0</TargetFramework>
<TargetFramework Condition="'$(TargetNet8)' != 'True'">net6.0</TargetFramework>
<OutputType>Exe</OutputType>
<PublishTrimmed>true</PublishTrimmed>
<TrimMode>full</TrimMode>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

<PropertyGroup>
<!-- This test only needs to run on .NET -->
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFramework Condition="'$(TargetNet8)' == 'True'">net8.0</TargetFramework>
<TargetFramework Condition="'$(TargetNet8)' != 'True'">net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<ProjectReference Include="..\..\src\System.IdentityModel.Tokens.Jwt\System.IdentityModel.Tokens.Jwt.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="System.Net.Http"/>
<ItemGroup Condition="'$(TargetFramework)' == 'net461' Or '$(TargetFramework)' == 'net462' Or '$(TargetFramework)' == 'net472'">
<Reference Include="System.Net.Http"/>
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 7f818c2

Please sign in to comment.