Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Some 1.4 Backports #285

Merged
merged 3 commits into from
May 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Clients/Xamarin.Interactive.MTouch/MTouchSdkTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public static class MTouchSdkTool
const string XamarinStudioMlaunchPath = "/Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/" +
"AddIns/MonoDevelop.IPhone/mlaunch.app/Contents/MacOS/mlaunch";
const string XamariniOSMlaunchPath = "/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch";
const string DefaultSdkRoot = "/Applications/Xcode.app/Contents/Developer";

public static readonly Version RequiredMinimumXcodeVersion = new Version (9, 0);

Expand Down Expand Up @@ -68,7 +69,8 @@ static string RunTool (string fileName, string arguments)

public static string GetXcodeSdkRoot ()
{
var sdkRoot = GetXamarinStudioXcodeSdkRoot () ?? GetXcodeSelectXcodeSdkRoot ();
// Mimicking VSmac behavior, xcode-select is checked last
var sdkRoot = GetXamarinStudioXcodeSdkRoot () ?? GetDefaultXCodeSdkRoot () ?? GetXcodeSelectXcodeSdkRoot ();
if (sdkRoot == null)
throw new Exception (Catalog.SharedStrings.XcodeNotFoundMessage);
return sdkRoot;
Expand All @@ -92,6 +94,9 @@ public static Version GetXcodeVersion (string sdkRoot)
}
}

static string GetDefaultXCodeSdkRoot ()
=> Directory.Exists (DefaultSdkRoot) ? DefaultSdkRoot : null;

static string GetXcodeSelectXcodeSdkRoot ()
{
try {
Expand Down
Loading