Skip to content

Commit

Permalink
build: replace netstandard2.0 TFM with net6.0
Browse files Browse the repository at this point in the history
Replace netstandard2.0 where possible with net6.0, or dual target net6.0
and net472 for projects that are included on Windows.
  • Loading branch information
mjcheetham committed Nov 7, 2022
1 parent 452981c commit 65cead2
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build/GCM.MSBuild.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>

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

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net6.0;net472</TargetFrameworks>
<RootNamespace>Atlassian.Bitbucket.UI</RootNamespace>
<AssemblyName>Atlassian.Bitbucket.UI.Shared</AssemblyName>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/shared/Atlassian.Bitbucket/Atlassian.Bitbucket.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">netstandard2.0;net472</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net6.0;net472</TargetFrameworks>
<AssemblyName>Atlassian.Bitbucket</AssemblyName>
<RootNamespace>Atlassian.Bitbucket</RootNamespace>
<IsTestProject>false</IsTestProject>
Expand Down
3 changes: 2 additions & 1 deletion src/shared/Core.UI/Core.UI.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net6.0;net472</TargetFrameworks>
<AssemblyName>gcmcoreui</AssemblyName>
<RootNamespace>GitCredentialManager.UI</RootNamespace>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/shared/Core/Core.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">netstandard2.0;net472</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net6.0;net472</TargetFrameworks>
<AssemblyName>gcmcore</AssemblyName>
<RootNamespace>GitCredentialManager</RootNamespace>
<IsTestProject>false</IsTestProject>
Expand Down
10 changes: 5 additions & 5 deletions src/shared/Core/PlatformUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static bool IsMacOS()
{
#if NETFRAMEWORK
return Environment.OSVersion.Platform == PlatformID.MacOSX;
#elif NETSTANDARD
#else
return RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
#endif
}
Expand All @@ -83,7 +83,7 @@ public static bool IsWindows()
{
#if NETFRAMEWORK
return Environment.OSVersion.Platform == PlatformID.Win32NT;
#elif NETSTANDARD
#else
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
#endif
}
Expand All @@ -96,7 +96,7 @@ public static bool IsLinux()
{
#if NETFRAMEWORK
return Environment.OSVersion.Platform == PlatformID.Unix;
#elif NETSTANDARD
#else
return RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
#endif
}
Expand Down Expand Up @@ -309,7 +309,7 @@ private static string GetCpuArchitecture()
{
#if NETFRAMEWORK
return Environment.Is64BitOperatingSystem ? "x86-64" : "x86";
#elif NETSTANDARD
#else
switch (RuntimeInformation.OSArchitecture)
{
case Architecture.Arm:
Expand All @@ -330,7 +330,7 @@ private static string GetClrVersion()
{
#if NETFRAMEWORK
return $".NET Framework {Environment.Version}";
#elif NETSTANDARD
#else
return RuntimeInformation.FrameworkDescription;
#endif
}
Expand Down
3 changes: 2 additions & 1 deletion src/shared/GitHub.UI/GitHub.UI.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net6.0;net472</TargetFrameworks>
<RootNamespace>GitHub.UI</RootNamespace>
<AssemblyName>GitHub.UI.Shared</AssemblyName>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/shared/GitHub/GitHub.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">netstandard2.0;net472</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net6.0;net472</TargetFrameworks>
<AssemblyName>GitHub</AssemblyName>
<RootNamespace>GitHub</RootNamespace>
<IsTestProject>false</IsTestProject>
Expand Down
3 changes: 2 additions & 1 deletion src/shared/GitLab.UI/GitLab.UI.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net6.0;net472</TargetFrameworks>
<RootNamespace>GitLab.UI</RootNamespace>
<AssemblyName>GitLab.UI.Shared</AssemblyName>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/shared/GitLab/GitLab.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">netstandard2.0;net472</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net6.0;net472</TargetFrameworks>
<AssemblyName>GitLab</AssemblyName>
<RootNamespace>GitLab</RootNamespace>
<IsTestProject>false</IsTestProject>
Expand Down
4 changes: 2 additions & 2 deletions src/shared/Microsoft.AzureRepos/Microsoft.AzureRepos.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">netstandard2.0;net472</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net6.0;net472</TargetFrameworks>
<AssemblyName>Microsoft.AzureRepos</AssemblyName>
<RootNamespace>Microsoft.AzureRepos</RootNamespace>
<IsTestProject>false</IsTestProject>
Expand Down
2 changes: 1 addition & 1 deletion src/shared/TestInfrastructure/TestInfrastructure.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>GitCredentialManager.Tests</RootNamespace>
<IsPackable>false</IsPackable>
<IsTestProject>false</IsTestProject>
Expand Down

1 comment on commit 65cead2

@Favourjacobmudiaga

This comment was marked as off-topic.

Please sign in to comment.