diff --git a/docs/build-apps/build-items.md b/docs/build-apps/build-items.md index e8f6b01fb402..ca29996cd0a2 100644 --- a/docs/build-apps/build-items.md +++ b/docs/build-apps/build-items.md @@ -9,6 +9,27 @@ ms.date: 09/19/2024 Build items control how .NET for iOS, Mac Catalyst, macOS, and tvOS application or library projects are built. +## AlternateAppIcon + +The `AlternateAppIcon` item group can be used to specify alternate app icons. + +The `Include` metadata must point to the filename of an `.appiconset` (for +iOS, macOS and Mac Catalyst) or `.imagestack` (for tvOS) image resource +inside an asset catalog. + +Example: + +```xml + + + + +``` + +See also: +* The [AppIcon](build-properties.md#AppIcon) property. +* The [IncludeAllAppIcons](build-properties.md#IncludeAllAppIcons) property. + ## PartialAppManifest `PartialAppManifest` can be used to add additional partial app manifests that diff --git a/docs/build-apps/build-properties.md b/docs/build-apps/build-properties.md index 9c3ae3030c6d..2f0a9f8358f4 100644 --- a/docs/build-apps/build-properties.md +++ b/docs/build-apps/build-properties.md @@ -11,12 +11,52 @@ MSBuild properties control the behavior of the They're specified within the project file, for example **MyApp.csproj**, within an MSBuild PropertyGroup. +## AppIcon + +The `AppIcon` item group can be used to specify an app icon for the app. + +The value of the property must point to the filename of an `.appiconset` (for +iOS, macOS and Mac Catalyst) or `.brandassets` (for tvOS) image resource +inside an asset catalog. + +Example: + +```xml + + + MyAppIcon + +``` + +See also: + +* The [AlternateAppIcon](build-items.md#AlternateAppIcon) item group. +* The [IncludeAllAppIcons](#IncludeAllAppIcons) property. + ## DittoPath The full path to the `ditto` executable. The default behavior is to use `/usr/bin/ditto`. +## IncludeAllAppIcons + +Set the `IncludeAllAppIcons` property to true to automatically include all app +icons from all asset catalogs in the app. + +Example: + +```xml + + true + +``` + +See also: + +* The [AlternateAppIcon](build-items.md#AlternateAppIcon) item group. +* The [AppIcon](#AppIcon) property. + ## MaciOSPrepareForBuildDependsOn A semi-colon delimited property that can be used to extend the build process. diff --git a/msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx b/msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx index ab219c061e30..c9f13aba3277 100644 --- a/msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx +++ b/msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx @@ -1576,6 +1576,40 @@ SupportedOSPlatformVersion: don't translate (it's the name of an MSBuild property) + + Can't find the AlternateAppIcon '{0}' among the image resources. There are {1} app icons in the image resources: {2}. + + * AlternateAppIcon: don't translate (it's the name of an MSBuild property) + * {1}: count of image resources + * {2}: comma separated list of resources. + + + + + The image resource '{0}' is specified as both 'AppIcon' and 'AlternateAppIcon'. + + * AppIcon: don't translate (it's the name of an MSBuild property) + * AlternateAppIcon: don't translate (it's the name of an MSBuild property) + + + + + Can't specify both 'XSAppIconAssets' in the Info.plist and 'AppIcon' in the project file. Please select one or the other. + + * XSAppIconAssets: don't translate (it's the name of an MSBuild property) + * AppIcon: don't translate (it's the name of an MSBuild property) + + + + + Can't find the AppIcon '{0}' among the image resources. There are {1} app icons in the image resources: {2}. + + * AppIcon: don't translate (it's the name of an MSBuild property) + * {1}: count of image resources + * {2}: comma separated list of resources. + + + The source '{0}' does not exist. {0}: path to a file or a directory diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/ACTool.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/ACTool.cs index 959bade4fed7..b28989bb725b 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/ACTool.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/ACTool.cs @@ -13,13 +13,18 @@ namespace Xamarin.MacDev.Tasks { public class ACTool : XcodeCompilerToolTask, ICancelableTask { - ITaskItem? partialAppManifest; string? outputSpecs; + string? partialAppManifestPath; #region Inputs public string AccentColor { get; set; } = string.Empty; + public ITaskItem [] AlternateAppIcons { get; set; } = Array.Empty (); + + // The name of an app icon + public string AppIcon { get; set; } = string.Empty; + public string DeviceModel { get; set; } = string.Empty; public string DeviceOSVersion { get; set; } = string.Empty; @@ -29,6 +34,8 @@ public class ACTool : XcodeCompilerToolTask, ICancelableTask { [Required] public ITaskItem [] ImageAssets { get; set; } = Array.Empty (); + public bool IncludeAllAppIcons { get; set; } + public bool IsWatchApp { get; set; } [Required] @@ -46,6 +53,11 @@ public class ACTool : XcodeCompilerToolTask, ICancelableTask { #endregion + // All the icons among the 'ImageAssets'. + HashSet appIconsInAssets = new (); // iOS, macOS and Mac Catalyst + HashSet brandAssetsInAssets = new (); // tvOS + HashSet imageStacksInAssets = new (); // tvOS + protected override string DefaultBinDir { get { return DeveloperRootBinDir; } } @@ -64,6 +76,11 @@ protected override void AppendCommandLineArguments (IDictionary { var assetDirs = new HashSet (items.Select (x => BundleResource.GetVirtualProjectPath (ProjectDir, x, !string.IsNullOrEmpty (SessionId)))); + if (!string.IsNullOrEmpty (XSAppIconAssets) && !string.IsNullOrEmpty (AppIcon)) { + Log.LogError (MSBStrings.E7129 /* Can't specify both 'XSAppIconAssets' in the Info.plist and 'AppIcon' in the project file. Please select one or the other. */); + return; + } + if (!string.IsNullOrEmpty (XSAppIconAssets)) { int index = XSAppIconAssets.IndexOf (".xcassets" + Path.DirectorySeparatorChar, StringComparison.Ordinal); string? assetDir = null; @@ -75,13 +92,6 @@ protected override void AppendCommandLineArguments (IDictionary if (assetDirs is not null && assetDir is not null && assetDirs.Contains (assetDir)) { var assetName = Path.GetFileNameWithoutExtension (rpath); - if (PartialAppManifest is null && partialAppManifest is not null) { - args.Add ("--output-partial-info-plist"); - args.AddQuoted (partialAppManifest.GetMetadata ("FullPath")); - - PartialAppManifest = partialAppManifest; - } - args.Add ("--app-icon"); args.AddQuoted (assetName); @@ -104,14 +114,6 @@ protected override void AppendCommandLineArguments (IDictionary if (assetDirs is not null && assetDir is not null && assetDirs.Contains (assetDir)) { var assetName = Path.GetFileNameWithoutExtension (rpath); - - if (PartialAppManifest is null && partialAppManifest is not null) { - args.Add ("--output-partial-info-plist"); - args.AddQuoted (partialAppManifest.GetMetadata ("FullPath")); - - PartialAppManifest = partialAppManifest; - } - args.Add ("--launch-image"); args.AddQuoted (assetName); } @@ -147,12 +149,57 @@ protected override void AppendCommandLineArguments (IDictionary foreach (var targetDevice in GetTargetDevices ()) args.Add ("--target-device", targetDevice); - args.Add ("--minimum-deployment-target", MinimumOSVersion); + if (!string.IsNullOrEmpty (MinimumOSVersion)) + args.Add ("--minimum-deployment-target", MinimumOSVersion); var platform = PlatformUtils.GetTargetPlatform (SdkPlatform, IsWatchApp); if (platform is not null) args.Add ("--platform", platform); + + if (!string.IsNullOrEmpty (AppIcon)) { + if (Platform == ApplePlatform.TVOS) { + if (!brandAssetsInAssets.Contains (AppIcon)) { + Log.LogError (MSBStrings.E7130 /* Can't find the AppIcon '{0}' among the image resources. There are {1} app icons in the image resources: {2} */, AppIcon, brandAssetsInAssets.Count, string.Join (", ", brandAssetsInAssets.OrderBy (v => v))); + return; + } + } else { + if (!appIconsInAssets.Contains (AppIcon)) { + Log.LogError (MSBStrings.E7130 /* Can't find the AppIcon '{0}' among the image resources. There are {1} app icons in the image resources: {2} */, AppIcon, appIconsInAssets.Count, string.Join (", ", appIconsInAssets.OrderBy (v => v))); + return; + } + } + args.Add ("--app-icon"); + args.AddQuoted (AppIcon); + } + + foreach (var alternate in AlternateAppIcons) { + var alternateAppIcon = alternate.ItemSpec!; + if (Platform == ApplePlatform.TVOS) { + if (!imageStacksInAssets.Contains (alternateAppIcon)) { + Log.LogError (MSBStrings.E7127 /* Can't find the AlternateAppIcon '{0}' among the image resources. There are {1} app icons in the image resources: {2}. */, alternateAppIcon, imageStacksInAssets.Count, string.Join (", ", imageStacksInAssets.OrderBy (v => v))); + return; + } + } else { + if (!appIconsInAssets.Contains (alternateAppIcon)) { + Log.LogError (MSBStrings.E7127 /* Can't find the AlternateAppIcon '{0}' among the image resources. There are {1} app icons in the image resources: {2}. */, alternateAppIcon, appIconsInAssets.Count, string.Join (", ", appIconsInAssets.OrderBy (v => v))); + return; + } + } + if (string.Equals (alternateAppIcon, AppIcon, StringComparison.OrdinalIgnoreCase)) { + Log.LogError (MSBStrings.E7128 /* The image resource '{0}' is specified as both 'AppIcon' and 'AlternateAppIcon'. */, AppIcon); + return; + } + // This doesn't seem to be necessary/applicable for tvOS (it also triggers a warning from actool) + args.Add ("--alternate-app-icon"); + args.AddQuoted (alternateAppIcon); + } + + if (IncludeAllAppIcons) + args.Add ("--include-all-app-icons"); + + args.Add ("--output-partial-info-plist"); + args.AddQuoted (Path.GetFullPath (partialAppManifestPath)); } IEnumerable GetCompiledBundleResources (PDictionary output, string intermediateBundleDir) @@ -309,6 +356,17 @@ public override bool Execute () var catalog = Path.GetDirectoryName (vpath); path = Path.GetDirectoryName (path); + if (Platform == ApplePlatform.TVOS) { + if (path.EndsWith (".imagestack", StringComparison.OrdinalIgnoreCase)) { + imageStacksInAssets.Add (Path.GetFileNameWithoutExtension (path)); + } else if (path.EndsWith (".brandassets", StringComparison.OrdinalIgnoreCase)) { + brandAssetsInAssets.Add (Path.GetFileNameWithoutExtension (path)); + } + } else { + if (path.EndsWith (".appiconset", StringComparison.OrdinalIgnoreCase)) + appIconsInAssets.Add (Path.GetFileNameWithoutExtension (path)); + } + // keep walking up the directory structure until we get to the .xcassets directory while (!string.IsNullOrEmpty (catalog) && Path.GetExtension (catalog) != ".xcassets") { catalog = Path.GetDirectoryName (catalog); @@ -391,7 +449,8 @@ public override bool Execute () return !Log.HasLoggedErrors; } - partialAppManifest = new TaskItem (Path.Combine (intermediate, "partial-info.plist")); + partialAppManifestPath = Path.Combine (intermediate, "partial-info.plist"); + PartialAppManifest = new TaskItem (partialAppManifestPath); if (specs.Count > 0) { outputSpecs = Path.Combine (intermediate, "output-specifications.plist"); @@ -400,12 +459,14 @@ public override bool Execute () Directory.CreateDirectory (intermediateBundleDir); - // Note: Compile() will set the PartialAppManifest property if it is used... if ((Compile (catalogs.ToArray (), intermediateBundleDir, manifest)) != 0) return false; - if (PartialAppManifest is not null && !File.Exists (PartialAppManifest.GetMetadata ("FullPath"))) - Log.LogError (MSBStrings.E0093, PartialAppManifest.GetMetadata ("FullPath")); + if (Log.HasLoggedErrors) + return false; + + if (!File.Exists (Path.GetFullPath (partialAppManifestPath))) + Log.LogError (MSBStrings.E0093, Path.GetFullPath (partialAppManifestPath)); try { var manifestOutput = PDictionary.FromFile (manifest.ItemSpec)!; diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeCompilerToolTask.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeCompilerToolTask.cs index bf7ad3bbfff3..4d7e3f67c256 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeCompilerToolTask.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeCompilerToolTask.cs @@ -232,6 +232,11 @@ protected int Compile (ITaskItem [] items, string output, ITaskItem manifest) args.AddQuoted (item.GetMetadata ("FullPath")); var arguments = args.ToList (); + + // don't bother executing the tool if we've already looged errors. + if (Log.HasLoggedErrors) + return 1; + var rv = ExecuteAsync (tool, arguments, sdkDevPath, environment: environment, mergeOutput: false).Result; var exitCode = rv.ExitCode; var messages = rv.StandardOutput!.ToString (); diff --git a/msbuild/Xamarin.Shared/Xamarin.Shared.targets b/msbuild/Xamarin.Shared/Xamarin.Shared.targets index b49381d49a4c..957b0314b859 100644 --- a/msbuild/Xamarin.Shared/Xamarin.Shared.targets +++ b/msbuild/Xamarin.Shared/Xamarin.Shared.targets @@ -910,12 +910,15 @@ Copyright (C) 2018 Microsoft. All rights reserved. ToolExe="$(ACToolExe)" ToolPath="$(ACToolPath)" AccentColor="$(AccentColor)" + AlternateAppIcons="@(AlternateAppIcon)" + AppIcon="$(AppIcon)" BundleIdentifier="$(_BundleIdentifier)" CLKComplicationGroup="$(_CLKComplicationGroup)" DeviceModel="$(TargetDeviceModel)" DeviceOSVersion="$(TargetDeviceOSVersion)" EnableOnDemandResources="$(EnableOnDemandResources)" ImageAssets="@(ImageAsset)" + IncludeAllAppIcons="$(IncludeAllAppIcons)" MinimumOSVersion="$(_MinimumOSVersion)" NSExtensionPointIdentifier="$(_NSExtensionPointIdentifier)" OptimizePNGs="$(OptimizePNGs)" diff --git a/tests/common/PListAsserts.cs b/tests/common/PListAsserts.cs new file mode 100644 index 000000000000..bd80c3b4e3da --- /dev/null +++ b/tests/common/PListAsserts.cs @@ -0,0 +1,124 @@ +using System; +using System.IO; +using System.Linq; + +using Xamarin.MacDev; +using Xamarin.Utils; + +using NUnit.Framework; + +#nullable enable + +namespace Xamarin.Tests { + public static class PListAsserts { + // Compare two plists, and assert if there are any differences. + public static void AreStringsEqual (string expectedXml, string actualXml, string? message = null) + { + if (string.Equals (expectedXml, actualXml, StringComparison.Ordinal)) + return; + + var expected = string.IsNullOrEmpty (expectedXml) ? new PDictionary () : PDictionary.FromString (expectedXml)!; + var actual = string.IsNullOrEmpty (actualXml) ? new PDictionary () : PDictionary.FromString (actualXml)!; + if (expected is not PDictionary expectedDictionary) + throw new InvalidOperationException ($"Root element for the expected plist isn't a dictionary"); + if (actual is not PDictionary actualDictionary) + throw new InvalidOperationException ($"Root element for the actual plist isn't a dictionary"); + AssertPDictionaryEqual (expectedXml, actualXml, expectedDictionary, actualDictionary, "", message); + } + + // Compare two plists, and assert if there are any differences. + public static void AreFilesEqual (string expectedXmlPath, string actualXmlPath, string? message = null) + { + Assert.That (expectedXmlPath, Does.Exist, message); + Assert.That (actualXmlPath, Does.Exist, message); + AreStringsEqual (File.ReadAllText (expectedXmlPath), File.ReadAllText (actualXmlPath), message); + } + + static void AssertPDictionaryEqual (string expectedXml, string actualXml, PDictionary expected, PDictionary actual, string key, string? message = null) + { + var expectedKeys = expected.Select (v => v.Key ?? string.Empty).OrderBy (v => v).ToArray (); + var actualKeys = actual.Select (v => v.Key ?? string.Empty).OrderBy (v => v).ToArray (); + if (expectedKeys.Length != actualKeys.Length) { + Assert.Fail ( + $"Expected {expectedKeys.Length} entries in 'dict' for key '{key}', got {actualKeys.Length} entries: {message}\n" + + $"\tExpected keys: {string.Join (", ", expectedKeys)}\n" + + $"\tActual keys: {string.Join (", ", actualKeys)}\n" + + $"\tExpected xml:\n" + + $"\t\t{expectedXml.Replace ("\n", "\n\t\t")}\n" + + $"\tActual xml:\n" + + $"\t\t{actualXml.Replace ("\n", "\n\t\t")}" + ); + return; + } + for (var i = 0; i < expectedKeys.Length; i++) { + if (expectedKeys [i] != actualKeys [i]) { + Assert.Fail ( + $"Expected key '{expectedKeys [i]}' in 'dict' for key '{key}', got key '{actualKeys [i]}': {message}\n" + + $"\tExpected xml:\n" + + $"\t\t{expectedXml.Replace ("\n", "\n\t\t")}\n" + + $"\tActual xml:\n" + + $"\t\t{actualXml.Replace ("\n", "\n\t\t")}" + ); + return; + } + var expectedValue = expected [expectedKeys [i]]!; + var actualValue = actual [actualKeys [i]]!; + AssertPObjectEqual (expectedXml, actualXml, expectedValue, actualValue, expectedKeys [i], message); + } + } + + static void AssertPArrayEqual (string expectedXml, string actualXml, PArray expected, PArray actual, string key, string? message = null) + { + if (expected.Count != actual.Count) { + Assert.Fail ( + $"Expected {expected.Count} items in 'array' for key '{key}', got {actual.Count} items: {message}\n" + + $"\tExpected xml:\n" + + $"\t\t{expectedXml.Replace ("\n", "\n\t\t")}\n" + + $"\tActual xml:\n" + + $"\t\t{actualXml.Replace ("\n", "\n\t\t")}" + ); + return; + } + for (var i = 0; i < expected.Count; i++) { + AssertPObjectEqual (expectedXml, actualXml, expected [i], actual [i], key, message); + } + } + + static void AssertPStringEqual (string expectedXml, string actualXml, PString expected, PString actual, string key, string? message = null) + { + if (expected.Value != actual.Value) { + Assert.Fail ( + $"Expected string of value '{expected.Value}' for key '{key}', got string of value '{actual.Value}': {message}\n" + + $"\tExpected xml:\n" + + $"\t\t{expectedXml.Replace ("\n", "\n\t\t")}\n" + + $"\tActual xml:\n" + + $"\t\t{actualXml.Replace ("\n", "\n\t\t")}" + ); + } + } + + static void AssertPObjectEqual (string expectedXml, string actualXml, PObject expected, PObject actual, string key, string? message = null) + { + if (expected.GetType () != actual.GetType ()) { + Assert.Fail ( + $"Expected item of type '{expected.GetType ().Name}' for key '{key}', got item of type '{actual.GetType ()}': {message}\n" + + $"\tExpected xml:\n" + + $"\t\t{expectedXml.Replace ("\n", "\n\t\t")}\n" + + $"\tActual xml:\n" + + $"\t\t{actualXml.Replace ("\n", "\n\t\t")}" + ); + return; + } + + if (expected is PDictionary expectedDictionary) { + AssertPDictionaryEqual (expectedXml, actualXml, expectedDictionary, (PDictionary) actual, key, message); + } else if (expected is PString expectedString) { + AssertPStringEqual (expectedXml, actualXml, expectedString, (PString) actual, key, message); + } else if (expected is PArray expectedArray) { + AssertPArrayEqual (expectedXml, actualXml, expectedArray, (PArray) actual, key, message); + } else { + throw new NotImplementedException ($"Comparing PList objects of type {expected.GetType ().Name}"); + } + } + } +} diff --git a/tests/dotnet/AppWithXCAssets/AppDelegate.cs b/tests/dotnet/AppWithXCAssets/AppDelegate.cs index db627351190b..a6edee7af51c 100644 --- a/tests/dotnet/AppWithXCAssets/AppDelegate.cs +++ b/tests/dotnet/AppWithXCAssets/AppDelegate.cs @@ -1,17 +1,97 @@ using System; using System.Runtime.InteropServices; +using System.Threading.Tasks; +using CoreGraphics; using Foundation; -namespace MySimpleApp { +#if !__MACOS__ +using UIKit; +#endif + +#nullable enable + +namespace AppWithXCAssets { +#if !(__MACCATALYST__ || __MACOS__) + public class AppDelegate : UIApplicationDelegate { + UIWindow? window; + UIButton? button; + UIColor blue = UIColor.FromRGB (31, 174, 206); + UIColor green = UIColor.FromRGB (119, 187, 65); + + public override bool FinishedLaunching (UIApplication app, NSDictionary options) + { + window = new UIWindow (UIScreen.MainScreen.Bounds); + + var dvc = new UIViewController (); + var bounds = window.Bounds; + button = new UIButton (window.Bounds); + button.SetTitleColor (blue, UIControlState.Normal); + button.SetTitle ("Switch icon!", UIControlState.Normal); + dvc.Add (button); + + window.RootViewController = dvc; + window.MakeKeyAndVisible (); + + ScheduleIconSwitching (); + + return true; + } + + void ScheduleIconSwitching () + { + NSTimer.CreateScheduledTimer (TimeSpan.FromSeconds (1), async (v) => { + Console.WriteLine ($"Starting icon switching!"); + await SwitchIcon (); + }); + } + + async Task SwitchIcon () + { + await Task.Delay (1000); // wait a bit, otherwise it doesn't work + + var supportsAlternateIcons = UIApplication.SharedApplication.SupportsAlternateIcons; + if (!supportsAlternateIcons) + Console.WriteLine ("Alternate icons aren't currently supported, but trying anyway!"); + + string? name; + UIColor color; + if (!string.IsNullOrEmpty (UIApplication.SharedApplication.AlternateIconName)) { + Console.WriteLine ($"Switching back to blue icon..."); + name = null; // switch back + color = blue; + } else { + Console.WriteLine ($"Switching to alternate green icon..."); + name = "AlternateAppIcons"; // switch + color = green; + } + + UIApplication.SharedApplication.SetAlternateIconName (name, (err) => { + if (err is null) { + Console.WriteLine ($"Switched to {(name is null ? "original icon" : $"alternate icon {name}")}"); + button!.SetTitleColor (color, UIControlState.Normal); + ScheduleIconSwitching (); + } else { + Console.WriteLine ($"Failed to switch icon : {err}"); + } + }); + } + } +#endif + public class Program { static int Main (string [] args) { +#if __MACCATALYST__ || __MACOS__ GC.KeepAlive (typeof (NSObject)); // prevent linking away the platform assembly Console.WriteLine (Environment.GetEnvironmentVariable ("MAGIC_WORD")); return args.Length; +#else + UIApplication.Main (args, null, typeof (AppDelegate)); + return 0; +#endif } } } diff --git a/tests/dotnet/AppWithXCAssets/MacCatalyst/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/MacCatalyst/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json index 60cce20c2b25..6bd21396edd3 100644 --- a/tests/dotnet/AppWithXCAssets/MacCatalyst/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +++ b/tests/dotnet/AppWithXCAssets/MacCatalyst/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -6,7 +6,7 @@ "scale" : "1x" }, { - "filename" : "Icon400x240 1.png", + "filename" : "Icon400x240.png", "idiom" : "tv", "scale" : "2x" } diff --git a/tests/dotnet/AppWithXCAssets/MacCatalyst/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/MacCatalyst/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json index 60cce20c2b25..6bd21396edd3 100644 --- a/tests/dotnet/AppWithXCAssets/MacCatalyst/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +++ b/tests/dotnet/AppWithXCAssets/MacCatalyst/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -6,7 +6,7 @@ "scale" : "1x" }, { - "filename" : "Icon400x240 1.png", + "filename" : "Icon400x240.png", "idiom" : "tv", "scale" : "2x" } diff --git a/tests/dotnet/AppWithXCAssets/MacCatalyst/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/MacCatalyst/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json index 60cce20c2b25..6bd21396edd3 100644 --- a/tests/dotnet/AppWithXCAssets/MacCatalyst/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +++ b/tests/dotnet/AppWithXCAssets/MacCatalyst/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -6,7 +6,7 @@ "scale" : "1x" }, { - "filename" : "Icon400x240 1.png", + "filename" : "Icon400x240.png", "idiom" : "tv", "scale" : "2x" } diff --git a/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json index 60cce20c2b25..6bd21396edd3 100644 --- a/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +++ b/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -6,7 +6,7 @@ "scale" : "1x" }, { - "filename" : "Icon400x240 1.png", + "filename" : "Icon400x240.png", "idiom" : "tv", "scale" : "2x" } diff --git a/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Icon400x240 1.png b/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Icon400x240 1.png deleted file mode 100644 index f558229e8eac..000000000000 Binary files a/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Icon400x240 1.png and /dev/null differ diff --git a/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json index 60cce20c2b25..6bd21396edd3 100644 --- a/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +++ b/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -6,7 +6,7 @@ "scale" : "1x" }, { - "filename" : "Icon400x240 1.png", + "filename" : "Icon400x240.png", "idiom" : "tv", "scale" : "2x" } diff --git a/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Icon400x240 1.png b/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Icon400x240 1.png deleted file mode 100644 index f558229e8eac..000000000000 Binary files a/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Icon400x240 1.png and /dev/null differ diff --git a/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json index 60cce20c2b25..6bd21396edd3 100644 --- a/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +++ b/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -6,7 +6,7 @@ "scale" : "1x" }, { - "filename" : "Icon400x240 1.png", + "filename" : "Icon400x240.png", "idiom" : "tv", "scale" : "2x" } diff --git a/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Icon400x240 1.png b/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Icon400x240 1.png deleted file mode 100644 index f558229e8eac..000000000000 Binary files a/tests/dotnet/AppWithXCAssets/iOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Icon400x240 1.png and /dev/null differ diff --git a/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json index 60cce20c2b25..6bd21396edd3 100644 --- a/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +++ b/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -6,7 +6,7 @@ "scale" : "1x" }, { - "filename" : "Icon400x240 1.png", + "filename" : "Icon400x240.png", "idiom" : "tv", "scale" : "2x" } diff --git a/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Icon400x240 1.png b/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Icon400x240 1.png deleted file mode 100644 index f558229e8eac..000000000000 Binary files a/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Icon400x240 1.png and /dev/null differ diff --git a/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json index 60cce20c2b25..6bd21396edd3 100644 --- a/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +++ b/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -6,7 +6,7 @@ "scale" : "1x" }, { - "filename" : "Icon400x240 1.png", + "filename" : "Icon400x240.png", "idiom" : "tv", "scale" : "2x" } diff --git a/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Icon400x240 1.png b/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Icon400x240 1.png deleted file mode 100644 index f558229e8eac..000000000000 Binary files a/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Icon400x240 1.png and /dev/null differ diff --git a/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json index 60cce20c2b25..6bd21396edd3 100644 --- a/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +++ b/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -6,7 +6,7 @@ "scale" : "1x" }, { - "filename" : "Icon400x240 1.png", + "filename" : "Icon400x240.png", "idiom" : "tv", "scale" : "2x" } diff --git a/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Icon400x240 1.png b/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Icon400x240 1.png deleted file mode 100644 index f558229e8eac..000000000000 Binary files a/tests/dotnet/AppWithXCAssets/macOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Icon400x240 1.png and /dev/null differ diff --git a/tests/dotnet/AppWithXCAssets/shared.csproj b/tests/dotnet/AppWithXCAssets/shared.csproj index 02bb2b27bf31..f61a8ba700db 100644 --- a/tests/dotnet/AppWithXCAssets/shared.csproj +++ b/tests/dotnet/AppWithXCAssets/shared.csproj @@ -5,10 +5,16 @@ AppWithXCAssets com.xamarin.appwithxcassets + + true + + AppIcons + + @@ -27,6 +33,11 @@ + + + + + diff --git a/tests/dotnet/AppWithXCAssets/shared.mk b/tests/dotnet/AppWithXCAssets/shared.mk index f555cad4e805..521c88650b37 100644 --- a/tests/dotnet/AppWithXCAssets/shared.mk +++ b/tests/dotnet/AppWithXCAssets/shared.mk @@ -1,2 +1,3 @@ TOP=../../../.. +TESTNAME=AppWithXCAssets include $(TOP)/tests/common/shared-dotnet.mk diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Back.imagestacklayer/Content.imageset/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Back.imagestacklayer/Content.imageset/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Back.imagestacklayer/Content.imageset/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Back.imagestacklayer/Content.imageset/Icon-green-400x240.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Back.imagestacklayer/Content.imageset/Icon-green-400x240.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Back.imagestacklayer/Content.imageset/Icon-green-400x240.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Back.imagestacklayer/Content.imageset/Icon-green-400x240.png diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Back.imagestacklayer/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Back.imagestacklayer/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Back.imagestacklayer/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Back.imagestacklayer/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Front.imagestacklayer/Content.imageset/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Front.imagestacklayer/Content.imageset/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Front.imagestacklayer/Content.imageset/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Front.imagestacklayer/Content.imageset/Icon-green-400x240.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Front.imagestacklayer/Content.imageset/Icon-green-400x240.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Front.imagestacklayer/Content.imageset/Icon-green-400x240.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Front.imagestacklayer/Content.imageset/Icon-green-400x240.png diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Front.imagestacklayer/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Front.imagestacklayer/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Front.imagestacklayer/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Front.imagestacklayer/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Middle.imagestacklayer/Content.imageset/Icon-green-400x240.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Middle.imagestacklayer/Content.imageset/Icon-green-400x240.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Middle.imagestacklayer/Content.imageset/Icon-green-400x240.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Middle.imagestacklayer/Content.imageset/Icon-green-400x240.png diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Middle.imagestacklayer/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Middle.imagestacklayer/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Middle.imagestacklayer/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateAppIcons.imagestack/Middle.imagestacklayer/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Back.imagestacklayer/Content.imageset/Contents.json similarity index 71% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Back.imagestacklayer/Content.imageset/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Back.imagestacklayer/Content.imageset/Contents.json index d23b1e0950ae..08ef43149272 100644 --- a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +++ b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "Icon-green-1280x768.png", + "filename" : "Icon1280x768.png", "idiom" : "tv" } ], diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Back.imagestacklayer/Content.imageset/Icon-green-1280x768.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Back.imagestacklayer/Content.imageset/Icon1280x768.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Back.imagestacklayer/Content.imageset/Icon-green-1280x768.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Back.imagestacklayer/Content.imageset/Icon1280x768.png diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Back.imagestacklayer/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Back.imagestacklayer/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Back.imagestacklayer/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Back.imagestacklayer/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Front.imagestacklayer/Content.imageset/Contents.json similarity index 71% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Front.imagestacklayer/Content.imageset/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Front.imagestacklayer/Content.imageset/Contents.json index d23b1e0950ae..08ef43149272 100644 --- a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +++ b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "Icon-green-1280x768.png", + "filename" : "Icon1280x768.png", "idiom" : "tv" } ], diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Front.imagestacklayer/Content.imageset/Icon-green-1280x768.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Front.imagestacklayer/Content.imageset/Icon1280x768.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Front.imagestacklayer/Content.imageset/Icon-green-1280x768.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Front.imagestacklayer/Content.imageset/Icon1280x768.png diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Front.imagestacklayer/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Front.imagestacklayer/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Front.imagestacklayer/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Front.imagestacklayer/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json similarity index 71% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json index d23b1e0950ae..08ef43149272 100644 --- a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +++ b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "Icon-green-1280x768.png", + "filename" : "Icon1280x768.png", "idiom" : "tv" } ], diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Middle.imagestacklayer/Content.imageset/Icon-green-1280x768.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Middle.imagestacklayer/Content.imageset/Icon1280x768.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons-AppStore.imagestack/Middle.imagestacklayer/Content.imageset/Icon-green-1280x768.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Middle.imagestacklayer/Content.imageset/Icon1280x768.png diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Middle.imagestacklayer/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Middle.imagestacklayer/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AlternateAppIcons.imagestack/Middle.imagestacklayer/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon-AppStore.imagestack/Middle.imagestacklayer/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000000..6bd21396edd3 --- /dev/null +++ b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "filename" : "Icon400x240.png", + "idiom" : "tv", + "scale" : "1x" + }, + { + "filename" : "Icon400x240.png", + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/tests/dotnet/AppWithXCAssets/MacCatalyst/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Icon400x240 1.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Icon400x240.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/MacCatalyst/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Icon400x240 1.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Content.imageset/Icon400x240.png diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Back.imagestacklayer/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Back.imagestacklayer/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Back.imagestacklayer/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000000..6bd21396edd3 --- /dev/null +++ b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "filename" : "Icon400x240.png", + "idiom" : "tv", + "scale" : "1x" + }, + { + "filename" : "Icon400x240.png", + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/tests/dotnet/AppWithXCAssets/MacCatalyst/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Icon400x240 1.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Icon400x240.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/MacCatalyst/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Icon400x240 1.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Content.imageset/Icon400x240.png diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Front.imagestacklayer/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Front.imagestacklayer/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Front.imagestacklayer/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000000..6bd21396edd3 --- /dev/null +++ b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "filename" : "Icon400x240.png", + "idiom" : "tv", + "scale" : "1x" + }, + { + "filename" : "Icon400x240.png", + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/tests/dotnet/AppWithXCAssets/MacCatalyst/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Icon400x240 1.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Icon400x240.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/MacCatalyst/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Icon400x240 1.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Content.imageset/Icon400x240.png diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Middle.imagestacklayer/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Middle.imagestacklayer/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/AppIcon.imagestack/Middle.imagestacklayer/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/Contents.json index fdec44822147..9b55b2086ce6 100644 --- a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/Contents.json +++ b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AlternateBrandAssets.brandassets/Contents.json @@ -1,13 +1,13 @@ { "assets" : [ { - "filename" : "AlternateAppIcons-AppStore.imagestack", + "filename" : "AppIcon-AppStore.imagestack", "idiom" : "tv", "role" : "primary-app-icon", "size" : "1280x768" }, { - "filename" : "AlternateAppIcons.imagestack", + "filename" : "AppIcon.imagestack", "idiom" : "tv", "role" : "primary-app-icon", "size" : "400x240" diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Back.imagestacklayer/Content.imageset/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Back.imagestacklayer/Content.imageset/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Back.imagestacklayer/Content.imageset/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Back.imagestacklayer/Content.imageset/Icon-blue-1280x768.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Back.imagestacklayer/Content.imageset/Icon-blue-1280x768.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Back.imagestacklayer/Content.imageset/Icon-blue-1280x768.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Back.imagestacklayer/Content.imageset/Icon-blue-1280x768.png diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Back.imagestacklayer/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Back.imagestacklayer/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Back.imagestacklayer/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Back.imagestacklayer/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Front.imagestacklayer/Content.imageset/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Front.imagestacklayer/Content.imageset/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Front.imagestacklayer/Content.imageset/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Front.imagestacklayer/Content.imageset/Icon-blue-1280x768.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Front.imagestacklayer/Content.imageset/Icon-blue-1280x768.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Front.imagestacklayer/Content.imageset/Icon-blue-1280x768.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Front.imagestacklayer/Content.imageset/Icon-blue-1280x768.png diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Front.imagestacklayer/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Front.imagestacklayer/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Front.imagestacklayer/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Front.imagestacklayer/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Middle.imagestacklayer/Content.imageset/Icon-blue-1280x768.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Middle.imagestacklayer/Content.imageset/Icon-blue-1280x768.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons-AppStore.imagestack/Middle.imagestacklayer/Content.imageset/Icon-blue-1280x768.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Middle.imagestacklayer/Content.imageset/Icon-blue-1280x768.png diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Middle.imagestacklayer/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Middle.imagestacklayer/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Middle.imagestacklayer/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons-AppStore.imagestack/Middle.imagestacklayer/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Back.imagestacklayer/Content.imageset/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Back.imagestacklayer/Content.imageset/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Back.imagestacklayer/Content.imageset/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Back.imagestacklayer/Content.imageset/Icon-blue-400x240.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Back.imagestacklayer/Content.imageset/Icon-blue-400x240.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Back.imagestacklayer/Content.imageset/Icon-blue-400x240.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Back.imagestacklayer/Content.imageset/Icon-blue-400x240.png diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Back.imagestacklayer/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 000000000000..73c00596a7fc --- /dev/null +++ b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Contents.json new file mode 100644 index 000000000000..de59d885ae8d --- /dev/null +++ b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Contents.json @@ -0,0 +1,17 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Middle.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ] +} diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Front.imagestacklayer/Content.imageset/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Front.imagestacklayer/Content.imageset/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Front.imagestacklayer/Content.imageset/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Front.imagestacklayer/Content.imageset/Icon-blue-400x240.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Front.imagestacklayer/Content.imageset/Icon-blue-400x240.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Front.imagestacklayer/Content.imageset/Icon-blue-400x240.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Front.imagestacklayer/Content.imageset/Icon-blue-400x240.png diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Front.imagestacklayer/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 000000000000..73c00596a7fc --- /dev/null +++ b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Middle.imagestacklayer/Content.imageset/Icon-blue-400x240.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Middle.imagestacklayer/Content.imageset/Icon-blue-400x240.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/AppIcons.imagestack/Middle.imagestacklayer/Content.imageset/Icon-blue-400x240.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Middle.imagestacklayer/Content.imageset/Icon-blue-400x240.png diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Middle.imagestacklayer/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Middle.imagestacklayer/Contents.json new file mode 100644 index 000000000000..73c00596a7fc --- /dev/null +++ b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/AppIcons.imagestack/Middle.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/TopShelfImage.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/TopShelfImage.imageset/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/TopShelfImage.imageset/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/TopShelfImage.imageset/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/TopShelfImage.imageset/Icon-blue-1920x720.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/TopShelfImage.imageset/Icon-blue-1920x720.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/TopShelfImage.imageset/Icon-blue-1920x720.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/TopShelfImage.imageset/Icon-blue-1920x720.png diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/TopShelfImage.imageset/Icon-blue-3840x1440.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/TopShelfImage.imageset/Icon-blue-3840x1440.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/TopShelfImage.imageset/Icon-blue-3840x1440.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/TopShelfImage.imageset/Icon-blue-3840x1440.png diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/TopShelfImageWide.imageset/Contents.json b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/TopShelfImageWide.imageset/Contents.json similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/TopShelfImageWide.imageset/Contents.json rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/TopShelfImageWide.imageset/Contents.json diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/TopShelfImageWide.imageset/Icon-blue-2320x720.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/TopShelfImageWide.imageset/Icon-blue-2320x720.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/TopShelfImageWide.imageset/Icon-blue-2320x720.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/TopShelfImageWide.imageset/Icon-blue-2320x720.png diff --git a/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/TopShelfImageWide.imageset/Icon-blue-4640x1440.png b/tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/TopShelfImageWide.imageset/Icon-blue-4640x1440.png similarity index 100% rename from tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/BrandAssets.brandassets/TopShelfImageWide.imageset/Icon-blue-4640x1440.png rename to tests/dotnet/AppWithXCAssets/tvOS/Resources/Images.xcassets/AppIcons.brandassets/TopShelfImageWide.imageset/Icon-blue-4640x1440.png diff --git a/tests/dotnet/UnitTests/AppIconTest.cs b/tests/dotnet/UnitTests/AppIconTest.cs new file mode 100644 index 000000000000..8b592b136075 --- /dev/null +++ b/tests/dotnet/UnitTests/AppIconTest.cs @@ -0,0 +1,642 @@ +#define EXHAUSTIVE_TESTS + +using System.Diagnostics.CodeAnalysis; +using System.Text.Json; + +#nullable enable + +namespace Xamarin.Tests { + public class AppIconTest : TestBaseClass { + [TestCase (ApplePlatform.iOS, "iossimulator-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.iOS, "ios-arm64")] +#endif + [TestCase (ApplePlatform.TVOS, "tvossimulator-x64")] + [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-arm64;maccatalyst-x64")] +#endif + [TestCase (ApplePlatform.MacOSX, "osx-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.MacOSX, "osx-arm64;osx-x64")] +#endif + public void DefaultValues (ApplePlatform platform, string runtimeIdentifiers) + { + var expectedAssets = new HashSet (); + switch (platform) { + case ApplePlatform.iOS: + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("Image:Icon64.png"); + break; + case ApplePlatform.TVOS: + expectedAssets.Add ("Image:Icon-green-400x240.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("Image:ZZZZFlattenedImage-1.1.0-gamut0"); + expectedAssets.Add ("Image:ZZZZFlattenedImage-2.1.0-gamut0"); + expectedAssets.Add ("Image:ZZZZRadiosityImage-1.0.0"); + expectedAssets.Add ("Image:ZZZZRadiosityImage-2.0.0"); + expectedAssets.Add ("ImageStack:AlternateAppIcons"); + break; + case ApplePlatform.MacOSX: + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + break; + case ApplePlatform.MacCatalyst: + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + break; + default: + throw new ArgumentOutOfRangeException ($"Unknown platform: {platform}"); + } + + TestXCAssetsImpl (platform, runtimeIdentifiers, extraAssets: expectedAssets.ToArray ()); + } + + [TestCase (ApplePlatform.iOS, "iossimulator-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.iOS, "ios-arm64")] + [TestCase (ApplePlatform.TVOS, "tvos-arm64")] +#endif + [TestCase (ApplePlatform.TVOS, "tvossimulator-x64")] + [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-arm64;maccatalyst-x64")] +#endif + [TestCase (ApplePlatform.MacOSX, "osx-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.MacOSX, "osx-arm64;osx-x64")] +#endif + public void IncludeAllIcons (ApplePlatform platform, string runtimeIdentifiers) + { + var expectedAssets = new HashSet (); + switch (platform) { + case ApplePlatform.iOS: + expectedAssets.Add ("Icon Image:Icon1024.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("Image:Icon64.png"); + expectedAssets.Add ("MultiSized Image:AlternateAppIcons"); + expectedAssets.Add ("MultiSized Image:AppIcons"); + break; + case ApplePlatform.TVOS: + expectedAssets.Add ("Image:Icon-green-400x240.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("Image:ZZZZFlattenedImage-1.1.0-gamut0"); + expectedAssets.Add ("Image:ZZZZFlattenedImage-2.1.0-gamut0"); + expectedAssets.Add ("Image:ZZZZRadiosityImage-1.0.0"); + expectedAssets.Add ("Image:ZZZZRadiosityImage-2.0.0"); + expectedAssets.Add ("ImageStack:AlternateAppIcons"); + break; + case ApplePlatform.MacOSX: + expectedAssets.Add ("Icon Image:Icon1024.png"); + expectedAssets.Add ("Icon Image:Icon128.png"); + expectedAssets.Add ("Icon Image:Icon16.png"); + expectedAssets.Add ("Icon Image:Icon256.png"); + expectedAssets.Add ("Icon Image:Icon32.png"); + expectedAssets.Add ("Icon Image:Icon512.png"); + expectedAssets.Add ("Icon Image:Icon64.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("MultiSized Image:AlternateAppIcons"); + expectedAssets.Add ("MultiSized Image:AppIcons"); + expectedAssets.Add ("PackedImage:ZZZZPackedAsset-1.1.0-gamut0"); + expectedAssets.Add ("PackedImage:ZZZZPackedAsset-2.1.0-gamut0"); + break; + case ApplePlatform.MacCatalyst: + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + break; + default: + throw new ArgumentOutOfRangeException ($"Unknown platform: {platform}"); + } + + TestXCAssetsImpl ( + platform, + runtimeIdentifiers, + new Dictionary () { { "IncludeAllAppIcons", "true" } }, + extraAssets: expectedAssets.ToArray ()); + } + + [TestCase (ApplePlatform.iOS, "iossimulator-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.iOS, "ios-arm64")] + [TestCase (ApplePlatform.TVOS, "tvos-arm64")] +#endif + [TestCase (ApplePlatform.TVOS, "tvossimulator-x64")] + [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-arm64;maccatalyst-x64")] +#endif + [TestCase (ApplePlatform.MacOSX, "osx-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.MacOSX, "osx-arm64;osx-x64")] +#endif + public void XSAppIconAssets (ApplePlatform platform, string runtimeIdentifiers) + { + var expectedAssets = new HashSet (); + switch (platform) { + case ApplePlatform.iOS: + expectedAssets.Add ("Icon Image:Icon1024.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("Image:Icon64.png"); + expectedAssets.Add ("MultiSized Image:AlternateAppIcons"); + break; + case ApplePlatform.TVOS: + expectedAssets.Add ("Image:Icon-green-400x240.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("Image:ZZZZFlattenedImage-1.1.0-gamut0"); + expectedAssets.Add ("Image:ZZZZFlattenedImage-2.1.0-gamut0"); + expectedAssets.Add ("Image:ZZZZRadiosityImage-1.0.0"); + expectedAssets.Add ("Image:ZZZZRadiosityImage-2.0.0"); + expectedAssets.Add ("ImageStack:AlternateAppIcons"); + break; + case ApplePlatform.MacOSX: + expectedAssets.Add ("Icon Image:Icon1024.png"); + expectedAssets.Add ("Icon Image:Icon128.png"); + expectedAssets.Add ("Icon Image:Icon16.png"); + expectedAssets.Add ("Icon Image:Icon256.png"); + expectedAssets.Add ("Icon Image:Icon32.png"); + expectedAssets.Add ("Icon Image:Icon512.png"); + expectedAssets.Add ("Icon Image:Icon64.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("MultiSized Image:AlternateAppIcons"); + expectedAssets.Add ("PackedImage:ZZZZPackedAsset-1.1.0-gamut0"); + expectedAssets.Add ("PackedImage:ZZZZPackedAsset-2.1.0-gamut0"); + break; + case ApplePlatform.MacCatalyst: + expectedAssets.Add ("Icon Image:Icon1024.png"); + expectedAssets.Add ("Icon Image:Icon128.png"); + expectedAssets.Add ("Icon Image:Icon16.png"); + expectedAssets.Add ("Icon Image:Icon256.png"); + expectedAssets.Add ("Icon Image:Icon32.png"); + expectedAssets.Add ("Icon Image:Icon512.png"); + expectedAssets.Add ("Icon Image:Icon64.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("MultiSized Image:AlternateAppIcons"); + expectedAssets.Add ("PackedImage:ZZZZPackedAsset-1.1.0-gamut0"); + expectedAssets.Add ("PackedImage:ZZZZPackedAsset-2.1.0-gamut0"); + break; + default: + throw new ArgumentOutOfRangeException ($"Unknown platform: {platform}"); + } + + TestXCAssetsImpl ( + platform, + runtimeIdentifiers, + new Dictionary () { + { "_XSAppIconAssets", "Resources/Images.xcassets/AlternateAppIcons.appiconset" } + }, + expectedAssets.ToArray ()); + } + + [TestCase (ApplePlatform.iOS, "iossimulator-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.TVOS, "tvos-arm64")] + [TestCase (ApplePlatform.TVOS, "tvossimulator-x64")] +#endif + // launch images don't exist on Mac Catalyst or macOS. + public void XSLaunchImageAssets (ApplePlatform platform, string runtimeIdentifiers) + { + var expectedAssets = new HashSet (); + switch (platform) { + case ApplePlatform.iOS: + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("Image:Icon64.png"); + break; + case ApplePlatform.TVOS: + expectedAssets.Add ("Image:Icon-green-400x240.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon1920x1080.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("Image:Icon3840x2160.png"); + expectedAssets.Add ("Image:ZZZZFlattenedImage-1.1.0-gamut0"); + expectedAssets.Add ("Image:ZZZZFlattenedImage-2.1.0-gamut0"); + expectedAssets.Add ("Image:ZZZZRadiosityImage-1.0.0"); + expectedAssets.Add ("Image:ZZZZRadiosityImage-2.0.0"); + expectedAssets.Add ("ImageStack:AlternateAppIcons"); + break; + default: + throw new ArgumentOutOfRangeException ($"Unknown platform: {platform}"); + } + + TestXCAssetsImpl ( + platform, + runtimeIdentifiers, + new Dictionary () { + { "_XSLaunchImageAssets", $"Resources/Images.xcassets/{platform.AsString ()}LaunchImage.launchimage" } + }, + expectedAssets.ToArray ()); + } + + [TestCase (ApplePlatform.iOS, "iossimulator-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.iOS, "ios-arm64")] + [TestCase (ApplePlatform.TVOS, "tvos-arm64")] +#endif + [TestCase (ApplePlatform.TVOS, "tvossimulator-x64")] + [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-arm64;maccatalyst-x64")] +#endif + [TestCase (ApplePlatform.MacOSX, "osx-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.MacOSX, "osx-arm64;osx-x64")] +#endif + public void AlternateAppIcon (ApplePlatform platform, string runtimeIdentifiers) + { + var expectedAssets = new HashSet (); + switch (platform) { + case ApplePlatform.iOS: + expectedAssets.Add ("Icon Image:Icon1024.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("Image:Icon64.png"); + expectedAssets.Add ("MultiSized Image:AppIcons"); + break; + case ApplePlatform.TVOS: + expectedAssets.Add ("Image:Icon-green-400x240.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("Image:ZZZZFlattenedImage-1.1.0-gamut0"); + expectedAssets.Add ("Image:ZZZZFlattenedImage-2.1.0-gamut0"); + expectedAssets.Add ("Image:ZZZZRadiosityImage-1.0.0"); + expectedAssets.Add ("Image:ZZZZRadiosityImage-2.0.0"); + expectedAssets.Add ("ImageStack:AlternateAppIcons"); + break; + case ApplePlatform.MacOSX: + expectedAssets.Add ("Icon Image:Icon1024.png"); + expectedAssets.Add ("Icon Image:Icon128.png"); + expectedAssets.Add ("Icon Image:Icon16.png"); + expectedAssets.Add ("Icon Image:Icon256.png"); + expectedAssets.Add ("Icon Image:Icon32.png"); + expectedAssets.Add ("Icon Image:Icon512.png"); + expectedAssets.Add ("Icon Image:Icon64.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("MultiSized Image:AppIcons"); + expectedAssets.Add ("PackedImage:ZZZZPackedAsset-1.1.0-gamut0"); + expectedAssets.Add ("PackedImage:ZZZZPackedAsset-2.1.0-gamut0"); + break; + case ApplePlatform.MacCatalyst: + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + break; + default: + throw new ArgumentOutOfRangeException ($"Unknown platform: {platform}"); + } + + TestXCAssetsImpl ( + platform, + runtimeIdentifiers, + new Dictionary () { + { "AddTheseAlternateAppIcons", "AppIcons" } + }, + expectedAssets.ToArray ()); + } + + [TestCase (ApplePlatform.iOS, "iossimulator-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.iOS, "ios-arm64")] + [TestCase (ApplePlatform.TVOS, "tvos-arm64")] +#endif + [TestCase (ApplePlatform.TVOS, "tvossimulator-x64")] + [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-arm64;maccatalyst-x64")] +#endif + [TestCase (ApplePlatform.MacOSX, "osx-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.MacOSX, "osx-arm64;osx-x64")] +#endif + public void AlternateAppIcons (ApplePlatform platform, string runtimeIdentifiers) + { + var expectedAssets = new HashSet (); + switch (platform) { + case ApplePlatform.iOS: + expectedAssets.Add ("Icon Image:Icon1024.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("Image:Icon64.png"); + expectedAssets.Add ("MultiSized Image:AlternateAppIcons"); + expectedAssets.Add ("MultiSized Image:AppIcons"); + break; + case ApplePlatform.TVOS: + expectedAssets.Add ("Image:Icon-green-400x240.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("Image:ZZZZFlattenedImage-1.1.0-gamut0"); + expectedAssets.Add ("Image:ZZZZFlattenedImage-2.1.0-gamut0"); + expectedAssets.Add ("Image:ZZZZRadiosityImage-1.0.0"); + expectedAssets.Add ("Image:ZZZZRadiosityImage-2.0.0"); + expectedAssets.Add ("ImageStack:AlternateAppIcons"); + break; + case ApplePlatform.MacOSX: + expectedAssets.Add ("Icon Image:Icon1024.png"); + expectedAssets.Add ("Icon Image:Icon128.png"); + expectedAssets.Add ("Icon Image:Icon16.png"); + expectedAssets.Add ("Icon Image:Icon256.png"); + expectedAssets.Add ("Icon Image:Icon32.png"); + expectedAssets.Add ("Icon Image:Icon512.png"); + expectedAssets.Add ("Icon Image:Icon64.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("MultiSized Image:AlternateAppIcons"); + expectedAssets.Add ("MultiSized Image:AppIcons"); + expectedAssets.Add ("PackedImage:ZZZZPackedAsset-1.1.0-gamut0"); + expectedAssets.Add ("PackedImage:ZZZZPackedAsset-2.1.0-gamut0"); + break; + case ApplePlatform.MacCatalyst: + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + break; + default: + throw new ArgumentOutOfRangeException ($"Unknown platform: {platform}"); + } + + TestXCAssetsImpl ( + platform, + runtimeIdentifiers, + new Dictionary () { + { "AddTheseAlternateAppIcons", "AppIcons;AlternateAppIcons" } + }, + expectedAssets.ToArray ()); + } + + [TestCase (ApplePlatform.iOS, "iossimulator-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.iOS, "ios-arm64")] + [TestCase (ApplePlatform.TVOS, "tvos-arm64")] +#endif + [TestCase (ApplePlatform.TVOS, "tvossimulator-x64")] + [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-arm64;maccatalyst-x64")] +#endif + [TestCase (ApplePlatform.MacOSX, "osx-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.MacOSX, "osx-arm64;osx-x64")] +#endif + public void AlternateAppIcon_Failure (ApplePlatform platform, string runtimeIdentifiers) + { + TestXCAssetsImpl ( + platform, + runtimeIdentifiers, + new Dictionary () { + { "AddTheseAlternateAppIcons", "InexistentAppIcon" } + }, + expectedErrorMessages: new string [] { + platform == ApplePlatform.TVOS + ? "Can't find the AlternateAppIcon 'InexistentAppIcon' among the image resources. There are 5 app icons in the image resources: AlternateAppIcons, AppIcon, AppIcon-AppStore, AppIcons, AppIcons-AppStore." + : "Can't find the AlternateAppIcon 'InexistentAppIcon' among the image resources. There are 2 app icons in the image resources: AlternateAppIcons, AppIcons." + }); + } + + [TestCase (ApplePlatform.iOS, "iossimulator-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.iOS, "ios-arm64")] + [TestCase (ApplePlatform.TVOS, "tvos-arm64")] +#endif + [TestCase (ApplePlatform.TVOS, "tvossimulator-x64")] + [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-arm64;maccatalyst-x64")] +#endif + [TestCase (ApplePlatform.MacOSX, "osx-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.MacOSX, "osx-arm64;osx-x64")] +#endif + public void AppIcon_1 (ApplePlatform platform, string runtimeIdentifiers) + { + var expectedAssets = new HashSet (); + switch (platform) { + case ApplePlatform.iOS: + expectedAssets.Add ("Icon Image:Icon1024.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("Image:Icon64.png"); + expectedAssets.Add ("MultiSized Image:AppIcons"); + break; + case ApplePlatform.TVOS: + expectedAssets.Add ("Image:Icon-blue-1280x768.png"); + expectedAssets.Add ("Image:Icon-blue-1920x720.png"); + expectedAssets.Add ("Image:Icon-blue-2320x720.png"); + expectedAssets.Add ("Image:Icon-blue-3840x1440.png"); + expectedAssets.Add ("Image:Icon-blue-400x240.png"); + expectedAssets.Add ("Image:Icon-blue-4640x1440.png"); + expectedAssets.Add ("Image:Icon-green-400x240.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("Image:ZZZZFlattenedImage-1.1.0-gamut0"); + expectedAssets.Add ("Image:ZZZZFlattenedImage-2.1.0-gamut0"); + expectedAssets.Add ("Image:ZZZZRadiosityImage-1.0.0"); + expectedAssets.Add ("Image:ZZZZRadiosityImage-2.0.0"); + expectedAssets.Add ("ImageStack:AlternateAppIcons"); + expectedAssets.Add ("ImageStack:AppIcons"); + break; + case ApplePlatform.MacOSX: + expectedAssets.Add ("Icon Image:Icon1024.png"); + expectedAssets.Add ("Icon Image:Icon128.png"); + expectedAssets.Add ("Icon Image:Icon16.png"); + expectedAssets.Add ("Icon Image:Icon256.png"); + expectedAssets.Add ("Icon Image:Icon32.png"); + expectedAssets.Add ("Icon Image:Icon512.png"); + expectedAssets.Add ("Icon Image:Icon64.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("MultiSized Image:AppIcons"); + expectedAssets.Add ("PackedImage:ZZZZPackedAsset-1.1.0-gamut0"); + expectedAssets.Add ("PackedImage:ZZZZPackedAsset-2.1.0-gamut0"); + break; + case ApplePlatform.MacCatalyst: + expectedAssets.Add ("Icon Image:Icon1024.png"); + expectedAssets.Add ("Icon Image:Icon128.png"); + expectedAssets.Add ("Icon Image:Icon16.png"); + expectedAssets.Add ("Icon Image:Icon256.png"); + expectedAssets.Add ("Icon Image:Icon32.png"); + expectedAssets.Add ("Icon Image:Icon512.png"); + expectedAssets.Add ("Icon Image:Icon64.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("MultiSized Image:AppIcons"); + expectedAssets.Add ("PackedImage:ZZZZPackedAsset-1.1.0-gamut0"); + expectedAssets.Add ("PackedImage:ZZZZPackedAsset-2.1.0-gamut0"); + break; + default: + throw new ArgumentOutOfRangeException ($"Unknown platform: {platform}"); + } + TestXCAssetsImpl ( + platform, + runtimeIdentifiers, + new Dictionary () { + { "AppIcon", "AppIcons" } + }, + expectedAssets.ToArray ()); + } + + [TestCase (ApplePlatform.iOS, "iossimulator-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.iOS, "ios-arm64")] +#endif + // Choosing a different primary app icon on tvOS at build time doesn't seem to be possible + [TestCase (ApplePlatform.TVOS, "tvos-arm64")] + [TestCase (ApplePlatform.TVOS, "tvossimulator-x64")] + [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-arm64;maccatalyst-x64")] +#endif + [TestCase (ApplePlatform.MacOSX, "osx-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.MacOSX, "osx-arm64;osx-x64")] +#endif + public void AppIcon_2 (ApplePlatform platform, string runtimeIdentifiers) + { + var expectedAssets = new HashSet (); + switch (platform) { + case ApplePlatform.iOS: + expectedAssets.Add ("Icon Image:Icon1024.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("Image:Icon64.png"); + expectedAssets.Add ("MultiSized Image:AlternateAppIcons"); + break; + case ApplePlatform.TVOS: + expectedAssets.Add ("Image:Icon-green-1920x720.png"); + expectedAssets.Add ("Image:Icon-green-2320x720.png"); + expectedAssets.Add ("Image:Icon-green-3840x1440.png"); + expectedAssets.Add ("Image:Icon-green-400x240.png"); + expectedAssets.Add ("Image:Icon-green-4640x1440.png"); + expectedAssets.Add ("Image:Icon1280x768.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("Image:Icon400x240.png"); + expectedAssets.Add ("Image:ZZZZFlattenedImage-1.1.0-gamut0"); + expectedAssets.Add ("Image:ZZZZFlattenedImage-2.1.0-gamut0"); + expectedAssets.Add ("Image:ZZZZRadiosityImage-1.0.0"); + expectedAssets.Add ("Image:ZZZZRadiosityImage-2.0.0"); + expectedAssets.Add ("ImageStack:AlternateAppIcons"); + expectedAssets.Add ("ImageStack:AppIcon"); + break; + case ApplePlatform.MacOSX: + expectedAssets.Add ("Icon Image:Icon1024.png"); + expectedAssets.Add ("Icon Image:Icon128.png"); + expectedAssets.Add ("Icon Image:Icon16.png"); + expectedAssets.Add ("Icon Image:Icon256.png"); + expectedAssets.Add ("Icon Image:Icon32.png"); + expectedAssets.Add ("Icon Image:Icon512.png"); + expectedAssets.Add ("Icon Image:Icon64.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("MultiSized Image:AlternateAppIcons"); + expectedAssets.Add ("PackedImage:ZZZZPackedAsset-1.1.0-gamut0"); + expectedAssets.Add ("PackedImage:ZZZZPackedAsset-2.1.0-gamut0"); + break; + case ApplePlatform.MacCatalyst: + expectedAssets.Add ("Icon Image:Icon1024.png"); + expectedAssets.Add ("Icon Image:Icon128.png"); + expectedAssets.Add ("Icon Image:Icon16.png"); + expectedAssets.Add ("Icon Image:Icon256.png"); + expectedAssets.Add ("Icon Image:Icon32.png"); + expectedAssets.Add ("Icon Image:Icon512.png"); + expectedAssets.Add ("Icon Image:Icon64.png"); + expectedAssets.Add ("Image:Icon16.png"); + expectedAssets.Add ("Image:Icon32.png"); + expectedAssets.Add ("MultiSized Image:AlternateAppIcons"); + expectedAssets.Add ("PackedImage:ZZZZPackedAsset-1.1.0-gamut0"); + expectedAssets.Add ("PackedImage:ZZZZPackedAsset-2.1.0-gamut0"); + break; + default: + throw new ArgumentOutOfRangeException ($"Unknown platform: {platform}"); + } + TestXCAssetsImpl ( + platform, + runtimeIdentifiers, + new Dictionary () { + { "AppIcon", platform == ApplePlatform.TVOS ? "AlternateBrandAssets" : "AlternateAppIcons" } + }, + expectedAssets.ToArray ()); + } + + [TestCase (ApplePlatform.iOS, "iossimulator-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.iOS, "ios-arm64")] + [TestCase (ApplePlatform.TVOS, "tvos-arm64")] +#endif + [TestCase (ApplePlatform.TVOS, "tvossimulator-x64")] + [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-arm64;maccatalyst-x64")] +#endif + [TestCase (ApplePlatform.MacOSX, "osx-x64")] +#if EXHAUSTIVE_TESTS + [TestCase (ApplePlatform.MacOSX, "osx-arm64;osx-x64")] +#endif + public void AppIcon_Failure (ApplePlatform platform, string runtimeIdentifiers) + { + TestXCAssetsImpl ( + platform, + runtimeIdentifiers, + new Dictionary () { + { "AppIcon", "InexistentAppIcon" } + }, + expectedErrorMessages: new string [] { + platform == ApplePlatform.TVOS + ? "Can't find the AppIcon 'InexistentAppIcon' among the image resources. There are 2 app icons in the image resources: AlternateBrandAssets, AppIcons." + : "Can't find the AppIcon 'InexistentAppIcon' among the image resources. There are 2 app icons in the image resources: AlternateAppIcons, AppIcons." + }); + } + + void TestXCAssetsImpl (ApplePlatform platform, string runtimeIdentifiers, Dictionary? extraProperties = null, IEnumerable? extraAssets = null, string []? expectedErrorMessages = null) + { + var projectPath = string.Empty; + var appPath = string.Empty; + + Configuration.AssertRuntimeIdentifiersAvailable (platform, runtimeIdentifiers); + var project = "AppWithXCAssets"; + Configuration.IgnoreIfIgnoredPlatform (platform); + projectPath = GetProjectPath (project, runtimeIdentifiers: runtimeIdentifiers, platform: platform, out appPath); + + Clean (projectPath); + + var properties = GetDefaultProperties (runtimeIdentifiers, extraProperties); + properties ["IsRunningUnitTests"] = "true"; + if (expectedErrorMessages is not null) { + var rv = DotNet.AssertBuildFailure (projectPath, properties); + var errors = BinLog.GetBuildLogErrors (rv.BinLogPath).ToArray (); + AssertErrorMessages (errors, expectedErrorMessages); + return; // nothing else to test here + } + + DotNet.AssertBuild (projectPath, properties); + + var resourcesDirectory = GetResourcesDirectory (platform, appPath); + var assetsCar = Path.Combine (resourcesDirectory, "Assets.car"); + Assert.That (assetsCar, Does.Exist, "Assets.car"); + + try { + var doc = AssetsTest.ProcessAssets (assetsCar, AssetsTest.GetFullSdkVersion (platform, runtimeIdentifiers)); + Assert.IsNotNull (doc, "There was an issue processing the asset binary."); + + var foundAssets = AssetsTest.FindAssets (platform, doc); + + var expectedAssets = new HashSet (); + if (extraAssets is not null) { + foreach (var asset in extraAssets) + expectedAssets.Add (asset); + } + + CollectionAssert.AreEquivalent (expectedAssets, foundAssets, "Incorrect assets"); + } catch { + Console.WriteLine ($"Assets.car: {assetsCar}"); + throw; + } + } + } +} diff --git a/tests/dotnet/UnitTests/AssetsTest.cs b/tests/dotnet/UnitTests/AssetsTest.cs index 618cb1945ad9..6ecf003f6995 100644 --- a/tests/dotnet/UnitTests/AssetsTest.cs +++ b/tests/dotnet/UnitTests/AssetsTest.cs @@ -260,35 +260,66 @@ static bool TryGetTarget (JsonElement item, JsonElement assetType, XCAssetTarget "Image:samplepng2.png", "Image:spritejpeg.jpeg", "Image:xamlogo.svg", + "Image:Icon16.png", + "Image:Icon32.png", "PackedImage:ZZZZExplicitlyPackedAsset-1.0.0-gamut0", "Texture Rendition:TextureTest", }; static HashSet ExpectedAssetsMacCatalyst => new HashSet (ExpectedAssetsAllPlatforms) { - "Image:Icon16.png", - "Image:Icon32.png", + "Icon Image:Icon1024.png", + "Icon Image:Icon128.png", + "Icon Image:Icon16.png", + "Icon Image:Icon256.png", + "Icon Image:Icon32.png", + "Icon Image:Icon512.png", + "Icon Image:Icon64.png", + "MultiSized Image:AppIcons", + "PackedImage:ZZZZPackedAsset-1.1.0-gamut0", + "PackedImage:ZZZZPackedAsset-2.1.0-gamut0", }; static readonly HashSet ExpectedAssetsiOS = new HashSet (ExpectedAssetsAllPlatforms) { + "Icon Image:Icon1024.png", + "Image:Icon64.png", + "MultiSized Image:AlternateAppIcons", + "MultiSized Image:AppIcons", "Vector:samplepdf.pdf", "Vector:xamlogo.svg", - "Image:Icon16.png", - "Image:Icon32.png", - "Image:Icon64.png", }; static readonly HashSet ExpectedAssetstvOS = new HashSet (ExpectedAssetsAllPlatforms) { + "Image:Icon-blue-1280x768.png", + "Image:Icon-blue-1920x720.png", + "Image:Icon-blue-2320x720.png", + "Image:Icon-blue-3840x1440.png", + "Image:Icon-blue-400x240.png", + "Image:Icon-blue-4640x1440.png", + "Image:Icon-green-400x240.png", + "Image:ZZZZFlattenedImage-1.1.0-gamut0", + "Image:ZZZZFlattenedImage-2.1.0-gamut0", + "Image:ZZZZRadiosityImage-1.0.0", + "Image:ZZZZRadiosityImage-2.0.0", + "ImageStack:AlternateAppIcons", + "ImageStack:AppIcons", "Vector:samplepdf.pdf", "Vector:xamlogo.svg", - "Image:Icon16.png", - "Image:Icon32.png", }; static readonly HashSet ExpectedAssetsmacOS = new HashSet (ExpectedAssetsAllPlatforms) { + "Icon Image:Icon1024.png", + "Icon Image:Icon128.png", + "Icon Image:Icon16.png", + "Icon Image:Icon256.png", + "Icon Image:Icon32.png", + "Icon Image:Icon512.png", + "Icon Image:Icon64.png", + "MultiSized Image:AlternateAppIcons", + "MultiSized Image:AppIcons", + "PackedImage:ZZZZPackedAsset-1.1.0-gamut0", + "PackedImage:ZZZZPackedAsset-2.1.0-gamut0", "Vector:samplepdf.pdf", "Vector:xamlogo.svg", - "Image:Icon16.png", - "Image:Icon32.png", }; class XCAssetTarget { diff --git a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/ACToolTaskTest.cs b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/ACToolTaskTest.cs new file mode 100644 index 000000000000..6c3204fe530c --- /dev/null +++ b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/ACToolTaskTest.cs @@ -0,0 +1,642 @@ +using System; +using System.IO; +using System.Linq; +using System.Collections.Generic; + +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +using NUnit.Framework; + +using Xamarin.MacDev; +using Xamarin.MacDev.Tasks; +using Xamarin.Tests; +using Xamarin.Utils; + +namespace Xamarin.MacDev.Tasks { + [TestFixture] + public class ACToolTaskTests : TestBase { + ACTool CreateACToolTask (ApplePlatform platform, string projectDir, out string intermediateOutputPath, params string [] imageAssets) + { + Configuration.IgnoreIfIgnoredPlatform (platform); + + intermediateOutputPath = Cache.CreateTemporaryDirectory (); + + var sdk = Sdks.GetAppleSdk (platform); + var version = AppleSdkVersion.UseDefault.ToString (); + var root = sdk.GetSdkPath (version, false); + var usr = Path.Combine (sdk.DeveloperRoot, "usr"); + var bin = Path.Combine (usr, "bin"); + string sdkPlatform; + var uiDeviceFamily = ""; + + switch (platform) { + case ApplePlatform.TVOS: + sdkPlatform = "AppleTVOS"; + uiDeviceFamily = "TV"; + break; + case ApplePlatform.iOS: + sdkPlatform = "iPhoneOS"; + uiDeviceFamily = "IPhone, IPad"; + break; + case ApplePlatform.MacOSX: + sdkPlatform = "MacOSX"; + break; + case ApplePlatform.MacCatalyst: + sdkPlatform = "MacCatalyst"; + break; + default: + throw new NotImplementedException (platform.ToString ()); + } + + var task = CreateTask (); + task.ImageAssets = imageAssets + .Select (v => { + var spl = v.Split ('|'); + var rv = new TaskItem (spl [0]); + rv.SetMetadata ("Link", spl [1]); + return rv; + }) + .Cast () + .ToArray (); + task.IntermediateOutputPath = intermediateOutputPath; + task.MinimumOSVersion = Xamarin.SdkVersions.GetMinVersion (platform).ToString (); + task.OutputPath = Path.Combine (intermediateOutputPath, "OutputPath"); + task.ProjectDir = projectDir; + task.SdkDevPath = Configuration.xcode_root; + task.SdkPlatform = sdkPlatform; + task.SdkVersion = version.ToString (); + task.SdkUsrPath = usr; + task.SdkBinPath = bin; + task.TargetFrameworkMoniker = TargetFramework.GetTargetFramework (platform, true).ToString (); + task.UIDeviceFamily = uiDeviceFamily; + return task; + } + + ACTool CreateACToolTaskWithResources (ApplePlatform platform) + { + var projectDir = Path.Combine (Configuration.SourceRoot, "tests", "dotnet", "AppWithXCAssets", platform.AsString ()); + var files = Directory.GetFiles (Path.Combine (projectDir, "Resources", "Images.xcassets"), "*", SearchOption.AllDirectories); + var imageAssets = files.Select (v => v + "|" + v.Substring (projectDir.Length + 1)).ToArray (); + return CreateACToolTask ( + platform, + projectDir, + out var _, + imageAssets + ); + } + + [Test] + [TestCase (ApplePlatform.iOS)] + [TestCase (ApplePlatform.TVOS)] + [TestCase (ApplePlatform.MacCatalyst)] + [TestCase (ApplePlatform.MacOSX)] + public void DefaultAppIcons (ApplePlatform platform) + { + var actool = CreateACToolTaskWithResources (platform); + ExecuteTask (actool); + + Assert.IsNotNull (actool.PartialAppManifest, "PartialAppManifest"); + var appIconsManifestPath = actool.PartialAppManifest.ItemSpec!; + var appIconsManifest = PDictionary.FromFile (appIconsManifestPath)!; + Assert.AreEqual (0, appIconsManifest.Count, $"Partial plist contents: {actool.PartialAppManifest.ItemSpec}"); + var expectedXml = + """ + + + + + + + """; + PListAsserts.AreStringsEqual (expectedXml, File.ReadAllText (appIconsManifestPath), "Partial plist contents"); + } + + [Test] + [TestCase (ApplePlatform.iOS)] + [TestCase (ApplePlatform.TVOS)] + [TestCase (ApplePlatform.MacCatalyst)] + [TestCase (ApplePlatform.MacOSX)] + public void AllAppIcons (ApplePlatform platform) + { + var actool = CreateACToolTaskWithResources (platform); + actool.IncludeAllAppIcons = true; + + ExecuteTask (actool); + + Assert.IsNotNull (actool.PartialAppManifest, "PartialAppManifest"); + + var appIconsManifestPath = actool.PartialAppManifest.ItemSpec!; + string expectedXml; + if (platform == ApplePlatform.TVOS) { + expectedXml = + """ + + + + + CFBundleIcons + + CFBundleAlternateIcons + + AlternateAppIcons + + CFBundleIconName + AlternateAppIcons + + + + + + """; + } else { + expectedXml = ""; + } + PListAsserts.AreStringsEqual (expectedXml, File.ReadAllText (appIconsManifestPath), "Partial plist contents"); + } + + [Test] + [TestCase (ApplePlatform.iOS)] + [TestCase (ApplePlatform.TVOS)] + [TestCase (ApplePlatform.MacCatalyst)] + [TestCase (ApplePlatform.MacOSX)] + public void AllAppIconsWithAppIcon (ApplePlatform platform) + { + var actool = CreateACToolTaskWithResources (platform); + actool.IncludeAllAppIcons = true; + if (platform == ApplePlatform.TVOS) { + actool.AppIcon = "AlternateBrandAssets"; + } else { + actool.AppIcon = "AlternateAppIcons"; + } + + ExecuteTask (actool); + + Assert.IsNotNull (actool.PartialAppManifest, "PartialAppManifest"); + + var appIconsManifestPath = actool.PartialAppManifest?.ItemSpec!; + string expectedXml; + if (platform == ApplePlatform.MacOSX || platform == ApplePlatform.MacCatalyst) { + expectedXml = + """ + + + + + CFBundleIconFile + AlternateAppIcons + CFBundleIconName + AlternateAppIcons + + + """; + } else if (platform == ApplePlatform.TVOS) { + expectedXml = + """ + + + + + CFBundleIcons + + CFBundleAlternateIcons + + AlternateAppIcons + + CFBundleIconName + AlternateAppIcons + + + CFBundlePrimaryIcon + AppIcon + + TVTopShelfImage + + TVTopShelfPrimaryImage + TopShelfImage + TVTopShelfPrimaryImageWide + TopShelfImageWide + + + + """; + } else { + expectedXml = + """ + + + + + CFBundleIcons + + CFBundleAlternateIcons + + AppIcons + + CFBundleIconFiles + + AppIcons60x60 + AppIcons76x76 + + CFBundleIconName + AppIcons + + + CFBundlePrimaryIcon + + CFBundleIconFiles + + AlternateAppIcons60x60 + + CFBundleIconName + AlternateAppIcons + + + CFBundleIcons~ipad + + CFBundleAlternateIcons + + AppIcons + + CFBundleIconFiles + + AppIcons60x60 + AppIcons76x76 + + CFBundleIconName + AppIcons + + + CFBundlePrimaryIcon + + CFBundleIconFiles + + AlternateAppIcons60x60 + AlternateAppIcons76x76 + + CFBundleIconName + AlternateAppIcons + + + + + """; + } + PListAsserts.AreStringsEqual (expectedXml, File.ReadAllText (appIconsManifestPath), "Partial plist contents"); + } + + [Test] + [TestCase (ApplePlatform.iOS)] + [TestCase (ApplePlatform.TVOS)] + [TestCase (ApplePlatform.MacCatalyst)] + [TestCase (ApplePlatform.MacOSX)] + public void AppIcon (ApplePlatform platform) + { + var actool = CreateACToolTaskWithResources (platform); + actool.AppIcon = "AppIcons"; + + ExecuteTask (actool); + + Assert.IsNotNull (actool.PartialAppManifest, "PartialAppManifest"); + + var appIconsManifestPath = actool.PartialAppManifest.ItemSpec!; + string expectedXml; + if (platform == ApplePlatform.MacOSX || platform == ApplePlatform.MacCatalyst) { + expectedXml = + """ + + + + + CFBundleIconFile + AppIcons + CFBundleIconName + AppIcons + + + """; + } else if (platform == ApplePlatform.TVOS) { + expectedXml = + """ + + + + + CFBundleIcons + + CFBundlePrimaryIcon + AppIcons + + TVTopShelfImage + + TVTopShelfPrimaryImage + TopShelfImage + TVTopShelfPrimaryImageWide + TopShelfImageWide + + + + """; + } else { + expectedXml = + """ + + + + + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconFiles + + AppIcons60x60 + + CFBundleIconName + AppIcons + + + CFBundleIcons~ipad + + CFBundlePrimaryIcon + + CFBundleIconFiles + + AppIcons60x60 + AppIcons76x76 + + CFBundleIconName + AppIcons + + + + + """; + } + PListAsserts.AreStringsEqual (expectedXml, File.ReadAllText (appIconsManifestPath), "Partial plist contents"); + } + + [Test] + [TestCase (ApplePlatform.iOS)] + [TestCase (ApplePlatform.TVOS)] + [TestCase (ApplePlatform.MacCatalyst)] + [TestCase (ApplePlatform.MacOSX)] + public void AppIconAndAlternateIcons (ApplePlatform platform) + { + var actool = CreateACToolTaskWithResources (platform); + if (platform == ApplePlatform.TVOS) { + actool.AppIcon = "AppIcons"; + actool.AlternateAppIcons = new ITaskItem [] { new TaskItem ("AlternateAppIcons") }; + } else { + actool.AppIcon = "AppIcons"; + actool.AlternateAppIcons = new ITaskItem [] { new TaskItem ("AlternateAppIcons") }; + } + + ExecuteTask (actool); + + Assert.IsNotNull (actool.PartialAppManifest, "PartialAppManifest"); + + var appIconsManifestPath = actool.PartialAppManifest.ItemSpec!; + string expectedXml; + if (platform == ApplePlatform.MacOSX || platform == ApplePlatform.MacCatalyst) { + expectedXml = + """ + + + + + CFBundleIconFile + AppIcons + CFBundleIconName + AppIcons + + + """; + } else if (platform == ApplePlatform.TVOS) { + expectedXml = + """ + + + + + CFBundleIcons + + CFBundleAlternateIcons + + AlternateAppIcons + + CFBundleIconName + AlternateAppIcons + + + CFBundlePrimaryIcon + AppIcons + + TVTopShelfImage + + TVTopShelfPrimaryImage + TopShelfImage + TVTopShelfPrimaryImageWide + TopShelfImageWide + + + + """; + } else { + expectedXml = + """ + + + + + CFBundleIcons + + CFBundleAlternateIcons + + AlternateAppIcons + + CFBundleIconFiles + + AlternateAppIcons60x60 + AlternateAppIcons76x76 + + CFBundleIconName + AlternateAppIcons + + + CFBundlePrimaryIcon + + CFBundleIconFiles + + AppIcons60x60 + + CFBundleIconName + AppIcons + + + CFBundleIcons~ipad + + CFBundleAlternateIcons + + AlternateAppIcons + + CFBundleIconFiles + + AlternateAppIcons60x60 + AlternateAppIcons76x76 + + CFBundleIconName + AlternateAppIcons + + + CFBundlePrimaryIcon + + CFBundleIconFiles + + AppIcons60x60 + AppIcons76x76 + + CFBundleIconName + AppIcons + + + + + """; + } + PListAsserts.AreStringsEqual (expectedXml, File.ReadAllText (appIconsManifestPath), "Partial plist contents"); + } + + [Test] + [TestCase (ApplePlatform.iOS)] + [TestCase (ApplePlatform.TVOS)] + [TestCase (ApplePlatform.MacCatalyst)] + [TestCase (ApplePlatform.MacOSX)] + public void AlternateIcons (ApplePlatform platform) + { + var actool = CreateACToolTaskWithResources (platform); + actool.AlternateAppIcons = new ITaskItem [] { new TaskItem ("AlternateAppIcons") }; + + ExecuteTask (actool); + + string expectedXml; + switch (platform) { + case ApplePlatform.TVOS: + expectedXml = """ + + + + + CFBundleIcons + + CFBundleAlternateIcons + + AlternateAppIcons + + CFBundleIconName + AlternateAppIcons + + + + + +"""; + break; + case ApplePlatform.iOS: + case ApplePlatform.MacOSX: + case ApplePlatform.MacCatalyst: + expectedXml = ""; + break; + default: + throw new NotImplementedException (platform.ToString ()); + } + + var appIconsManifestPath = actool.PartialAppManifest.ItemSpec!; + PListAsserts.AreStringsEqual (expectedXml, File.ReadAllText (appIconsManifestPath), "Partial plist contents"); + } + + [Test] + [TestCase (ApplePlatform.iOS)] + [TestCase (ApplePlatform.TVOS)] + [TestCase (ApplePlatform.MacCatalyst)] + [TestCase (ApplePlatform.MacOSX)] + public void InexistentAppIcon (ApplePlatform platform) + { + var actool = CreateACToolTaskWithResources (platform); + actool.AppIcon = "InexistentAppIcons"; + + ExecuteTask (actool, 1); + string expectedErrorMessage; + switch (platform) { + case ApplePlatform.TVOS: + expectedErrorMessage = "Can't find the AppIcon 'InexistentAppIcons' among the image resources. There are 2 app icons in the image resources: AlternateBrandAssets, AppIcons."; + break; + case ApplePlatform.iOS: + case ApplePlatform.MacOSX: + case ApplePlatform.MacCatalyst: + expectedErrorMessage = "Can't find the AppIcon 'InexistentAppIcons' among the image resources. There are 2 app icons in the image resources: AlternateAppIcons, AppIcons."; + break; + default: + throw new NotImplementedException (platform.ToString ()); + } + Assert.AreEqual (expectedErrorMessage, Engine.Logger.ErrorEvents [0].Message, "Error message"); + } + + [Test] + [TestCase (ApplePlatform.iOS)] + [TestCase (ApplePlatform.TVOS)] + [TestCase (ApplePlatform.MacCatalyst)] + [TestCase (ApplePlatform.MacOSX)] + public void InexistentAlternateIcons (ApplePlatform platform) + { + var actool = CreateACToolTaskWithResources (platform); + actool.AlternateAppIcons = new ITaskItem [] { new TaskItem ("InexistentAlternateAppIcons") }; + + ExecuteTask (actool, 1); + string expectedErrorMessage; + switch (platform) { + case ApplePlatform.TVOS: + expectedErrorMessage = "Can't find the AlternateAppIcon 'InexistentAlternateAppIcons' among the image resources. There are 5 app icons in the image resources: AlternateAppIcons, AppIcon, AppIcon-AppStore, AppIcons, AppIcons-AppStore."; + break; + case ApplePlatform.iOS: + case ApplePlatform.MacOSX: + case ApplePlatform.MacCatalyst: + expectedErrorMessage = "Can't find the AlternateAppIcon 'InexistentAlternateAppIcons' among the image resources. There are 2 app icons in the image resources: AlternateAppIcons, AppIcons."; + break; + default: + throw new NotImplementedException (platform.ToString ()); + } + Assert.AreEqual (expectedErrorMessage, Engine.Logger.ErrorEvents [0].Message, "Error message"); + } + + [Test] + [TestCase (ApplePlatform.iOS)] + [TestCase (ApplePlatform.TVOS)] + [TestCase (ApplePlatform.MacCatalyst)] + [TestCase (ApplePlatform.MacOSX)] + public void BothAlternateAndMainIcon (ApplePlatform platform) + { + var actool = CreateACToolTaskWithResources (platform); + actool.AlternateAppIcons = new ITaskItem [] { new TaskItem ("AppIcons") }; + actool.AppIcon = "AppIcons"; + + ExecuteTask (actool, 1); + Assert.AreEqual ($"The image resource '{actool.AppIcon}' is specified as both 'AppIcon' and 'AlternateAppIcon'.", Engine.Logger.ErrorEvents [0].Message, "Error message"); + } + + [Test] + [TestCase (ApplePlatform.iOS)] + [TestCase (ApplePlatform.TVOS)] + [TestCase (ApplePlatform.MacCatalyst)] + [TestCase (ApplePlatform.MacOSX)] + public void XSAppIconAssetsAndAppIcon (ApplePlatform platform) + { + var actool = CreateACToolTaskWithResources (platform); + actool.AppIcon = "AppIcons"; + actool.XSAppIconAssets = "Resources/Images.xcassets/AppIcons.appiconset"; + + ExecuteTask (actool, 1); + Assert.AreEqual ("Can't specify both 'XSAppIconAssets' in the Info.plist and 'AppIcon' in the project file. Please select one or the other.", Engine.Logger.ErrorEvents [0].Message, "Error message"); + } + } +} diff --git a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TestHelpers/Logger.cs b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TestHelpers/Logger.cs index bb131d1b7ad4..77523db0ce61 100644 --- a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TestHelpers/Logger.cs +++ b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TestHelpers/Logger.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using Microsoft.Build.Framework; @@ -48,5 +49,33 @@ public void Clear () MessageEvents.Clear (); WarningsEvents.Clear (); } + + public IEnumerable AllEvents { + get { + var rv = new List (); + rv.AddRange (CustomEvents); + rv.AddRange (ErrorEvents); + rv.AddRange (MessageEvents); + rv.AddRange (WarningsEvents); + return rv; + } + } + } + + public static class BuildEventArgsExtensions { + public static string AsString (this BuildEventArgs ea) + { + if (ea is BuildErrorEventArgs eea) { + return $"{eea.Code}: error: {eea.Message}"; + } else if (ea is BuildMessageEventArgs bmea) { + return $"{bmea.Code}: {bmea.Message}"; + } else if (ea is BuildWarningEventArgs bwea) { + return $"{bwea.Code}: warning: {bwea.Message}"; + } else if (ea is CustomBuildEventArgs cbea) { + return cbea.Message; + } else { + return ea.Message; + } + } } } diff --git a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TestHelpers/TestBase.cs b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TestHelpers/TestBase.cs index b836f1fc62d9..c3ecbbe86ac9 100644 --- a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TestHelpers/TestBase.cs +++ b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TestHelpers/TestBase.cs @@ -67,8 +67,9 @@ public void ExecuteTask (Task task, int expectedErrorCount = 0) var rv = task.Execute (); if (expectedErrorCount != Engine.Logger.ErrorEvents.Count) { string messages = string.Empty; - if (Engine.Logger.ErrorEvents.Count > 0) { - messages = "\n\t" + string.Join ("\n\t", Engine.Logger.ErrorEvents.Select ((v) => v.Message).ToArray ()); + var allEvents = Engine.Logger.AllEvents.ToArray (); + if (allEvents.Any ()) { + messages = "\n\t" + string.Join ("\n\t", allEvents.Select ((v) => v.AsString ()).ToArray ()); } Assert.AreEqual (expectedErrorCount, Engine.Logger.ErrorEvents.Count, "#RunTask-ErrorCount" + messages); } diff --git a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/Xamarin.MacDev.Tasks.Tests.csproj b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/Xamarin.MacDev.Tasks.Tests.csproj index 9c01e50e5e25..33be922235b1 100644 --- a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/Xamarin.MacDev.Tasks.Tests.csproj +++ b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/Xamarin.MacDev.Tasks.Tests.csproj @@ -67,6 +67,12 @@ external\ErrorHelper.tests.cs + + external\PListAsserts.cs + + + external\SdkVersions.cs + external\StringUtils.cs