diff options
author | Alexander Köplinger <alex.koeplinger@outlook.com> | 2018-11-06 21:43:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-06 21:43:09 +0300 |
commit | 30e870b19e8aaea6c55c53e40809df06292df204 (patch) | |
tree | 21804c190b716099292daece09815977c0d99118 | |
parent | 2f749688f76d09c27666a4416b28ea4acc65eb2a (diff) |
[ios sdk] Package resource assemblies into app bundle (#11575)
.NET resource assemblies live in subdirectories named after the culture
of the resource. We need to package these assemblies too.
Addresses https://github.com/mono/mono/pull/11547#issuecomment-435688914
-rw-r--r-- | sdks/ios/appbuilder/appbuilder.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sdks/ios/appbuilder/appbuilder.cs b/sdks/ios/appbuilder/appbuilder.cs index 2bec6893809..706c02fdbd7 100644 --- a/sdks/ios/appbuilder/appbuilder.cs +++ b/sdks/ios/appbuilder/appbuilder.cs @@ -1,5 +1,7 @@ using System; using System.IO; +using System.Globalization; +using System.Linq; using System.Reflection; using System.Collections.Generic; using Mono.Options; @@ -232,6 +234,7 @@ public class AppBuilder var ofiles = ""; var assembly_names = new List<string> (); + var cultures = CultureInfo.GetCultures (CultureTypes.AllCultures).Where (x => !String.IsNullOrEmpty (x.IetfLanguageTag)).Select (x => x.IetfLanguageTag); foreach (var assembly in assemblies) { string filename = Path.GetFileName (assembly); var filename_noext = Path.GetFileNameWithoutExtension (filename); @@ -243,6 +246,17 @@ public class AppBuilder ninja.WriteLine ($"build $appdir/{filename}: cpifdiff $builddir/{filename}"); + var assembly_dir = Path.GetDirectoryName (assembly); + var resource_filename = filename.Replace (".dll", ".resources.dll"); + foreach (var culture in cultures) { + var resource_assembly = Path.Combine (assembly_dir, culture, resource_filename); + if (!File.Exists(resource_assembly)) continue; + + Directory.CreateDirectory (Path.Combine (builddir, culture)); + File.Copy (resource_assembly, Path.Combine (builddir, culture, resource_filename), true); + ninja.WriteLine ($"build $appdir/{culture}/{resource_filename}: cpifdiff $builddir/{culture}/{resource_filename}"); + } + if (isinterpany && filename_noext != "mscorlib") continue; |