From cf398ed770b92c5c401ae194c8e171bb51bc9fe0 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 14 Dec 2023 15:16:36 +0100 Subject: [PATCH] [dotnet] Compute the path to the Xamarin SDK root as a relative path to .NET's root directory. (#19404) This is useful to compute the path to the Mac's Xamarin SDK from Windows: we can compute the relative path on Windows, and then just prepend the Mac's path to .NET. --- dotnet/targets/Xamarin.Shared.Sdk.props | 1 + dotnet/targets/Xamarin.Shared.Sdk.targets | 2 ++ 2 files changed, 3 insertions(+) diff --git a/dotnet/targets/Xamarin.Shared.Sdk.props b/dotnet/targets/Xamarin.Shared.Sdk.props index ec92cb79ac..acb10624cc 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.props +++ b/dotnet/targets/Xamarin.Shared.Sdk.props @@ -23,6 +23,7 @@ true <_XamarinSdkRootDirectory>$([MSBuild]::NormalizePath('$(MSBuildThisFileDirectory)', '..'))\ + <_XamarinRelativeSdkRootDirectory>$([MSBuild]::EnsureTrailingSlash($([MSBuild]::MakeRelative('$(NetCoreRoot)', '$(_XamarinSdkRootDirectory)')))) <_XamarinSdkRootDirectoryOnMac>$(_XamarinSdkRootDirectory) <_XamarinTaskAssembly Condition="'$(_PlatformName)' != 'macOS'">$(_XamarinSdkRootDirectory)\tools\msbuild\iOS\Xamarin.iOS.Tasks.dll diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets index 7e9e3f4ab4..f67fe331b1 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.targets +++ b/dotnet/targets/Xamarin.Shared.Sdk.targets @@ -2041,6 +2041,8 @@ $(_MlaunchPath) $(_XamarinSdkRootDirectory)tools\bin\mlaunch <_MlaunchPath Condition="'$(_MlaunchPath)' == ''">$(MlaunchPath) + + <_RelativeMlaunchPath Condition="'$(_RelativeMlaunchPath)' == ''">$(_XamarinRelativeSdkRootDirectory)tools\bin\mlaunch