From d4548852b28e8e53fc5c142c25c1efa7dac03cf8 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 25 Apr 2016 10:53:12 -0400 Subject: [PATCH] [mmp] Fix looking up the XamMac prefix based on the mmp path. --- tools/mmp/driver.cs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/tools/mmp/driver.cs b/tools/mmp/driver.cs index 47576aced3..25d4b7106c 100644 --- a/tools/mmp/driver.cs +++ b/tools/mmp/driver.cs @@ -807,23 +807,14 @@ namespace Xamarin.Bundler { static string GetXamMacPrefix () { -#if DEBUG - // inside XS mmp is executed by mono (not mkbundle) so the "normal" code returns the Mono path - return "/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/"; -#else + var path = System.Reflection.Assembly.GetExecutingAssembly ().Location; + var envFrameworkPath = Environment.GetEnvironmentVariable ("XAMMAC_FRAMEWORK_PATH"); if (!String.IsNullOrEmpty (envFrameworkPath) && Directory.Exists (envFrameworkPath)) return envFrameworkPath; - var buffer = new byte [1024]; - var buflen = (uint) buffer.Length; - if (_NSGetExecutablePath (buffer, ref buflen) != 0) - return null; - - var path = System.Text.UTF8Encoding.UTF8.GetString (buffer, 0, (int) buflen); path = GetRealPath (path); - return Path.GetDirectoryName (Path.GetDirectoryName (path)); -#endif + return Path.GetDirectoryName (Path.GetDirectoryName (Path.GetDirectoryName (path))); } public static string DriverBinDirectory {