From ac4efb4fdf33570dfc4d75b84dd1ee04cfc4fb71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 1 Dec 2022 13:56:02 +0100 Subject: [PATCH] Workaround MacCatalyst .app output path change in cmake 3.25 Since AzDO macOS builders where updated to cmake 3.25 we're seeing failures because the .app doesn't end up in the expected output path anymore. Apply a workaround to move it back to the old location. Fixes https://github.com/dotnet/runtime/issues/78778 --- src/tasks/AppleAppBuilder/Xcode.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/tasks/AppleAppBuilder/Xcode.cs b/src/tasks/AppleAppBuilder/Xcode.cs index 129b1282a45610..758891d61392b2 100644 --- a/src/tasks/AppleAppBuilder/Xcode.cs +++ b/src/tasks/AppleAppBuilder/Xcode.cs @@ -524,8 +524,15 @@ public string BuildAppBundle( Utils.RunProcess(Logger, "xcodebuild", args.ToString(), workingDir: Path.GetDirectoryName(xcodePrjPath)); - string appPath = Path.Combine(Path.GetDirectoryName(xcodePrjPath)!, config + "-" + sdk, - Path.GetFileNameWithoutExtension(xcodePrjPath) + ".app"); + string appDirectory = Path.Combine(Path.GetDirectoryName(xcodePrjPath)!, config + "-" + sdk); + if (!Directory.Exists(appDirectory)) + { + // cmake 3.25.0 seems to have changed the output directory for MacCatalyst, move it back to the old format + string appDirectoryWithoutSdk = Path.Combine(Path.GetDirectoryName(xcodePrjPath)!, config); + Directory.Move(appDirectoryWithoutSdk, appDirectory); + } + + string appPath = Path.Combine(appDirectory, Path.GetFileNameWithoutExtension(xcodePrjPath) + ".app"); if (destination != null) {