Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix csproj duplicates and warnings #3056

Merged
merged 15 commits into from
Dec 13, 2024
12 changes: 5 additions & 7 deletions src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@
private int MySlowMethod1()
{
Thread.Sleep(1000);
return (new Random()).Next();
return new Random().Next();
}

class TestClass
private class TestClass
{
public TestClass() {}

public string SlowMethod2()
{
Thread.Sleep(1000);
return (new Random()).Next().ToString();
return new Random().Next().ToString();
}

public string SlowMethod3()
{
Thread.Sleep(1000);
return (new Random()).Next().ToString();
return new Random().Next().ToString();
}
}

private int MySlowMethod4(int argument)
{
Thread.Sleep(1000);
return (new Random()).Next() + (argument - argument);
return new Random().Next() + (argument - argument);
}

[Fact]
Expand All @@ -37,15 +37,15 @@
// The same static method should be cached, and therefore the return value should be the same
var task1 = TaskRecycler<int>.RunOrAttachAsync(MySlowMethod1);
var task2 = TaskRecycler<int>.RunOrAttachAsync(MySlowMethod1);
int result1 = task1.GetAwaiter().GetResult();

Check warning on line 40 in src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)

Check warning on line 40 in src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)
int result2 = task2.GetAwaiter().GetResult();

Check warning on line 41 in src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)

Check warning on line 41 in src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)
Assert.Equal(result1, result2);

// The same static method should be cached, and therefore the return value should be the same, but different from previous runs
var task3 = TaskRecycler<int>.RunOrAttachAsync(MySlowMethod1);
var task4 = TaskRecycler<int>.RunOrAttachAsync(MySlowMethod1);
int result4 = task4.GetAwaiter().GetResult();

Check warning on line 47 in src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)

Check warning on line 47 in src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)
int result3 = task3.GetAwaiter().GetResult();

Check warning on line 48 in src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)

Check warning on line 48 in src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)
Assert.Equal(result3, result4);

// Ensure the last call was not permanently cached
Expand All @@ -58,16 +58,16 @@
// The same static method should be cached, and therefore the return value should be the same
var task1 = TaskRecycler<int>.RunOrAttachAsync(MySlowMethod1, 2);
var task2 = TaskRecycler<int>.RunOrAttachAsync(MySlowMethod1, 2);
int result1 = task1.GetAwaiter().GetResult();

Check warning on line 61 in src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)

Check warning on line 61 in src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)
int result2 = task2.GetAwaiter().GetResult();

Check warning on line 62 in src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)

Check warning on line 62 in src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)
Assert.Equal(result1, result2);

// The same static method should be cached, and therefore the return value should be the same,
// and equal to previous runs due to 3 seconds cache
var task3 = TaskRecycler<int>.RunOrAttachAsync(MySlowMethod1, 2);
var task4 = TaskRecycler<int>.RunOrAttachAsync(MySlowMethod1, 2);
int result4 = task4.GetAwaiter().GetResult();

Check warning on line 69 in src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)

Check warning on line 69 in src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)
int result3 = task3.GetAwaiter().GetResult();

Check warning on line 70 in src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)

Check warning on line 70 in src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)
Assert.Equal(result3, result4);
Assert.Equal(result1, result3);

Expand All @@ -77,8 +77,8 @@
// The same static method should be cached, but cached runs should have been removed. This results should differ from previous ones
var task5 = TaskRecycler<int>.RunOrAttachAsync(MySlowMethod1, 2);
var task6 = TaskRecycler<int>.RunOrAttachAsync(MySlowMethod1, 2);
int result5 = task6.GetAwaiter().GetResult();

Check warning on line 80 in src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)
int result6 = task5.GetAwaiter().GetResult();

Check warning on line 81 in src/UniGetUI.Core.Classes.Tests/TaskRecyclerTests.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)
Assert.Equal(result5, result6);
Assert.NotEqual(result4, result5);

Expand Down Expand Up @@ -131,7 +131,6 @@
string result2 = task2.GetAwaiter().GetResult();
Assert.Equal(result1, result2);


var class1_copy = class1;

// The SAME method from the SAME instance, even when called
Expand All @@ -153,7 +152,6 @@
// Ensure the last call was not permanently cached
Assert.NotEqual(result1, result3);


// The SAME method from two DIFFERENT instances should NOT be
// cached, so the results should differ
var task7 = TaskRecycler<string>.RunOrAttachAsync(class1.SlowMethod3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier>
<Platforms>x64</Platforms>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<SdkVersion>8.0.401</SdkVersion>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<PublishSelfContained>true</PublishSelfContained>
<Authors>Martí Climent and the contributors</Authors>
<PublisherName>Martí Climent</PublisherName>
<Nullable>enable</Nullable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Configurations>Debug;Release</Configurations>
</PropertyGroup>
Expand Down
18 changes: 3 additions & 15 deletions src/UniGetUI.Core.Classes/TaskRecycler.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System.Collections.Concurrent;
using System.Diagnostics;
using UniGetUI.Core.Logging;
using WinRT.Interop;

namespace UniGetUI.Core.Classes;

Expand All @@ -21,12 +18,10 @@ namespace UniGetUI.Core.Classes;
*/
public static class TaskRecycler<ReturnT>
{
private static ConcurrentDictionary<int, Task<ReturnT>> _tasks = new();

private static readonly ConcurrentDictionary<int, Task<ReturnT>> _tasks = new();

// ---------------------------------------------------------------------------------------------------------------


/// Asynchronous entry point for 0 parameters
public static Task<ReturnT> RunOrAttachAsync(Func<ReturnT> method, int cacheTimeSecs = 0)
{
Expand Down Expand Up @@ -57,10 +52,8 @@ public static Task<ReturnT> RunOrAttachAsync<Param1T, Param2T, Param3T>(Func<Par
return _runTaskAndWait(new Task<ReturnT>(() => method(arg1, arg2, arg3)), hash, cacheTimeSecs);
}


// ---------------------------------------------------------------------------------------------------------------


/// Synchronous entry point for 0 parameters
public static ReturnT RunOrAttach(Func<ReturnT> method, int cacheTimeSecs = 0)
=> RunOrAttachAsync(method, cacheTimeSecs).GetAwaiter().GetResult();
Expand All @@ -79,10 +72,8 @@ public static ReturnT RunOrAttach<Param1T, Param2T, Param3T>(Func<Param1T, Param
Param2T arg2, Param3T arg3, int cacheTimeSecs = 0)
=> RunOrAttachAsync(method, arg1, arg2, arg3, cacheTimeSecs).GetAwaiter().GetResult();


// ---------------------------------------------------------------------------------------------------------------


/// <summary>
/// Instantly removes a function call from the cache, even if the associated task has not
/// finished yet. Any previous call will finish as expected. New calls won't attach to any
Expand All @@ -93,10 +84,8 @@ public static ReturnT RunOrAttach<Param1T, Param2T, Param3T>(Func<Param1T, Param
public static void RemoveFromCache(Func<ReturnT> method)
=> _removeFromCache(method.GetHashCode(), 0);


// ---------------------------------------------------------------------------------------------------------------


/// <summary>
/// Handles running the task if no such task was found on cache, and returning the cached task if it was found.
/// </summary>
Expand Down Expand Up @@ -134,15 +123,14 @@ private static async Task<ReturnT> _runTaskAndWait(Task<ReturnT> task, int hash,
/// </summary>
private static async void _removeFromCache(int hash, int cacheTimeSecsSecs)
{
if(cacheTimeSecsSecs > 0)
if (cacheTimeSecsSecs > 0)
await Task.Delay(cacheTimeSecsSecs * 1000);

_tasks.Remove(hash, out _);
}
}


public static class TaskRecyclerTelemetry
{
public static int DeduplicatedCalls = 0;
public static int DeduplicatedCalls;
}
8 changes: 2 additions & 6 deletions src/UniGetUI.Core.Classes/UniGetUI.Core.Classes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier>
<Platforms>x64</Platforms>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<SdkVersion>8.0.401</SdkVersion>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<PublishSelfContained>true</PublishSelfContained>
Expand All @@ -18,10 +18,6 @@
<Configurations>Debug;Release</Configurations>
</PropertyGroup>

<PropertyGroup>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\SharedAssemblyInfo.cs" Link="SharedAssemblyInfo.cs" />
</ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions src/UniGetUI.Core.Data.Tests/UniGetUI.Core.Data.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier>
<Platforms>x64</Platforms>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<SdkVersion>8.0.401</SdkVersion>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<PublishSelfContained>true</PublishSelfContained>
<Authors>Martí Climent and the contributors</Authors>
<PublisherName>Martí Climent</PublisherName>
<Nullable>enable</Nullable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Configurations>Debug;Release</Configurations>
</PropertyGroup>
Expand Down
3 changes: 1 addition & 2 deletions src/UniGetUI.Core.Data/CoreData.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Diagnostics;
using System.Diagnostics;
using System.Net;
using System.Text.Json;
using System.Text.Json.Serialization.Metadata;
Expand Down Expand Up @@ -160,7 +160,6 @@ public static string UniGetUI_DefaultBackupDirectory
/// </summary>
public const int NewShortcutsNotificationTag = 1236;


/// <summary>
/// A path pointing to the location where the app is installed
/// </summary>
Expand Down
8 changes: 2 additions & 6 deletions src/UniGetUI.Core.Data/UniGetUI.Core.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier>
<Platforms>x64</Platforms>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<SdkVersion>8.0.401</SdkVersion>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<PublishSelfContained>true</PublishSelfContained>
Expand All @@ -18,10 +18,6 @@
<Configurations>Debug;Release</Configurations>
</PropertyGroup>

<PropertyGroup>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\UniGetUI.Core.Logger\UniGetUI.Core.Logging.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier>
<Platforms>x64</Platforms>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<SdkVersion>8.0.401</SdkVersion>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<PublishSelfContained>true</PublishSelfContained>
<Authors>Martí Climent and the contributors</Authors>
<PublisherName>Martí Climent</PublisherName>
<Nullable>enable</Nullable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Configurations>Debug;Release</Configurations>
</PropertyGroup>
Expand Down
7 changes: 0 additions & 7 deletions src/UniGetUI.Core.IconStore/IconCacheEngine.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
using System.Collections.ObjectModel;
using System.Security.Cryptography;
using Windows.ApplicationModel;
using Windows.Graphics.Imaging;
using Windows.UI;
using PhotoSauce.MagicScaler;
using UniGetUI.Core.Classes;
using UniGetUI.Core.Data;
using UniGetUI.Core.Logging;
using UniGetUI.Core.Tools;

namespace UniGetUI.Core.IconEngine
{
Expand Down Expand Up @@ -230,7 +226,6 @@ cachedIconFile is not null &&
return null;
}


/// <summary>
/// The given image will be downsized to the expected size of an icon, if required
/// </summary>
Expand Down Expand Up @@ -278,10 +273,8 @@ private static void DownsizeImage(string cachedIconFile, string extension)
Logger.Error($"An error occurred while downsizing the image file {cachedIconFile}");
Logger.Error(ex);
}

}


/// <summary>
/// Checks whether a cached image is valid or not depending on the size (in bytes) of the image
/// </summary>
Expand Down
8 changes: 2 additions & 6 deletions src/UniGetUI.Core.IconStore/UniGetUI.Core.IconEngine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier>
<Platforms>x64</Platforms>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<SdkVersion>8.0.401</SdkVersion>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<PublishSelfContained>true</PublishSelfContained>
Expand All @@ -18,10 +18,6 @@
<Configurations>Debug;Release</Configurations>
</PropertyGroup>

<PropertyGroup>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\UniGetUI.Core.Data\UniGetUI.Core.Data.csproj" />
<ProjectReference Include="..\UniGetUI.Core.Logger\UniGetUI.Core.Logging.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier>
<Platforms>x64</Platforms>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<SdkVersion>8.0.401</SdkVersion>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<PublishSelfContained>true</PublishSelfContained>
<Authors>Martí Climent and the contributors</Authors>
<PublisherName>Martí Climent</PublisherName>
<Nullable>enable</Nullable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Configurations>Debug;Release</Configurations>
</PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion src/UniGetUI.Core.LanguageEngine/LanguageEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public Dictionary<string, string> LoadLanguageFile(string LangKey)

Dictionary<string, string> LangDict = BundledContents.ToDictionary(x => x.Key, x => x.Value?.ToString() ?? "");


string CachedLangFileToLoad = Path.Join(CoreData.UniGetUICacheDirectory_Lang, "lang_" + LangKey + ".json");

if (Settings.Get("DisableLangAutoUpdater"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier>
<Platforms>x64</Platforms>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<SdkVersion>8.0.401</SdkVersion>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<PublishSelfContained>true</PublishSelfContained>
Expand All @@ -18,10 +18,6 @@
<Configurations>Debug;Release</Configurations>
</PropertyGroup>

<PropertyGroup>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MessageFormat" Version="7.1.2" />
</ItemGroup>
Expand Down
8 changes: 2 additions & 6 deletions src/UniGetUI.Core.Logger/UniGetUI.Core.Logging.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier>
<Platforms>x64</Platforms>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<SdkVersion>8.0.401</SdkVersion>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<PublishSelfContained>true</PublishSelfContained>
Expand All @@ -18,10 +18,6 @@
<Configurations>Debug;Release</Configurations>
</PropertyGroup>

<PropertyGroup>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\SharedAssemblyInfo.cs" Link="SharedAssemblyInfo.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier>
<Platforms>x64</Platforms>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<SdkVersion>8.0.401</SdkVersion>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<PublishSelfContained>true</PublishSelfContained>
<Authors>Martí Climent and the contributors</Authors>
<PublisherName>Martí Climent</PublisherName>
<Nullable>enable</Nullable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Configurations>Debug;Release</Configurations>
</PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion src/UniGetUI.Core.Settings.Tests/SettingsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
Assert.Equal("this is now a test case", Settings.GetListItem<string>(SettingName, 3));
Assert.Null(Settings.GetListItem<string>(SettingName, 4));

Assert.Equal(Settings.GetListItem<string>(SettingName, 0), JsonSerializer.Deserialize<List<string>>(File.ReadAllText(Path.Join(CoreData.UniGetUIDataDirectory, $"{SettingName}.json")))[0]);

Check warning on line 117 in src/UniGetUI.Core.Settings.Tests/SettingsTest.cs

View workflow job for this annotation

GitHub Actions / test-codebase

Dereference of a possibly null reference.

Settings.ClearList(SettingName);
Assert.Empty(Settings.GetList<object>(SettingName) ?? ["this shouldn't be null; something's wrong"]);
Expand Down Expand Up @@ -149,7 +149,6 @@
public void TestDictionarySettings(string SettingName, string[] keyArray, int[] intArray, string[] strArray)
{
Dictionary<string, SerializableTest?> test = [];
Dictionary<string, string> emptyDictionary = [];
Dictionary<string, SerializableTest?> nonEmptyDictionary = [];
nonEmptyDictionary["this should not be null; something's wrong"] = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier>
<Platforms>x64</Platforms>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.26100.53</WindowsSdkPackageVersion>
<SdkVersion>8.0.401</SdkVersion>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<PublishSelfContained>true</PublishSelfContained>
<Authors>Martí Climent and the contributors</Authors>
<PublisherName>Martí Climent</PublisherName>
<Nullable>enable</Nullable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Configurations>Debug;Release</Configurations>
</PropertyGroup>
Expand Down
Loading