mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 21:02:55 +08:00
Merge pull request #4378 from peppy/fix-ios-versioning
Fix iOS builds not being able to read their deploy version
This commit is contained in:
commit
810828e807
@ -75,9 +75,9 @@ namespace osu.Game
|
|||||||
|
|
||||||
private Bindable<bool> fpsDisplayVisible;
|
private Bindable<bool> fpsDisplayVisible;
|
||||||
|
|
||||||
protected AssemblyName AssemblyName => Assembly.GetEntryAssembly()?.GetName() ?? new AssemblyName { Version = new Version() };
|
public virtual Version AssemblyVersion => Assembly.GetEntryAssembly()?.GetName().Version ?? new Version();
|
||||||
|
|
||||||
public bool IsDeployedBuild => AssemblyName.Version.Major > 0;
|
public bool IsDeployedBuild => AssemblyVersion.Major > 0;
|
||||||
|
|
||||||
public string Version
|
public string Version
|
||||||
{
|
{
|
||||||
@ -86,8 +86,8 @@ namespace osu.Game
|
|||||||
if (!IsDeployedBuild)
|
if (!IsDeployedBuild)
|
||||||
return @"local " + (DebugUtils.IsDebug ? @"debug" : @"release");
|
return @"local " + (DebugUtils.IsDebug ? @"debug" : @"release");
|
||||||
|
|
||||||
var assembly = AssemblyName;
|
var version = AssemblyVersion;
|
||||||
return $@"{assembly.Version.Major}.{assembly.Version.Minor}.{assembly.Version.Build}";
|
return $@"{version.Major}.{version.Minor}.{version.Build}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using Foundation;
|
using Foundation;
|
||||||
@ -10,6 +10,6 @@ namespace osu.iOS
|
|||||||
[Register("AppDelegate")]
|
[Register("AppDelegate")]
|
||||||
public class AppDelegate : GameAppDelegate
|
public class AppDelegate : GameAppDelegate
|
||||||
{
|
{
|
||||||
protected override Framework.Game CreateGame() => new OsuGame();
|
protected override Framework.Game CreateGame() => new OsuGameIOS();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
14
osu.iOS/OsuGameIOS.cs
Normal file
14
osu.iOS/OsuGameIOS.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using Foundation;
|
||||||
|
using osu.Game;
|
||||||
|
|
||||||
|
namespace osu.iOS
|
||||||
|
{
|
||||||
|
public class OsuGameIOS : OsuGame
|
||||||
|
{
|
||||||
|
protected override Version AssemblyVersion => new Version(NSBundle.MainBundle.InfoDictionary["CFBundleVersion"].ToString());
|
||||||
|
}
|
||||||
|
}
|
@ -48,6 +48,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Application.cs" />
|
<Compile Include="Application.cs" />
|
||||||
<Compile Include="AppDelegate.cs" />
|
<Compile Include="AppDelegate.cs" />
|
||||||
|
<Compile Include="OsuGameIOS.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<LinkDescription Include="Linker.xml" />
|
<LinkDescription Include="Linker.xml" />
|
||||||
|
Loading…
Reference in New Issue
Block a user