1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 04:42:58 +08:00

Merge pull request #16223 from peppy/update-framework

Update framework
This commit is contained in:
Bartłomiej Dach 2021-12-23 11:16:13 +01:00 committed by GitHub
commit 38e054820f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 20 additions and 12 deletions

View File

@ -52,7 +52,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.1215.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2021.1221.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2021.1222.0" />
</ItemGroup>
<ItemGroup Label="Transitive Dependencies">
<!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. -->

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using NUnit.Framework;
using osu.Framework.Audio;
@ -184,7 +185,8 @@ namespace osu.Game.Tests.Gameplay
public byte[] Get(string name) => name == resourceName ? TestResources.GetStore().Get("Resources/Samples/test-sample.mp3") : null;
public Task<byte[]> GetAsync(string name) => name == resourceName ? TestResources.GetStore().GetAsync("Resources/Samples/test-sample.mp3") : null;
public Task<byte[]> GetAsync(string name, CancellationToken cancellationToken = default)
=> name == resourceName ? TestResources.GetStore().GetAsync("Resources/Samples/test-sample.mp3", cancellationToken) : null;
public Stream GetStream(string name) => name == resourceName ? TestResources.GetStore().GetStream("Resources/Samples/test-sample.mp3") : null;

View File

@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using NUnit.Framework;
using osu.Framework.Allocation;
@ -114,7 +115,7 @@ namespace osu.Game.Tests.Rulesets
public Sample Get(string name) => null;
public Task<Sample> GetAsync(string name) => null;
public Task<Sample> GetAsync(string name, CancellationToken cancellationToken = default) => null;
public Stream GetStream(string name) => null;

View File

@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using osu.Framework.IO.Stores;
@ -33,7 +34,7 @@ namespace osu.Game.IO.Archives
public virtual byte[] Get(string name) => GetAsync(name).Result;
public async Task<byte[]> GetAsync(string name)
public async Task<byte[]> GetAsync(string name, CancellationToken cancellationToken = default)
{
using (Stream input = GetStream(name))
{
@ -41,7 +42,7 @@ namespace osu.Game.IO.Archives
return null;
byte[] buffer = new byte[input.Length];
await input.ReadAsync(buffer).ConfigureAwait(false);
await input.ReadAsync(buffer, cancellationToken).ConfigureAwait(false);
return buffer;
}
}

View File

@ -7,6 +7,7 @@ using System.Globalization;
using System.IO;
using System.Linq;
using System.Resources;
using System.Threading;
using System.Threading.Tasks;
using osu.Framework.Localisation;
@ -75,7 +76,7 @@ namespace osu.Game.Localisation
}
}
public Task<string> GetAsync(string lookup)
public Task<string> GetAsync(string lookup, CancellationToken cancellationToken = default)
{
return Task.FromResult(Get(lookup));
}

View File

@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using osu.Framework.Allocation;
using osu.Framework.Audio;
@ -115,7 +116,7 @@ namespace osu.Game.Rulesets.UI
public Sample Get(string name) => primary.Get(name) ?? fallback.Get(name);
public Task<Sample> GetAsync(string name) => primary.GetAsync(name) ?? fallback.GetAsync(name);
public Task<Sample> GetAsync(string name, CancellationToken cancellationToken = default) => primary.GetAsync(name, cancellationToken) ?? fallback.GetAsync(name, cancellationToken);
public Stream GetStream(string name) => primary.GetStream(name) ?? fallback.GetStream(name);

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using osu.Framework.Allocation;
using osu.Framework.Audio;
@ -166,7 +167,7 @@ namespace osu.Game.Tests.Beatmaps
return Array.Empty<byte>();
}
public Task<byte[]> GetAsync(string name)
public Task<byte[]> GetAsync(string name, CancellationToken cancellationToken = default)
{
markLookup(name);
return Task.FromResult(Array.Empty<byte>());

View File

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
using osu.Framework.Allocation;
@ -352,7 +353,7 @@ namespace osu.Game.Tests.Visual
public Track Get(string name) => throw new NotImplementedException();
public Task<Track> GetAsync(string name) => throw new NotImplementedException();
public Task<Track> GetAsync(string name, CancellationToken cancellationToken = default) => throw new NotImplementedException();
public Stream GetStream(string name) => throw new NotImplementedException();

View File

@ -36,7 +36,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Realm" Version="10.7.1" />
<PackageReference Include="ppy.osu.Framework" Version="2021.1221.0" />
<PackageReference Include="ppy.osu.Framework" Version="2021.1222.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.1215.0" />
<PackageReference Include="Sentry" Version="3.12.1" />
<PackageReference Include="SharpCompress" Version="0.30.1" />

View File

@ -60,7 +60,7 @@
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup Label="Package References">
<PackageReference Include="ppy.osu.Framework.iOS" Version="2021.1221.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2021.1222.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.1215.0" />
</ItemGroup>
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net5.0 / net6.0) -->
@ -83,7 +83,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="ppy.osu.Framework" Version="2021.1221.0" />
<PackageReference Include="ppy.osu.Framework" Version="2021.1222.0" />
<PackageReference Include="SharpCompress" Version="0.30.0" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="SharpRaven" Version="2.4.0" />