Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ on:

jobs:
build:
# In Ubuntu, there are problems with disk space and resources in general
runs-on: windows-latest
runs-on: ubuntu-latest

steps:
- name: Checkout
Expand Down
8 changes: 4 additions & 4 deletions registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@
},
"CsvHelper": {
"listed": true,
"version": "3.0.0"
"version": "32.0.0"
},
"Dapplo.Log": {
"listed": true,
Expand Down Expand Up @@ -552,7 +552,7 @@
},
"Google.Apis.Sheets.v4": {
"listed": true,
"version": "1.35.1.1303"
"version": "1.70.0.3819"
},
"Google.Cloud.Firestore": {
"listed": true,
Expand Down Expand Up @@ -1234,7 +1234,7 @@
},
"MongoDB.Libmongocrypt": {
"listed": true,
"version": "1.2.0"
"version": "1.12.0"
},
"Mono.Cecil": {
"listed": true,
Expand Down Expand Up @@ -1815,7 +1815,7 @@
},
"System.IO.Abstractions": {
"listed": true,
"version": "2.1.0.201"
"version": "22.0.9"
},
"System.IO.FileSystem.AccessControl": {
"listed": true,
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageVersion Include="nunit" Version="4.4.0" />
<PackageVersion Include="NUnit.Analyzers" Version="4.10.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="5.1.0" />
<PackageVersion Include="Scriban" Version="6.3.0" />
<PackageVersion Include="Scriban" Version="6.4.0" />
<PackageVersion Include="SharpZipLib" Version="1.4.2" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
Expand Down
12 changes: 6 additions & 6 deletions src/UnityNuGet.Server/RegistryCacheUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
Filter = _registryOptions.Filter,
// Update progress
OnProgress = (current, total) =>
OnProgress = (_, e) =>
{
_currentRegistryCache.ProgressTotalPackageCount = total;
_currentRegistryCache.ProgressPackageIndex = current;
_currentRegistryCache.ProgressTotalPackageCount = e.Total;
_currentRegistryCache.ProgressPackageIndex = e.Current;
},
OnInformation = _registryCacheReport.AddInformation,
OnWarning = _registryCacheReport.AddWarning,
OnError = _registryCacheReport.AddError
OnInformation = (_, e) => _registryCacheReport.AddInformation(e.Message),
OnWarning = (_, e) => _registryCacheReport.AddWarning(e.Message),
OnError = (_, e) => _registryCacheReport.AddError(e.Message)
};

await newRegistryCache.Build(stoppingToken);
Expand Down
2 changes: 1 addition & 1 deletion src/UnityNuGet.Tests/NativeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public async Task TestBuild()
new NuGetConsoleTestLogger())
{
Filter = "rhino3dm",
OnError = message =>
OnError = (_, _) =>
{
errorsTriggered = true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/UnityNuGet.Tests/NuGetHelperTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void GetCompatiblePackageDependencyGroups_SpecificSingleFramework()

IEnumerable<PackageDependencyGroup> compatibleDependencyGroups = NuGetHelper.GetCompatiblePackageDependencyGroups(packageDependencyGroups, targetFrameworks);

Assert.That(compatibleDependencyGroups, Is.EqualTo(new PackageDependencyGroup[] { packageDependencyGroups[2] }).AsCollection);
Assert.That(compatibleDependencyGroups, Is.EqualTo([packageDependencyGroups[2]]).AsCollection);
}

[Test]
Expand All @@ -41,7 +41,7 @@ public void GetCompatiblePackageDependencyGroups_SpecificMultipleFrameworks()

IEnumerable<PackageDependencyGroup> compatibleDependencyGroups = NuGetHelper.GetCompatiblePackageDependencyGroups(packageDependencyGroups, targetFrameworks);

Assert.That(compatibleDependencyGroups, Is.EqualTo(new PackageDependencyGroup[] { packageDependencyGroups[2], packageDependencyGroups[3] }).AsCollection);
Assert.That(compatibleDependencyGroups, Is.EqualTo([packageDependencyGroups[2], packageDependencyGroups[3]]).AsCollection);
}

[Test]
Expand Down
16 changes: 8 additions & 8 deletions src/UnityNuGet.Tests/PlatformDefinitionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ public void CanFindDefinitions()
// Look-up explicit configuration
PlatformDefinition? win64 = platformDefs.Find(UnityOs.Windows, UnityCpu.X64);

Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(win64, Is.Not.Null);
Assert.That(win.Os, Is.EqualTo(win64!.Os));
});
Assert.Multiple(() =>
}
using (Assert.EnterMultipleScope())
{
Assert.That(win64?.Cpu, Is.EqualTo(UnityCpu.X64));
Assert.That(win.Children, Does.Contain(win64));
});
}

// Look-up invalid configuration
PlatformDefinition? and = platformDefs.Find(UnityOs.Android, UnityCpu.None);
Expand All @@ -48,11 +48,11 @@ public void RemainingPlatforms_NoneVisited()
HashSet<PlatformDefinition> remaining = platformDefs.GetRemainingPlatforms(visited);

Assert.That(remaining, Is.Not.Null);
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(remaining, Has.Count.EqualTo(1));
Assert.That(platformDefs, Is.EqualTo(remaining.First()));
});
}
}

[Test]
Expand All @@ -70,11 +70,11 @@ public void RemainingPlatforms_OneVisited()

foreach (PlatformDefinition r in remaining)
{
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(child, Is.Not.EqualTo(r));
Assert.That(platformDefs.Children, Does.Contain(r));
});
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/UnityNuGet.Tests/RegistryCacheTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public async Task TestBuild()
],
new NuGetConsoleTestLogger())
{
OnError = message =>
OnError = (_, _) =>
{
errorsTriggered = true;
}
Expand Down
12 changes: 10 additions & 2 deletions src/UnityNuGet.Tests/RegistryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ public async Task Make_Sure_That_The_Registry_Is_Case_Insensitive(string package

await registry.StartAsync(CancellationToken.None);

Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(registry.TryGetValue(packageName, out RegistryEntry? result), Is.True);
Assert.That(result, Is.Not.Null);
});
}
}

[Test]
Expand Down Expand Up @@ -168,6 +168,8 @@ static async Task<TestCaseData[]> AllRegistries()
@"ClosedXML",
// It has too many versions, the minimum version is lifted so as not to process so many versions
@"CSharpFunctionalExtensions",
// It has too many versions, the minimum version is lifted so as not to process so many versions
@"CsvHelper",
// Version < 1.0.26 depends on Microsoft.Windows.Compatibility, this one has tons of dependencies that don't target .netstandard2.0. And one of them is System.Speech that doesn't work in Unity.
@"Dapplo.Windows.Common",
@"Dapplo.Windows.Input",
Expand All @@ -177,13 +179,17 @@ static async Task<TestCaseData[]> AllRegistries()
@"Elasticsearch.Net",
// It has too many versions, the minimum version is lifted so as not to process so many versions
@"Google.Apis.AndroidPublisher.v3",
// It has too many versions, the minimum version is lifted so as not to process so many versions
@"Google.Apis.Sheets.v4",
// Version 3.1.8 has dependency on `Panic.StringUtils` which doesn't support .netstandard2.0 or 2.1. Rest of versions are fine.
@"GraphQL.Client.Serializer.Newtonsoft",
// Version 3.1.8 has dependency on `Panic.StringUtils` which doesn't support .netstandard2.0 or 2.1. Rest of versions are fine.
@"GraphQL.Client.Serializer.SystemTextJson",
// Although 2.x targets .netstandard2.0 it has an abandoned dependency (Remotion.Linq) that does not target .netstandard2.0.
// 3.1.0 is set because 3.0.x only targets .netstandard2.1.
@"Microsoft.EntityFrameworkCore.*",
// It takes up a lot of space, the minimum version is lifted so as not to process so many versions
@"MongoDB.Libmongocrypt",
// Monomod Versions < 18.11.9.9 depend on System.Runtime.Loader which doesn't ship .netstandard2.0.
@"MonoMod.Utils",
@"MonoMod.RuntimeDetour",
Expand All @@ -195,6 +201,8 @@ static async Task<TestCaseData[]> AllRegistries()
@"SQLitePCLRaw.lib.e_sqlite3",
// Versions < 1.4.1 has dependencies on Microsoft.AspNetCore.*.
@"StrongInject.Extensions.DependencyInjection",
// It has too many versions, the minimum version is lifted so as not to process so many versions
@"System.IO.Abstractions",
// Versions < 4.6.0 in theory supports .netstandard2.0 but it doesn't have a lib folder with assemblies and it makes it fail.
@"System.Private.ServiceModel",
// Versions < 0.8.6 depend on LiteGuard, a deprecated dependency.
Expand Down
12 changes: 6 additions & 6 deletions src/UnityNuGet.Tests/UnityMetaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,22 +109,22 @@ public void GetMetaForDll_NonEditor(UnityOs os, string platformName, string osNa
MatchCollection excludeMatches = excludeRegex.Matches(output);
Assert.That(excludeMatches, Is.Not.Null);
Assert.That(excludeMatches, Has.Count.EqualTo(1));
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(excludeMatches.Single().Groups, Has.Count.EqualTo(2));
Assert.That(osName, Is.EqualTo(excludeMatches.Single().Groups[1].Value));
});
}

// There should be a single 'enabled: 1' match
Regex enableRegex = new("enabled: 1");
MatchCollection enableMatches = enableRegex.Matches(output);
Assert.That(enableMatches, Is.Not.Null);
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(enableMatches, Has.Count.EqualTo(1));

Assert.That(output, Does.Contain($"- first:\n {platformName}: {osName}\n second:\n enabled: 1\n"));
});
}
}

[TestCase(UnityOs.Windows, new[] { "Win", "Win64" })]
Expand Down Expand Up @@ -155,11 +155,11 @@ public void GetMetaForDll_Editor(UnityOs os, string[] osNames)
Regex enableRegex = new ("enabled: 1");
MatchCollection enableMatches = enableRegex.Matches(output);

Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(enableMatches, Is.Not.Null);
Assert.That(excludeMatches, Has.Count.EqualTo(enableMatches.Count));
});
}

foreach (string? osName in actualExcludes)
{
Expand Down
8 changes: 4 additions & 4 deletions src/UnityNuGet.Tool/RegistryCacheUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
Filter = _registryOptions.Filter,
// Update progress
OnProgress = (current, total) =>
OnProgress = (_, e) =>
{
_currentRegistryCache.ProgressTotalPackageCount = total;
_currentRegistryCache.ProgressPackageIndex = current;
_currentRegistryCache.ProgressTotalPackageCount = e.Total;
_currentRegistryCache.ProgressPackageIndex = e.Current;
},
OnError = message => errorCount++
OnError = (_, _) => errorCount++
};

await newRegistryCache.Build(stoppingToken);
Expand Down
Loading