Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] HybridGlobalization set flag in SDK #18498

Merged
merged 5 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 4 additions & 1 deletion dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
<EventSourceSupport Condition="'$(EventSourceSupport)' == ''">false</EventSourceSupport>
<HttpActivityPropagationSupport Condition="'$(HttpActivityPropagationSupport)' == ''">false</HttpActivityPropagationSupport>
<InvariantGlobalization Condition="'$(InvariantGlobalization)' == ''">false</InvariantGlobalization>
<HybridGlobalization Condition="'$(HybridGlobalization)' == ''">false</HybridGlobalization>
<StartupHookSupport Condition="'$(StartupHookSupport)' == ''">false</StartupHookSupport>
<UseSystemResourceKeys Condition="'$(UseSystemResourceKeys)' == '' And '$(_BundlerDebug)' != 'true'">true</UseSystemResourceKeys>
<UseSystemResourceKeys Condition="'$(UseSystemResourceKeys)' == '' And '$(_BundlerDebug)' == 'true'">false</UseSystemResourceKeys>
Expand All @@ -143,7 +144,8 @@
</PropertyGroup>

<PropertyGroup>
<_GlobalizationDataFile Condition="'$(_PlatformName)' != 'macOS' And '$(InvariantGlobalization)' != 'true' And '$(_GlobalizationDataFile)' == ''">icudt.dat</_GlobalizationDataFile>
<_GlobalizationDataFile Condition="'$(_PlatformName)' != 'macOS' And '$(InvariantGlobalization)' != 'true' And '$(HybridGlobalization)' != 'true' And '$(_GlobalizationDataFile)' == ''">icudt.dat</_GlobalizationDataFile>
<_GlobalizationDataFile Condition="'$(_PlatformName)' != 'macOS' And '$(InvariantGlobalization)' != 'true' And '$(HybridGlobalization)' == 'true' And '$(_GlobalizationDataFile)' == ''">icudt_hybrid.dat</_GlobalizationDataFile>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -494,6 +496,7 @@
Interpreter=$(MtouchInterpreter)
IntermediateLinkDir=$(IntermediateLinkDir)
InvariantGlobalization=$(InvariantGlobalization)
HybridGlobalization=$(HybridGlobalization)
ItemsDirectory=$(_LinkerItemsDirectory)
IsAppExtension=$(IsAppExtension)
IsSimulatorBuild=$(_SdkIsSimulator)
Expand Down
1 change: 1 addition & 0 deletions tests/common/DotNet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ public static void CompareApps (string old_app, string new_app)
var filename = Path.GetFileName (v);
switch (filename) {
case "icudt.dat":
case "icudt_hybrid.dat":
return false; // ICU data file only present on .NET
case "runtime-options.plist":
return false; // the .NET runtime will deal with selecting the http handler, no need for us to do anything
Expand Down
4 changes: 3 additions & 1 deletion tests/dotnet/UnitTests/BundleStructureTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,10 @@ internal static void CheckAppBundleContents (ApplePlatform platform, IEnumerable
}

// misc other files not directly related to the test itself
if (!isCoreCLR)
if (!isCoreCLR) {
expectedFiles.Add (Path.Combine (assemblyDirectory, "icudt.dat"));
expectedFiles.Add (Path.Combine (assemblyDirectory, "icudt_hybrid.dat"));
rolfbjarne marked this conversation as resolved.
Show resolved Hide resolved
}
AddMultiRidAssembly (platform, expectedFiles, assemblyDirectory, "BundleStructure", runtimeIdentifiers, addConfig: true, includeDebugFiles: includeDebugFiles);
if (platform != ApplePlatform.MacOSX)
AddMultiRidAssembly (platform, expectedFiles, assemblyDirectory, "MonoTouch.Dialog", runtimeIdentifiers, forceSingleRid: true, includeDebugFiles: includeDebugFiles);
Expand Down
4 changes: 4 additions & 0 deletions tools/dotnet-linker/LinkerConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class LinkerConfiguration {
public string GlobalizationDataFile { get; private set; } = string.Empty;
public string IntermediateLinkDir { get; private set; } = string.Empty;
public bool InvariantGlobalization { get; private set; }
public bool HybridGlobalization { get; private set; }
public string ItemsDirectory { get; private set; } = string.Empty;
public bool IsSimulatorBuild { get; private set; }
public string PartialStaticRegistrarLibrary { get; set; } = string.Empty;
Expand Down Expand Up @@ -316,6 +317,9 @@ public static LinkerConfiguration GetInstance (LinkContext context)
case "InvariantGlobalization":
InvariantGlobalization = string.Equals ("true", value, StringComparison.OrdinalIgnoreCase);
break;
case "HybridGlobalization":
HybridGlobalization = string.Equals ("true", value, StringComparison.OrdinalIgnoreCase);
break;
case "XamarinNativeLibraryDirectory":
XamarinNativeLibraryDirectory = value;
break;
Expand Down
2 changes: 2 additions & 0 deletions tools/dotnet-linker/Steps/GenerateMainStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ protected override void TryEndProcess ()
if (Configuration.InvariantGlobalization) {
contents.AppendLine ("\tsetenv (\"DOTNET_SYSTEM_GLOBALIZATION_INVARIANT\", \"1\", 1);");
} else {
if (Configuration.HybridGlobalization)
contents.AppendLine ("\tsetenv (\"DOTNET_SYSTEM_GLOBALIZATION_HYBRID\", \"1\", 1);");
contents.AppendLine ($"\txamarin_icu_dat_file_name = \"{Configuration.GlobalizationDataFile}\";");
}
if (Configuration.Application.PackageManagedDebugSymbols && Configuration.Application.UseInterpreter)
Expand Down