Implement Migration of PluginLoader configs (UI is temporary atm)
All checks were successful
Build / Compute Version (push) Successful in 5s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 1m24s
Build / Build Nuget package (NuGet) (push) Successful in 2m8s
Build / Build Nuget package (CringePlugins) (push) Successful in 3m21s
Build / Build Nuget package (SharedCringe) (push) Successful in 2m32s
Build / Build Launcher (push) Successful in 3m31s

Add profiles to Config
Error handling for package resolution
Remove debug code from wndproc hook
This commit is contained in:
2024-11-09 18:23:40 -05:00
parent 2e4c7f5e15
commit c25bf3bb3d
9 changed files with 126 additions and 16 deletions

View File

@@ -1,5 +1,6 @@
using System.Collections.Immutable;
using System.IO.Compression;
using NLog;
using NuGet;
using NuGet.Frameworks;
using NuGet.Models;
@@ -9,6 +10,7 @@ namespace CringePlugins.Resolver;
public class PackageResolver(NuGetFramework runtimeFramework, ImmutableArray<PackageReference> references, PackageSourceMapping packageSources)
{
private static readonly ILogger Log = LogManager.GetCurrentClassLogger();
public async Task<ImmutableHashSet<ResolvedPackage>> ResolveAsync()
{
var order = 0;
@@ -18,7 +20,17 @@ public class PackageResolver(NuGetFramework runtimeFramework, ImmutableArray<Pac
{
var client = await packageSources.GetClientAsync(reference.Id);
var registrationRoot = await client.GetPackageRegistrationRootAsync(reference.Id);
RegistrationRoot? registrationRoot;
try
{
registrationRoot = await client.GetPackageRegistrationRootAsync(reference.Id);
}
catch (HttpRequestException ex)
{
Log.Warn("Failed to resolve package {Package}: {Message}", reference.Id, ex.Message);
continue;
}
var items = registrationRoot.Items.SelectMany(page =>
page.Items!.Where(b => b.CatalogEntry.PackageTypes is ["CringePlugin"]))