[dotnet] Globalization works for Mac Catalyst now. Fixes #11392. (#12247)

Fixes https://github.com/xamarin/xamarin-macios/issues/11392.
This commit is contained in:
Rolf Bjarne Kvinge 2021-07-28 09:12:22 +02:00 коммит произвёл GitHub
Родитель 600ce3290b
Коммит 7986b2f2af
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
8 изменённых файлов: 1 добавлений и 29 удалений

Просмотреть файл

@ -128,8 +128,7 @@
<EnableUnsafeUTF7Encoding Condition="'$(EnableUnsafeUTF7Encoding)' == ''">false</EnableUnsafeUTF7Encoding> <EnableUnsafeUTF7Encoding Condition="'$(EnableUnsafeUTF7Encoding)' == ''">false</EnableUnsafeUTF7Encoding>
<EventSourceSupport Condition="'$(EventSourceSupport)' == ''">false</EventSourceSupport> <EventSourceSupport Condition="'$(EventSourceSupport)' == ''">false</EventSourceSupport>
<HttpActivityPropagationSupport Condition="'$(HttpActivityPropagationSupport)' == ''">false</HttpActivityPropagationSupport> <HttpActivityPropagationSupport Condition="'$(HttpActivityPropagationSupport)' == ''">false</HttpActivityPropagationSupport>
<!-- native bits for ICU are not ready for Catalyst - https://github.com/xamarin/xamarin-macios/issues/11392 --> <InvariantGlobalization Condition="'$(InvariantGlobalization)' == ''">false</InvariantGlobalization>
<InvariantGlobalization Condition="'$(_PlatformName)' == 'MacCatalyst' And '$(InvariantGlobalization)' == ''">true</InvariantGlobalization>
<StartupHookSupport Condition="'$(StartupHookSupport)' == ''">false</StartupHookSupport> <StartupHookSupport Condition="'$(StartupHookSupport)' == ''">false</StartupHookSupport>
<UseSystemResourceKeys Condition="'$(UseSystemResourceKeys)' == ''">true</UseSystemResourceKeys> <UseSystemResourceKeys Condition="'$(UseSystemResourceKeys)' == ''">true</UseSystemResourceKeys>
<UseNativeHttpHandler Condition="'$(_PlatformName)' != 'macOS' And '$(UseNativeHttpHandler)' == ''">true</UseNativeHttpHandler> <UseNativeHttpHandler Condition="'$(_PlatformName)' != 'macOS' And '$(UseNativeHttpHandler)' == ''">true</UseNativeHttpHandler>

Просмотреть файл

@ -41,7 +41,6 @@ namespace EmbeddedResources {
var manager = new ResourceManager ("EmbeddedResources.Welcome", typeof(ResourcesTest).Assembly); var manager = new ResourceManager ("EmbeddedResources.Welcome", typeof(ResourcesTest).Assembly);
#endif #endif
#if !(NET && __MACCATALYST__) // https://github.com/xamarin/xamarin-macios/issues/11392
Assert.AreEqual ("Welcome", manager.GetString ("String1", new CultureInfo ("en")), "en"); Assert.AreEqual ("Welcome", manager.GetString ("String1", new CultureInfo ("en")), "en");
Assert.AreEqual ("G'day", manager.GetString ("String1", new CultureInfo ("en-AU")), "en-AU"); Assert.AreEqual ("G'day", manager.GetString ("String1", new CultureInfo ("en-AU")), "en-AU");
Assert.AreEqual ("Willkommen", manager.GetString ("String1", new CultureInfo ("de")), "de"); Assert.AreEqual ("Willkommen", manager.GetString ("String1", new CultureInfo ("de")), "de");
@ -49,7 +48,6 @@ namespace EmbeddedResources {
Assert.AreEqual ("Bienvenido", manager.GetString ("String1", new CultureInfo ("es")), "es"); Assert.AreEqual ("Bienvenido", manager.GetString ("String1", new CultureInfo ("es")), "es");
Assert.AreEqual ("Bienvenido", manager.GetString ("String1", new CultureInfo ("es-AR")), "es-AR"); Assert.AreEqual ("Bienvenido", manager.GetString ("String1", new CultureInfo ("es-AR")), "es-AR");
Assert.AreEqual ("Bienvenido", manager.GetString ("String1", new CultureInfo ("es-ES")), "es-ES"); Assert.AreEqual ("Bienvenido", manager.GetString ("String1", new CultureInfo ("es-ES")), "es-ES");
#endif
} }
} }
} }

Просмотреть файл

@ -10,9 +10,6 @@ namespace LinkAll.Calendars {
[TestFixture] [TestFixture]
// we want the tests to be available because we use the linker // we want the tests to be available because we use the linker
[Preserve (AllMembers = true)] [Preserve (AllMembers = true)]
#if NET && __MACCATALYST__
[Ignore ("No globalization data yet for Mac Catalyst - https://github.com/xamarin/xamarin-macios/issues/11392")]
#endif
public class CalendarTest { public class CalendarTest {
// application *MUST* be build with I18N.MidEast and I18N.Other (Thai) // application *MUST* be build with I18N.MidEast and I18N.Other (Thai)

Просмотреть файл

@ -10,9 +10,6 @@ namespace LinkSdk.Calendars {
[TestFixture] [TestFixture]
// we want the tests to be available because we use the linker // we want the tests to be available because we use the linker
[Preserve (AllMembers = true)] [Preserve (AllMembers = true)]
#if NET && __MACCATALYST__
[Ignore ("No globalization data yet for Mac Catalyst - https://github.com/xamarin/xamarin-macios/issues/11392")]
#endif
public class CalendarTest { public class CalendarTest {
// application must *NOT* be build with I18N.MidEast and I18N.Other (Thai) // application must *NOT* be build with I18N.MidEast and I18N.Other (Thai)

Просмотреть файл

@ -468,9 +468,6 @@ namespace LinkSdk {
#endif // !__WATCHOS__ && !__MACCATALYST__ #endif // !__WATCHOS__ && !__MACCATALYST__
[Test] [Test]
#if NET && __MACCATALYST__
[Ignore ("No globalization data yet for Mac Catalyst - https://github.com/xamarin/xamarin-macios/issues/11392")]
#endif
public void XElement_3137 () public void XElement_3137 ()
{ {
CultureInfo current = Thread.CurrentThread.CurrentCulture; CultureInfo current = Thread.CurrentThread.CurrentCulture;

Просмотреть файл

@ -14,9 +14,6 @@ namespace LinkSdk {
[Test] [Test]
[SetCulture ("cs-CZ")] [SetCulture ("cs-CZ")]
#if NET && __MACCATALYST__
[Ignore ("No globalization data yet for Mac Catalyst - https://github.com/xamarin/xamarin-macios/issues/11392")]
#endif
public void CzechDictComparer () public void CzechDictComparer ()
{ {
DictComparer (); DictComparer ();
@ -24,9 +21,6 @@ namespace LinkSdk {
[Test] [Test]
[SetCulture ("en-US")] [SetCulture ("en-US")]
#if NET && __MACCATALYST__
[Ignore ("No globalization data yet for Mac Catalyst - https://github.com/xamarin/xamarin-macios/issues/11392")]
#endif
public void EnglishDictComparer () public void EnglishDictComparer ()
{ {
DictComparer (); DictComparer ();

Просмотреть файл

@ -38,9 +38,6 @@ namespace MonoTouchFixtures.Foundation {
Assert.That (NSLocale.FromLocaleIdentifier (ident).Identifier, Is.EqualTo (ident), "FromLocaleIdentifier"); Assert.That (NSLocale.FromLocaleIdentifier (ident).Identifier, Is.EqualTo (ident), "FromLocaleIdentifier");
} }
#if NET && __MACCATALYST__
[Ignore ("No globalization for Mac Catalyst yet - https://github.com/xamarin/xamarin-macios/issues/11392")]
#endif
[Test] [Test]
public void InitRegionInfo () public void InitRegionInfo ()
{ {

Просмотреть файл

@ -168,13 +168,6 @@ namespace Xamarin.Linker.Steps
case "libSystem.Globalization.Native": case "libSystem.Globalization.Native":
case "System.Globalization.Native": case "System.Globalization.Native":
#if NET
// https://github.com/xamarin/xamarin-macios/issues/11392
if (DerivedLinkContext.App.Platform == ApplePlatform.MacCatalyst) {
Driver.Log (4, "Did not add native reference to {0} in {1} referenced by {2} in {3}.", pinfo.EntryPoint, pinfo.Module.Name, method.FullName, method.Module.Name);
break;
}
#endif
addPInvokeSymbol = true; addPInvokeSymbol = true;
break; break;