From 1519562a0ed9e8bc358db4707a1cd0ae99bdd1ce Mon Sep 17 00:00:00 2001 From: Jerome Laban Date: Wed, 19 Oct 2022 21:24:01 -0400 Subject: [PATCH] chore: Adjust for macOS build for android --- src/SourceGenerators/Uno.UI.Tasks/Assets/RetargetAssets.cs | 7 +++++++ .../Tests/Windows_Storage/Given_StorageFile.cs | 2 +- src/Uno.UWP/Storage/StorageFile.android.cs | 2 +- src/Uno.UWP/Storage/StorageFile.iOSmacOS.cs | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/SourceGenerators/Uno.UI.Tasks/Assets/RetargetAssets.cs b/src/SourceGenerators/Uno.UI.Tasks/Assets/RetargetAssets.cs index 4ff7603bafb4..d8175399c7ac 100644 --- a/src/SourceGenerators/Uno.UI.Tasks/Assets/RetargetAssets.cs +++ b/src/SourceGenerators/Uno.UI.Tasks/Assets/RetargetAssets.cs @@ -93,6 +93,8 @@ private TaskItem ProcessContentItem(ITaskItem asset, Func path + .Replace('/', Path.DirectorySeparatorChar) + .Replace('\\', Path.DirectorySeparatorChar); } } diff --git a/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_StorageFile.cs b/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_StorageFile.cs index ce372d52a59e..bf24fd8aa19e 100644 --- a/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_StorageFile.cs +++ b/src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_StorageFile.cs @@ -352,7 +352,7 @@ public async Task When_Project_Transitive_Asset() } catch (Exception ex) { - Assert.Fail("Transitive asset could not be found " + ex.Message); + Assert.Fail("Transitive asset could not be found: " + ex); } } diff --git a/src/Uno.UWP/Storage/StorageFile.android.cs b/src/Uno.UWP/Storage/StorageFile.android.cs index 685d9362ddb4..a47c66985d2d 100644 --- a/src/Uno.UWP/Storage/StorageFile.android.cs +++ b/src/Uno.UWP/Storage/StorageFile.android.cs @@ -33,7 +33,7 @@ private static async Task GetFileFromApplicationUri(CancellationTok if (uri.Host is { Length: > 0 } host) { - originalPath = host + "/" + originalPath.TrimStart('/'); + originalPath = host.ToLowerInvariant() + "/" + originalPath.TrimStart('/'); } var path = AndroidResourceNameEncoder.EncodeResourcePath(originalPath); diff --git a/src/Uno.UWP/Storage/StorageFile.iOSmacOS.cs b/src/Uno.UWP/Storage/StorageFile.iOSmacOS.cs index d26f35b6a71b..40d8a4717934 100644 --- a/src/Uno.UWP/Storage/StorageFile.iOSmacOS.cs +++ b/src/Uno.UWP/Storage/StorageFile.iOSmacOS.cs @@ -27,7 +27,7 @@ private static async Task GetFileFromApplicationUri(CancellationTok { if (uri.Host is { Length: > 0 } host) { - directoryName = host + "/" + directoryName.TrimStart('/'); + directoryName = host.ToLowerInvariant() + "/" + directoryName.TrimStart('/'); } var resourcePathname = NSBundle.MainBundle.PathForResource(global::System.IO.Path.Combine(directoryName, fileName), fileExtension.Substring(1));