feat: Adds .NET 7 & Arm64 support (#1229)
## BREAKING CHANGE **Publishing for linux will no longer include runtimes** ## Major Changes * Adds .NET 7 support. * Adds ARM64 support (experimental). * Changes linux support to be open-ended against anything .NET 7 supports. * Fixes native library resolutions. (Make sure to install `dev` versions of the libraries) * Updates README * Adds Ubuntu 22, CentOS 8/9 Stream to CI/CD. ## TODOs: * Update modernuo.com docs Closes #1173 Closes #1159
This commit is contained in:
parent
119eec6b61
commit
5bd41d5b68
42 changed files with 164 additions and 232 deletions
|
|
@ -316,11 +316,7 @@ public ref struct PooledRefQueue<T>
|
|||
}
|
||||
|
||||
// Increments the index wrapping it if necessary.
|
||||
#if NET7_SDK
|
||||
private void MoveNext(scoped ref int index)
|
||||
#else
|
||||
private void MoveNext(ref int index)
|
||||
#endif
|
||||
{
|
||||
// It is tempting to use the remainder operator here but it is actually much slower
|
||||
// than a simple comparison and a rarely taken branch.
|
||||
|
|
|
|||
|
|
@ -36,11 +36,7 @@ public class GumpAlphaRegion : GumpEntry
|
|||
|
||||
public int Height { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
writer.WriteAscii($"{{ checkertrans {X} {Y} {Width} {Height} }}");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,11 +39,7 @@ public class GumpBackground : GumpEntry
|
|||
|
||||
public int GumpID { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
writer.WriteAscii($"{{ resizepic {X} {Y} {GumpID} {Width} {Height} }}");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,11 +54,7 @@ public class GumpButton : GumpEntry
|
|||
|
||||
public int Param { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
writer.WriteAscii($"{{ button {X} {Y} {NormalID} {PressedID} {(int)Type} {Param} {ButtonID} }}");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,11 +42,7 @@ public class GumpCheck : GumpEntry
|
|||
|
||||
public int SwitchID { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
var initialState = InitialState ? "1" : "0";
|
||||
writer.WriteAscii($"{{ checkbox {X} {Y} {InactiveID} {ActiveID} {initialState} {SwitchID} }}");
|
||||
|
|
|
|||
|
|
@ -22,11 +22,7 @@ public class GumpECHandleInput : GumpEntry
|
|||
{
|
||||
private static byte[] _layout = Gump.StringToBuffer("{ echandleinput }");
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
writer.Write(_layout);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,9 +25,5 @@ public abstract class GumpEntry
|
|||
|
||||
// TODO: Replace OrderedHashSet with InsertOnlyHashSet, a copy of HashSet that is ReadOnly compatible, but includes
|
||||
// a public AddIfNotPresent function that returns the index of the element
|
||||
#if NET7_SDK
|
||||
public abstract void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches);
|
||||
#else
|
||||
public abstract void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,11 +26,7 @@ public class GumpGroup : GumpEntry
|
|||
|
||||
public int Group { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
if (Group == 1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -45,11 +45,7 @@ public class GumpHtml : GumpEntry
|
|||
|
||||
public bool Scrollbar { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
var textIndex = strings.GetOrAdd(Text ?? "");
|
||||
var background = Background ? "1" : "0";
|
||||
|
|
|
|||
|
|
@ -101,11 +101,7 @@ public class GumpHtmlLocalized : GumpEntry
|
|||
public GumpHtmlLocalizedType Type { get; set; }
|
||||
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
var background = Background ? "1" : "0";
|
||||
var scrollbar = Scrollbar ? "1" : "0";
|
||||
|
|
|
|||
|
|
@ -39,11 +39,7 @@ public class GumpImage : GumpEntry
|
|||
|
||||
public string Class { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
var hasHue = Hue != 0;
|
||||
var hasClass = !string.IsNullOrEmpty(Class);
|
||||
|
|
|
|||
|
|
@ -61,11 +61,7 @@ public class GumpImageTileButton : GumpEntry
|
|||
|
||||
public int Height { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
writer.WriteAscii(
|
||||
$"{{ buttontileart {X} {Y} {NormalID} {PressedID} {(int)Type} {Param} {ButtonID} {ItemID} {Hue} {Width} {Height} }}"
|
||||
|
|
|
|||
|
|
@ -39,11 +39,7 @@ public class GumpImageTiled : GumpEntry
|
|||
|
||||
public int GumpID { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
writer.WriteAscii($"{{ gumppictiled {X} {Y} {Width} {Height} {GumpID} }}");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,11 +36,7 @@ public class GumpItem : GumpEntry
|
|||
|
||||
public int Hue { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
writer.WriteAscii(Hue == 0 ? $"{{ tilepic {X} {Y} {ItemID} }}" : $"{{ tilepichue {X} {Y} {ItemID} {Hue} }}");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,11 +24,7 @@ public class GumpItemProperty : GumpEntry
|
|||
|
||||
public Serial Serial { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
writer.WriteAscii($"{{ itemproperty {Serial.Value} }}");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,11 +36,7 @@ public class GumpLabel : GumpEntry
|
|||
|
||||
public string Text { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
var textIndex = strings.GetOrAdd(Text ?? "");
|
||||
writer.WriteAscii($"{{ text {X} {Y} {Hue} {textIndex} }}");
|
||||
|
|
|
|||
|
|
@ -42,11 +42,7 @@ public class GumpLabelCropped : GumpEntry
|
|||
|
||||
public string Text { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
var textIndex = strings.GetOrAdd(Text ?? "");
|
||||
writer.WriteAscii($"{{ croppedtext {X} {Y} {Width} {Height} {Hue} {textIndex} }}");
|
||||
|
|
|
|||
|
|
@ -24,11 +24,7 @@ public class GumpMasterGump : GumpEntry
|
|||
|
||||
public int GumpID { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
writer.WriteAscii($"{{ mastergump {GumpID} }}");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,11 +26,7 @@ public class GumpPage : GumpEntry
|
|||
|
||||
public int Page { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
if (Page == 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -42,11 +42,7 @@ public class GumpRadio : GumpEntry
|
|||
|
||||
public int SwitchID { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
var initialState = InitialState ? "1" : "0";
|
||||
writer.WriteAscii($"{{ radio {X} {Y} {InactiveID} {ActiveID} {initialState} {SwitchID} }}");
|
||||
|
|
|
|||
|
|
@ -45,11 +45,7 @@ public class GumpSpriteImage : GumpEntry
|
|||
|
||||
public int SY { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
writer.WriteAscii($"{{ picinpic {X} {Y} {GumpID} {Width} {Height} {SX} {SY} }}");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,11 +45,7 @@ public class GumpTextEntry : GumpEntry
|
|||
|
||||
public string InitialText { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
var textIndex = strings.GetOrAdd(InitialText ?? "");
|
||||
writer.WriteAscii($"{{ textentry {X} {Y} {Width} {Height} {Hue} {EntryID} {textIndex} }}");
|
||||
|
|
|
|||
|
|
@ -50,11 +50,7 @@ public class GumpTextEntryLimited : GumpEntry
|
|||
|
||||
public int Size { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
var textIndex = strings.GetOrAdd(InitialText ?? "");
|
||||
writer.WriteAscii($"{{ textentrylimited {X} {Y} {Width} {Height} {Hue} {EntryID} {textIndex} {Size} }}");
|
||||
|
|
|
|||
|
|
@ -32,11 +32,7 @@ public class GumpTooltip : GumpEntry
|
|||
|
||||
public string Args { get; set; }
|
||||
|
||||
#if NET7_SDK
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
||||
#else
|
||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||
#endif
|
||||
{
|
||||
writer.WriteAscii(string.IsNullOrEmpty(Args) ? $"{{ tooltip {Number} }}" : $"{{ tooltip {Number} @{Args}@ }}");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
<PublishDir>..\..\Distribution</PublishDir>
|
||||
<OutDir>..\..\Distribution</OutDir>
|
||||
<Version>0.0.0</Version>
|
||||
<DefineConstants Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '7.0'))">NET7_SDK</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<Target Name="CleanPub" AfterTargets="Clean">
|
||||
<Message Text="Removing distribution files..." />
|
||||
|
|
@ -23,8 +22,6 @@
|
|||
<Delete Files="..\..\Distribution\$(AssemblyName).runtimeconfig.dev.json" ContinueOnError="true" />
|
||||
<Delete Files="..\..\Distribution\$(AssemblyName).runtimeconfig.json" ContinueOnError="true" />
|
||||
<Delete Files="..\..\Distribution\ModernUO.Serialization.Annotations.dll" ContinueOnError="true" />
|
||||
<Delete Files="..\..\Distribution\libz.dylib" ContinueOnError="true" />
|
||||
<Delete Files="..\..\Distribution\libz.so" ContinueOnError="true" />
|
||||
<Delete Files="..\..\Distribution\Microsoft.Toolkit.HighPerformance.dll" ContinueOnError="true" />
|
||||
<Delete Files="..\..\Distribution\PollGroup.dll" ContinueOnError="true" />
|
||||
<Delete Files="..\..\Distribution\ref\$(AssemblyName).dll" ContinueOnError="true" />
|
||||
|
|
@ -33,15 +30,14 @@
|
|||
<Delete Files="..\..\Distribution\Serilog.Sinks.Console.dll" ContinueOnError="true" />
|
||||
<Delete Files="..\..\Distribution\wepoll.dll" ContinueOnError="true" />
|
||||
<Delete Files="..\..\Distribution\ZLib.Bindings.dll" ContinueOnError="true" />
|
||||
<Delete Files="..\..\Distribution\zlib.dll" ContinueOnError="true" />
|
||||
</Target>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Toolkit.HighPerformance" Version="7.1.2" />
|
||||
<PackageReference Include="PollGroup" Version="1.2.1" />
|
||||
<PackageReference Include="PollGroup" Version="1.3.0" />
|
||||
<PackageReference Include="Standart.Hash.xxHash.Signed" Version="4.0.5" />
|
||||
<PackageReference Include="Zlib.Bindings" Version="1.9.2" />
|
||||
<PackageReference Include="Zlib.Bindings" Version="1.10.1" />
|
||||
|
||||
<PackageReference Include="ModernUO.Serialization.Annotations" Version="2.5.0" />
|
||||
<PackageReference Include="ModernUO.Serialization.Annotations" Version="2.5.3" />
|
||||
<PackageReference Include="ModernUO.Serialization.Generator" Version="2.5.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue