Esempio n. 1
0
        public void BuildIpaTest(ApplePlatform platform, string runtimeIdentifiers)
        {
            var project = "MySimpleApp";

            Configuration.IgnoreIfIgnoredPlatform(platform);

            var project_path = GetProjectPath(project, runtimeIdentifiers: runtimeIdentifiers, platform: platform, out var appPath, configuration: "Release");

            Clean(project_path);
            var properties = GetDefaultProperties(runtimeIdentifiers);

            properties ["BuildIpa"]      = "true";
            properties ["Configuration"] = "Release";

            DotNet.AssertBuild(project_path, properties);

            var pkgPath = Path.Combine(appPath, "..", $"{project}.ipa");

            Assert.That(pkgPath, Does.Exist, "pkg creation");

            AssertBundleAssembliesStripStatus(appPath, true);
        }
Esempio n. 2
0
        public void BuildEmbeddedResourcesTest(string platform)
        {
            if (!Configuration.include_mac)
            {
                Assert.Ignore("Ignore until Xamarin.Mac is re-enabled. Issue: https://github.com/xamarin/xamarin-macios/issues/9680");
            }
            var assemblyName        = "EmbeddedResources";
            var dotnet_bindings_dir = Path.Combine(Configuration.SourceRoot, "tests", assemblyName, "dotnet");
            var project_dir         = Path.Combine(dotnet_bindings_dir, platform);
            var project_path        = Path.Combine(project_dir, $"{assemblyName}.csproj");

            Clean(project_path);
            Configuration.CopyDotNetSupportingFiles(dotnet_bindings_dir);
            var result = DotNet.AssertBuild(project_path, verbosity);
            var lines  = result.StandardOutput.ToString().Split('\n');
            // Find the resulting binding assembly from the build log
            var assemblies = FilterToAssembly(lines, assemblyName);

            Assert.That(assemblies, Is.Not.Empty, "Assemblies");
            // Make sure there's no other assembly confusing our logic
            assemblies = assemblies.Distinct();
            Assert.That(assemblies.Count(), Is.EqualTo(1), $"Unique assemblies\n\t{string.Join ("\n\t", assemblies)}");
            var asm = assemblies.First();

            Assert.That(asm, Does.Exist, "Assembly existence");
            // Verify that there's one resource in the assembly, and its name
            var ad = AssemblyDefinition.ReadAssembly(asm, new ReaderParameters {
                ReadingMode = ReadingMode.Deferred
            });

            Assert.That(ad.MainModule.Resources.Count, Is.EqualTo(1), "1 resource");
            Assert.That(ad.MainModule.Resources [0].Name, Is.EqualTo("EmbeddedResources.Welcome.resources"), "libtest.a");
            var asm_dir = Path.GetDirectoryName(asm);

            Assert.That(Path.Combine(asm_dir, "en-AU", "EmbeddedResources.resources.dll"), Does.Exist, "en-AU");
            Assert.That(Path.Combine(asm_dir, "de", "EmbeddedResources.resources.dll"), Does.Exist, "de");
            Assert.That(Path.Combine(asm_dir, "es", "EmbeddedResources.resources.dll"), Does.Exist, "es");
        }
Esempio n. 3
0
        public void FilesInAppBundle(ApplePlatform platform, string runtimeIdentifiers)
        {
            var project = "MySimpleApp";

            Configuration.IgnoreIfIgnoredPlatform(platform);

            var project_path = GetProjectPath(project, runtimeIdentifiers: runtimeIdentifiers, platform: platform, out var appPath);

            Clean(project_path);

            var properties = GetDefaultProperties(runtimeIdentifiers);

            // Build
            DotNet.AssertBuild(project_path, properties);

            // Simulate a crash dump
            var crashDump = Path.Combine(appPath, "mono_crash.mem.123456.something.blob");

            File.WriteAllText(crashDump, "A crash dump");

            // Build again
            DotNet.AssertBuild(project_path, properties);
        }
Esempio n. 4
0
        public void BuildFatApp(ApplePlatform platform, string runtimeIdentifiers)
        {
            var project = "MySimpleApp";

            Configuration.IgnoreIfIgnoredPlatform(platform);

            var project_path = GetProjectPath(project, runtimeIdentifiers: runtimeIdentifiers, platform: platform, out var appPath);

            Clean(project_path);
            var properties = GetDefaultProperties(runtimeIdentifiers);
            var result     = DotNet.AssertBuild(project_path, properties);

            AssertThatLinkerExecuted(result);
            var infoPlistPath = GetInfoPListPath(platform, appPath);

            Assert.That(infoPlistPath, Does.Exist, "Info.plist");
            var infoPlist = PDictionary.FromFile(infoPlistPath);

            Assert.AreEqual("com.xamarin.mysimpleapp", infoPlist.GetString("CFBundleIdentifier").Value, "CFBundleIdentifier");
            Assert.AreEqual("MySimpleApp", infoPlist.GetString("CFBundleDisplayName").Value, "CFBundleDisplayName");
            Assert.AreEqual("3.14", infoPlist.GetString("CFBundleVersion").Value, "CFBundleVersion");
            Assert.AreEqual("3.14", infoPlist.GetString("CFBundleShortVersionString").Value, "CFBundleShortVersionString");
        }
Esempio n. 5
0
        public void BuildBundledResources(string platform, string prefix)
        {
            if (!Configuration.include_mac)
            {
                Assert.Ignore("Ignore until Xamarin.Mac is re-enabled. Issue: https://github.com/xamarin/xamarin-macios/issues/9680");
            }
            var assemblyName        = "BundledResources";
            var dotnet_bindings_dir = Path.Combine(Configuration.SourceRoot, "tests", assemblyName, "dotnet");
            var project_dir         = Path.Combine(dotnet_bindings_dir, platform);
            var project_path        = Path.Combine(project_dir, $"{assemblyName}.csproj");

            Clean(project_path);
            Configuration.CopyDotNetSupportingFiles(dotnet_bindings_dir);
            var result = DotNet.AssertBuild(project_path, verbosity);
            var lines  = result.StandardOutput.ToString().Split('\n');
            // Find the resulting binding assembly from the build log
            var assemblies = FilterToAssembly(lines, assemblyName);

            Assert.That(assemblies, Is.Not.Empty, "Assemblies");
            // Make sure there's no other assembly confusing our logic
            Assert.That(assemblies.Distinct().Count(), Is.EqualTo(1), "Unique assemblies");
            var asm = assemblies.First();

            Assert.That(asm, Does.Exist, "Assembly existence");

            // Verify that there's one resource in the binding assembly, and its name
            var ad = AssemblyDefinition.ReadAssembly(asm, new ReaderParameters {
                ReadingMode = ReadingMode.Deferred
            });

            Assert.That(ad.MainModule.Resources.Count, Is.EqualTo(2), "2 resources");
            // Sort the resources before we assert, since we don't care about the order, and sorted order makes the asserts simpler.
            var resources = ad.MainModule.Resources.OrderBy(v => v.Name).ToArray();

            Assert.That(resources [0].Name, Is.EqualTo($"__{prefix}_content_basn3p08.png"), $"__{prefix}_content_basn3p08.png");
            Assert.That(resources [1].Name, Is.EqualTo($"__{prefix}_content_xamvideotest.mp4"), $"__{prefix}_content_xamvideotest.mp4");
        }
Esempio n. 6
0
        public void IsNotMacBuild(string runtimeIdentifier, bool isDeviceBuild)
        {
            if (isDeviceBuild)
            {
                Configuration.AssertDeviceAvailable();
            }

            var platform     = ApplePlatform.iOS;
            var project_path = GetProjectPath("MySingleView", runtimeIdentifiers: runtimeIdentifier, platform: platform, out var appPath);

            Configuration.IgnoreIfIgnoredPlatform(platform);
            Clean(project_path);
            var properties = GetDefaultProperties(runtimeIdentifier);

            properties ["IsMacEnabled"] = "false";
            var result = DotNet.AssertBuild(project_path, properties);

            AssertThatLinkerDidNotExecute(result);
            var appExecutable = Path.Combine(appPath, Path.GetFileName(project_path));

            Assert.That(appPath, Does.Exist, "There is an .app");
            Assert.That(appExecutable, Does.Not.Empty, "There is no executable");
            Assert.That(Path.Combine(appPath, "Xamarin.iOS.dll"), Does.Exist, "Xamarin.iOS.dll is in the bundle");
        }
Esempio n. 7
0
        public void BuildFatMonoTouchTest(ApplePlatform platform, string runtimeIdentifiers, params string[] additionalProperties)
        {
            Configuration.IgnoreIfIgnoredPlatform(platform);

            var project_path = Path.Combine(Configuration.SourceRoot, "tests", "monotouch-test", "dotnet", platform.AsString(), "monotouch-test.csproj");

            Configuration.CopyDotNetSupportingFiles(Path.GetDirectoryName(Path.GetDirectoryName(project_path)));
            Configuration.CopyDotNetSupportingFiles(Path.Combine(Configuration.SourceRoot, "tests", "bindings-test", "dotnet"));
            Configuration.CopyDotNetSupportingFiles(Path.Combine(Configuration.SourceRoot, "tests", "bindings-test2", "dotnet"));
            Configuration.CopyDotNetSupportingFiles(Path.Combine(Configuration.SourceRoot, "tests", "EmbeddedResources", "dotnet"));
            Configuration.CopyDotNetSupportingFiles(Path.Combine(Configuration.SourceRoot, "tests", "fsharplibrary", "dotnet"));
            Configuration.CopyDotNetSupportingFiles(Path.Combine(Configuration.SourceRoot, "external", "Touch.Unit", "Touch.Client", "dotnet"));
            Clean(project_path);
            var properties = new Dictionary <string, string> (verbosity);

            properties ["RuntimeIdentifiers"] = runtimeIdentifiers;
            if (additionalProperties != null)
            {
                foreach (var prop in additionalProperties)
                {
                    var eq    = prop.IndexOf('=');
                    var name  = prop.Substring(0, eq);
                    var value = prop.Substring(eq + 1);
                    properties [name] = value;
                }
            }
            var result        = DotNet.AssertBuild(project_path, properties);
            var appPath       = Path.Combine(Path.GetDirectoryName(project_path), "bin", "Debug", platform.ToFramework(), "monotouchtest.app");
            var infoPlistPath = GetInfoPListPath(platform, appPath);

            Assert.That(infoPlistPath, Does.Exist, "Info.plist");
            var infoPlist = PDictionary.FromFile(infoPlistPath);

            Assert.AreEqual("com.xamarin.monotouch-test", infoPlist.GetString("CFBundleIdentifier").Value, "CFBundleIdentifier");
            Assert.AreEqual("MonoTouchTest", infoPlist.GetString("CFBundleDisplayName").Value, "CFBundleDisplayName");
        }
Esempio n. 8
0
        public void BuildMyCatalystApp(string runtimeIdentifier)
        {
            var platform     = ApplePlatform.MacCatalyst;
            var project_path = GetProjectPath("MyCatalystApp");

            Configuration.IgnoreIfIgnoredPlatform(platform);
            Clean(project_path);
            var properties = new Dictionary <string, string> (verbosity);

            properties ["RuntimeIdentifier"] = runtimeIdentifier;
            var result = DotNet.AssertBuild(project_path, properties);

            AssertThatLinkerExecuted(result);
            var appPath = Path.Combine(Path.GetDirectoryName(project_path), "bin", "Debug", "net6.0-maccatalyst", runtimeIdentifier, "MyCatalystApp.app");

            AssertAppContents(platform, appPath);
            var infoPlistPath = Path.Combine(appPath, "Contents", "Info.plist");
            var infoPlist     = PDictionary.FromFile(infoPlistPath);

            Assert.AreEqual("com.xamarin.mycatalystapp", infoPlist.GetString("CFBundleIdentifier").Value, "CFBundleIdentifier");
            Assert.AreEqual("MyCatalystApp", infoPlist.GetString("CFBundleDisplayName").Value, "CFBundleDisplayName");
            Assert.AreEqual("3.14", infoPlist.GetString("CFBundleVersion").Value, "CFBundleVersion");
            Assert.AreEqual("3.14", infoPlist.GetString("CFBundleShortVersionString").Value, "CFBundleShortVersionString");
        }
Esempio n. 9
0
        public void ArchiveTest(ApplePlatform platform, string runtimeIdentifiers)
        {
            var project = "MySimpleApp";

            Configuration.IgnoreIfIgnoredPlatform(platform);

            var project_path = GetProjectPath(project, platform: platform);

            Clean(project_path);
            var properties = GetDefaultProperties(runtimeIdentifiers);

            properties ["ArchiveOnBuild"] = "true";

            var result           = DotNet.AssertBuild(project_path, properties);
            var reader           = new BinLogReader();
            var records          = reader.ReadRecords(result.BinLogPath).ToList();
            var findString       = "Output Property: ArchiveDir";
            var archiveDirRecord = records.Where(v => v?.Args?.Message?.Contains(findString) == true).ToList();

            Assert.That(archiveDirRecord.Count, Is.GreaterThan(0), "ArchiveDir");
            var archiveDir = archiveDirRecord [0].Args.Message.Substring(findString.Length + 1).Trim();

            Assert.That(archiveDir, Does.Exist, "Archive directory existence");
        }
Esempio n. 10
0
        public void Build(ApplePlatform platform, string runtimeIdentifiers, CodeSignature signature, string configuration)
        {
            var project = "BundleStructure";

            Configuration.IgnoreIfIgnoredPlatform(platform);

            var project_path = GetProjectPath(project, runtimeIdentifiers: runtimeIdentifiers, platform: platform, out var appPath, configuration: configuration);
            var project_dir  = Path.GetDirectoryName(Path.GetDirectoryName(project_path)) !;

            Clean(project_path);

            var properties = GetDefaultProperties(runtimeIdentifiers);

            properties ["_IsAppSigned"] = signature != CodeSignature.None ? "true" : "false";
            if (!string.IsNullOrWhiteSpace(configuration))
            {
                properties ["Configuration"] = configuration;
            }
            var rv              = DotNet.AssertBuild(project_path, properties);
            var warnings        = BinLog.GetBuildLogWarnings(rv.BinLogPath).ToArray();
            var warningMessages = FilterWarnings(warnings);

            var isReleaseBuild   = string.Equals(configuration, "Release", StringComparison.OrdinalIgnoreCase);
            var platformString   = platform.AsString();
            var tfm              = platform.ToFramework();
            var testsDirectory   = Path.GetDirectoryName(Path.GetDirectoryName(project_dir));
            var expectedWarnings = new string [] {
                $"The 'PublishFolderType' metadata value 'Unknown' on the item '{project_dir}/{platformString}/SomewhatUnknownI.bin' is not recognized. The file will not be copied to the app bundle. If the file is not supposed to be copied to the app bundle, remove the 'CopyToOutputDirectory' metadata on the item.",
                $"The 'PublishFolderType' metadata value 'Unknown' on the item '{project_dir}/{platformString}/UnknownI.bin' is not recognized. The file will not be copied to the app bundle. If the file is not supposed to be copied to the app bundle, remove the 'CopyToOutputDirectory' metadata on the item.",
                $"The file '{project_dir}/{platformString}/NoneA.txt' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle.",
                $"The file '{project_dir}/{platformString}/NoneI.txt' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle.",
                $"The file '{project_dir}/{platformString}/NoneJ.txt' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle.",
                $"The file '{project_dir}/{platformString}/NoneK.txt' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle.",
                $"The file '{project_dir}/{platformString}/NoneM.unknown' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle.",
                $"The file '{project_dir}/{platformString}/Sub/NoneG.txt' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle.",
                $"The file '{project_dir}/NoneH.txt' does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle.",
            }.ToList();

            var rids = runtimeIdentifiers.Split(';');

            if (rids.Length > 1)
            {
                // All warnings show up twice if we're building for multiple architectures
                expectedWarnings.AddRange(expectedWarnings);
            }

            var zippedFrameworks = platform == ApplePlatform.MacCatalyst || platform == ApplePlatform.MacOSX;

            foreach (var rid in rids)
            {
                if (zippedFrameworks)
                {
                    expectedWarnings.Add($"The framework obj/{configuration}/{tfm}/{rid}/bindings-framework-test.resources.zip/XStaticObjectTest.framework is a framework of static libraries, and will not be copied to the app.");
                    expectedWarnings.Add($"The framework obj/{configuration}/{tfm}/{rid}/bindings-framework-test.resources.zip/XStaticArTest.framework is a framework of static libraries, and will not be copied to the app.");
                }
                else
                {
                    expectedWarnings.Add($"The framework {testsDirectory}/bindings-framework-test/dotnet/{platformString}/bin/{configuration}/{tfm}/bindings-framework-test.resources/XStaticObjectTest.framework is a framework of static libraries, and will not be copied to the app.");
                    expectedWarnings.Add($"The framework {testsDirectory}/bindings-framework-test/dotnet/{platformString}/bin/{configuration}/{tfm}/bindings-framework-test.resources/XStaticArTest.framework is a framework of static libraries, and will not be copied to the app.");
                }
            }

            if (signature == CodeSignature.None && (platform == ApplePlatform.MacCatalyst || platform == ApplePlatform.MacOSX))
            {
                expectedWarnings.Add($"Found files in the root directory of the app bundle. This will likely cause codesign to fail. Files:\nbin/{configuration}/{tfm}{(runtimeIdentifiers.IndexOf (';') >= 0 ? string.Empty : "/" + runtimeIdentifiers)}/BundleStructure.app/UnknownJ.bin");
            }

            // Sort the messages so that comparison against the expected array is faster
            expectedWarnings = expectedWarnings
                               .OrderBy(v => v)
                               .ToList();

            var appExecutable = GetNativeExecutable(platform, appPath);

            CheckAppBundleContents(platform, appPath, rids, signature, isReleaseBuild);
            CollectionAssert.AreEqual(expectedWarnings, warningMessages, "Warnings");
            ExecuteWithMagicWordAndAssert(platform, runtimeIdentifiers, appExecutable);

            // touch AppDelegate.cs, and rebuild should succeed and do the right thing
            var appDelegatePath = Path.Combine(project_dir, "AppDelegate.cs");

            Configuration.Touch(appDelegatePath);

            rv              = DotNet.AssertBuild(project_path, properties);
            warnings        = BinLog.GetBuildLogWarnings(rv.BinLogPath).ToArray();
            warningMessages = FilterWarnings(warnings);

            CheckAppBundleContents(platform, appPath, rids, signature, isReleaseBuild);
            CollectionAssert.AreEqual(expectedWarnings, warningMessages, "Warnings Rebuild 1");
            ExecuteWithMagicWordAndAssert(platform, runtimeIdentifiers, appExecutable);

            // remove the bin directory, and rebuild should succeed and do the right thing
            var binDirectory = Path.Combine(Path.GetDirectoryName(project_path) !, "bin");

            Directory.Delete(binDirectory, true);

            rv              = DotNet.AssertBuild(project_path, properties);
            warnings        = BinLog.GetBuildLogWarnings(rv.BinLogPath).ToArray();
            warningMessages = FilterWarnings(warnings);

            CheckAppBundleContents(platform, appPath, rids, signature, isReleaseBuild);
            CollectionAssert.AreEqual(expectedWarnings, warningMessages, "Warnings Rebuild 2");
            ExecuteWithMagicWordAndAssert(platform, runtimeIdentifiers, appExecutable);

            // a simple rebuild should succeed
            rv              = DotNet.AssertBuild(project_path, properties);
            warnings        = BinLog.GetBuildLogWarnings(rv.BinLogPath).ToArray();
            warningMessages = FilterWarnings(warnings);

            CheckAppBundleContents(platform, appPath, rids, signature, isReleaseBuild);
            CollectionAssert.AreEqual(expectedWarnings, warningMessages, "Warnings Rebuild 3");
            ExecuteWithMagicWordAndAssert(platform, runtimeIdentifiers, appExecutable);
        }
Esempio n. 11
0
 static ExecutionResult Dotnet(string project, string command, string target, Dictionary <string, string> properties)
 {
     return(DotNet.Execute(command, project, properties, assert_success: false));
 }
Esempio n. 12
0
        // [TestCase ("watchOS")] // No watchOS Touch.Client project for .NET yet
        // [TestCase ("macOS")] // No macOS Touch.Client project for .NET yet
        public void BuildInterdependentBindingProjects(string platform)
        {
            var assemblyName        = "interdependent-binding-projects";
            var dotnet_bindings_dir = Path.Combine(Configuration.SourceRoot, "tests", assemblyName, "dotnet");
            var project_dir         = Path.Combine(dotnet_bindings_dir, platform);
            var project_path        = Path.Combine(project_dir, $"{assemblyName}.csproj");

            Clean(project_path);
            Configuration.CopyDotNetSupportingFiles(dotnet_bindings_dir);
            Configuration.CopyDotNetSupportingFiles(dotnet_bindings_dir.Replace(assemblyName, "bindings-test"));
            Configuration.CopyDotNetSupportingFiles(dotnet_bindings_dir.Replace(assemblyName, "bindings-test2"));
            var cleanupSupportFiles = Configuration.CopyDotNetSupportingFiles(Path.Combine(Configuration.SourceRoot, "external", "Touch.Unit", "Touch.Client/dotnet"));

            try {
                var result = DotNet.AssertBuild(project_path, verbosity);
                var lines  = result.StandardOutput.ToString().Split('\n');
                // Find the resulting binding assembly from the build log
                var assemblies = lines.
                                 Select(v => v.Trim()).
                                 Where(v => {
                    if (v.Length < 10)
                    {
                        return(false);
                    }
                    if (v [0] != '/')
                    {
                        return(false);
                    }
                    if (!v.EndsWith($"{assemblyName}.dll", StringComparison.Ordinal))
                    {
                        return(false);
                    }
                    if (!v.Contains("/bin/", StringComparison.Ordinal))
                    {
                        return(false);
                    }
                    if (!v.Contains($"{assemblyName}.app", StringComparison.Ordinal))
                    {
                        return(false);
                    }
                    return(true);
                });
                Assert.That(assemblies, Is.Not.Empty, "Assemblies");
                // Make sure there's no other assembly confusing our logic
                assemblies = assemblies.Distinct();
                Assert.That(assemblies.Count(), Is.EqualTo(1), $"Unique assemblies: {string.Join (", ", assemblies)}");
                var asm = assemblies.First();
                Assert.That(asm, Does.Exist, "Assembly existence");

                // Verify that the resources
                var asmDir = Path.GetDirectoryName(asm);
                var ad     = AssemblyDefinition.ReadAssembly(asm, new ReaderParameters {
                    ReadingMode = ReadingMode.Deferred
                });
                Assert.That(ad.MainModule.Resources.Count, Is.EqualTo(0), "0 resources for interdependent-binding-projects.dll");

                var ad1 = AssemblyDefinition.ReadAssembly(Path.Combine(asmDir, "bindings-test.dll"), new ReaderParameters {
                    ReadingMode = ReadingMode.Deferred
                });
                Assert.That(ad1.MainModule.Resources.Count, Is.EqualTo(1), "1 resource for bindings-test.dll");
                Assert.That(ad1.MainModule.Resources [0].Name, Is.EqualTo("libtest.a"), "libtest.a - bindings-test.dll");

                var ad2 = AssemblyDefinition.ReadAssembly(Path.Combine(asmDir, "bindings-test2.dll"), new ReaderParameters {
                    ReadingMode = ReadingMode.Deferred
                });
                Assert.That(ad2.MainModule.Resources.Count, Is.EqualTo(1), "1 resource for bindings-test2.dll");
                Assert.That(ad2.MainModule.Resources [0].Name, Is.EqualTo("libtest2.a"), "libtest2.a - bindings-test2.dll");
            } finally {
                foreach (var file in cleanupSupportFiles)
                {
                    File.Delete(file);
                }
            }
        }
Esempio n. 13
0
        [TestCase(ApplePlatform.MacOSX, "osx-arm64;osx-x64")]          // https://github.com/xamarin/xamarin-macios/issues/12410
        public void AppWithResources(ApplePlatform platform, string runtimeIdentifiers)
        {
            var project = "AppWithResources";

            Configuration.IgnoreIfIgnoredPlatform(platform);

            var project_path = GetProjectPath(project, runtimeIdentifiers: runtimeIdentifiers, platform: platform, out var appPath);

            Clean(project_path);

            DotNet.AssertBuild(project_path, GetDefaultProperties(runtimeIdentifiers));

            var appExecutable = GetNativeExecutable(platform, appPath);

            ExecuteWithMagicWordAndAssert(platform, runtimeIdentifiers, appExecutable);

            var resourcesDirectory = GetResourcesDirectory(platform, appPath);

            var fontDirectory = resourcesDirectory;
            var fontAFile     = Path.Combine(fontDirectory, "A.ttc");
            var fontBFile     = Path.Combine(fontDirectory, "B.otf");
            var fontCFile     = Path.Combine(fontDirectory, "C.ttf");

            Assert.That(fontAFile, Does.Exist, "A.ttc existence");
            Assert.That(fontBFile, Does.Exist, "B.otf existence");
            Assert.That(fontCFile, Does.Exist, "C.ttf existence");

            var plist = PDictionary.FromFile(GetInfoPListPath(platform, appPath));

            switch (platform)
            {
            case ApplePlatform.iOS:
            case ApplePlatform.TVOS:
            case ApplePlatform.MacCatalyst:
                var uiAppFonts = plist.GetArray("UIAppFonts");
                Assert.IsNotNull(uiAppFonts, "UIAppFonts");
                Assert.AreEqual(1, uiAppFonts.Count, "UIAppFonts.Count");
                Assert.AreEqual("B.otf", ((PString)uiAppFonts [0]).Value, "UIAppFonts [0]");
                break;

            case ApplePlatform.MacOSX:
                var applicationFontsPath = plist.GetString("ATSApplicationFontsPath")?.Value;
                Assert.AreEqual(".", applicationFontsPath, "ATSApplicationFontsPath");
                break;

            default:
                throw new ArgumentOutOfRangeException($"Unknown platform: {platform}");
            }

            var assetsCar = Path.Combine(resourcesDirectory, "Assets.car");

            Assert.That(assetsCar, Does.Exist, "Assets.car");

            var mainStoryboard = Path.Combine(resourcesDirectory, "Main.storyboardc");

            Assert.That(mainStoryboard, Does.Exist, "Main.storyboardc");

            var scnAssetsDir = Path.Combine(resourcesDirectory, "art.scnassets");

            Assert.That(Path.Combine(scnAssetsDir, "scene.scn"), Does.Exist, "scene.scn");
            Assert.That(Path.Combine(scnAssetsDir, "texture.png"), Does.Exist, "texture.png");

            var colladaScene = Path.Combine(resourcesDirectory, "scene.dae");

            Assert.That(colladaScene, Does.Exist, "Collada - scene.dae");

            var atlasTexture = Path.Combine(resourcesDirectory, "Archer_Attack.atlasc", "Archer_Attack.plist");

            Assert.That(atlasTexture, Does.Exist, "AtlasTexture - Archer_Attack");

            var mlModel = Path.Combine(resourcesDirectory, "SqueezeNet.mlmodelc");

            Assert.That(mlModel, Does.Exist, "CoreMLModel");

            var arm64txt = Path.Combine(resourcesDirectory, "arm64.txt");
            var armtxt   = Path.Combine(resourcesDirectory, "arm.txt");
            var x64txt   = Path.Combine(resourcesDirectory, "x64.txt");

            Assert.AreEqual(runtimeIdentifiers.Split(';').Any(v => v.EndsWith("-arm64")), File.Exists(arm64txt), "arm64.txt");
            Assert.AreEqual(runtimeIdentifiers.Split(';').Any(v => v.EndsWith("-arm")), File.Exists(armtxt), "arm.txt");
            Assert.AreEqual(runtimeIdentifiers.Split(';').Any(v => v.EndsWith("-x64")), File.Exists(x64txt), "x64.txt");
        }