Skip to content

Commit

Permalink
Update from .NET Framework 4.5 to 4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Nov 13, 2023
1 parent 41317ed commit ce2262a
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 28 deletions.
4 changes: 2 additions & 2 deletions AutoUpdate/CKAN-autoupdate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>7</LangVersion>
<ApplicationIcon>..\assets\ckan.ico</ApplicationIcon>
<TargetFramework>net45</TargetFramework>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFramework>net48</TargetFramework>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down
6 changes: 3 additions & 3 deletions Cmdline/CKAN-cmdline.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
<Deterministic>true</Deterministic>
<Configurations>Debug;Release</Configurations>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>7</LangVersion>
<TargetFramework>net45</TargetFramework>
<LangVersion>7.3</LangVersion>
<TargetFramework>net48</TargetFramework>
<StartupObject>CKAN.CmdLine.MainClass</StartupObject>
<ApplicationIcon>..\assets\ckan.ico</ApplicationIcon>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down
6 changes: 3 additions & 3 deletions ConsoleUI/CKAN-ConsoleUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
<Deterministic>true</Deterministic>
<Configurations>Debug;Release</Configurations>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>7</LangVersion>
<TargetFramework>net45</TargetFramework>
<LangVersion>7.3</LangVersion>
<TargetFramework>net48</TargetFramework>
<ApplicationIcon>..\assets\ckan.ico</ApplicationIcon>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down
6 changes: 3 additions & 3 deletions Core/CKAN-core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Deterministic>true</Deterministic>
<Configurations>Debug;Release;Debug_NetCore;Release_NetCore</Configurations>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>7</LangVersion>
<LangVersion>7.3</LangVersion>
<NoWarn>IDE1006</NoWarn>
</PropertyGroup>
<Choose>
Expand All @@ -25,7 +25,7 @@
</When>
<Otherwise>
<PropertyGroup>
<TargetFramework>net45</TargetFramework>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
</Otherwise>
</Choose>
Expand All @@ -44,7 +44,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NJsonSchema" Version="10.9.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
<PackageReference Include="ChinhDo.Transactions.FileManager" Version="1.2.0" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
Expand Down
12 changes: 8 additions & 4 deletions Core/Extensions/EnumerableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public static TimeSpan Sum(this IEnumerable<TimeSpan> source)
public static IEnumerable<V> ZipMany<T, U, V>(this IEnumerable<T> seq1, IEnumerable<U> seq2, Func<T, U, IEnumerable<V>> func)
=> seq1.Zip(seq2, func).SelectMany(seqs => seqs);

#if NET45
#if NETFRAMEWORK

/// <summary>
/// Eliminate duplicate elements based on the value returned by a callback
Expand All @@ -144,7 +144,7 @@ public static IEnumerable<T> TraverseNodes<T>(this T start, Func<T, T> getNext)
}
}

#if NET45
#if NETFRAMEWORK

/// <summary>
/// Make pairs out of the elements of two sequences
Expand All @@ -155,6 +155,10 @@ public static IEnumerable<T> TraverseNodes<T>(this T start, Func<T, T> getNext)
public static IEnumerable<Tuple<T1, T2>> Zip<T1, T2>(this IEnumerable<T1> seq1, IEnumerable<T2> seq2)
=> seq1.Zip(seq2, (item1, item2) => new Tuple<T1, T2>(item1, item2));

#endif

#if NET45

/// <summary>
/// Enable a `foreach` over a sequence of tuples
/// </summary>
Expand Down Expand Up @@ -201,6 +205,8 @@ public static void Deconstruct<T1, T2, T3, T4>(this Tuple<T1, T2, T3, T4> tuple,
item4 = tuple.Item4;
}

#endif

/// <summary>
/// Enable a `foreach` over a sequence of key value pairs
/// </summary>
Expand All @@ -213,8 +219,6 @@ public static void Deconstruct<T1, T2>(this KeyValuePair<T1, T2> kvp, out T1 key
val = kvp.Value;
}

#endif

}

/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions GUI/CKAN-GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
<Deterministic>true</Deterministic>
<Configurations>Debug;Release</Configurations>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>7</LangVersion>
<TargetFramework>net45</TargetFramework>
<LangVersion>7.3</LangVersion>
<TargetFramework>net48</TargetFramework>
<ApplicationIcon>..\assets\ckan.ico</ApplicationIcon>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down
5 changes: 3 additions & 2 deletions GUI/Controls/ManageMods.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Netkan/CKAN-netkan.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
<Deterministic>true</Deterministic>
<Configurations>Debug;Release</Configurations>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>7</LangVersion>
<TargetFramework>net45</TargetFramework>
<LangVersion>7.3</LangVersion>
<TargetFramework>net48</TargetFramework>
<StartupObject>CKAN.NetKAN.Program</StartupObject>
<ApplicationIcon>..\assets\ckan.ico</ApplicationIcon>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down
8 changes: 4 additions & 4 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Deterministic>true</Deterministic>
<Configurations>Debug;Release;Debug_NetCore;Release_NetCore</Configurations>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>7</LangVersion>
<LangVersion>7.3</LangVersion>
<NoWarn>IDE1006</NoWarn>
</PropertyGroup>
<Choose>
Expand All @@ -26,7 +26,7 @@
</When>
<Otherwise>
<PropertyGroup>
<TargetFramework>net45</TargetFramework>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
</Otherwise>
</Choose>
Expand All @@ -51,7 +51,7 @@
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -73,7 +73,7 @@
<ProjectReference Include="..\Core\CKAN-core.csproj" />
</ItemGroup>
<Choose>
<When Condition=" '$(TargetFramework)' == 'net45' ">
<When Condition=" '$(TargetFramework)' == 'net48' ">
<ItemGroup>
<ProjectReference Include="..\Cmdline\CKAN-cmdline.csproj" />
<ProjectReference Include="..\ConsoleUI\CKAN-ConsoleUI.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using System.Text.RegularExpressions;
using Semver;

var buildNetCore = "net7.0";
var buildNetFramework = "net45";
var buildNetFramework = "net48";

var target = Argument<string>("target", "Default");
var configuration = Argument<string>("configuration", "Debug");
Expand Down

0 comments on commit ce2262a

Please sign in to comment.