diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2011-11-23 16:23:33 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2011-11-23 16:23:33 +0400 |
commit | 9c472fca08b0e4de8d31b29c754d2fe0169d2fb8 (patch) | |
tree | 2fcb0fffd13d02bec5230b20180ba9fc6c22792d /main/src/addins/MonoDevelop.MacDev | |
parent | 2bd1ac28879660f0a6ad2ec39cf7f816ff286a76 (diff) | |
parent | d823430f7f983497176c5677e284c88ec41e0304 (diff) |
Merge branch 'master' into newresolver
Diffstat (limited to 'main/src/addins/MonoDevelop.MacDev')
3 files changed, 50 insertions, 41 deletions
diff --git a/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeMonitor.cs b/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeMonitor.cs index 5271cf1908..ee52421f36 100644 --- a/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeMonitor.cs +++ b/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeMonitor.cs @@ -46,7 +46,7 @@ namespace MonoDevelop.MacDev.XcodeSyncing class XcodeMonitor { FilePath originalProjectDir; - int nextHackDir = 0; + static int nextHackDir = 0; string name; FilePath xcproj, projectDir; @@ -124,6 +124,7 @@ namespace MonoDevelop.MacDev.XcodeSyncing if (removedOldProject) { HackRelocateProject (); + ctx.ProjectDir = projectDir; } foreach (var item in items) { @@ -142,6 +143,7 @@ namespace MonoDevelop.MacDev.XcodeSyncing pendingProjectWrite = emptyProject; } + OpenProject (); monitor.EndTask (); monitor.ReportSuccess (GettextCatalog.GetString ("Xcode project updated.")); } @@ -275,12 +277,6 @@ namespace MonoDevelop.MacDev.XcodeSyncing } } - public void OpenProject () - { - SyncProject (); - AppleScript.Run (XCODE_OPEN_PROJECT, AppleSdkSettings.XcodePath, xcproj); - } - public void OpenFile (string relativeName) { XC4Debug.Log ("Opening file in Xcode: {0}", relativeName); @@ -341,6 +337,14 @@ namespace MonoDevelop.MacDev.XcodeSyncing return success; } + public bool OpenProject () + { + SyncProject (); + var success = AppleScript.Run (XCODE_OPEN_PROJECT, AppleSdkSettings.XcodePath, projectDir) == "true"; + XC4Debug.Log ("Opening project: {0}", success); + return success; + } + public bool CloseFile (string fileName) { if (!CheckRunning ()) @@ -350,8 +354,8 @@ namespace MonoDevelop.MacDev.XcodeSyncing XC4Debug.Log ("Closing file {0}: {1}", fileName, success); return success; } - - const string XCODE_OPEN_PROJECT = + + const string XCODE_OPEN_PROJECT = @"tell application ""{0}"" activate open ""{1}"" @@ -366,45 +370,51 @@ end tell"; const string XCODE_SAVE_IN_PATH = @"tell application ""{0}"" - set pp to ""{1}"" - set ext to {{ "".storyboard"", "".xib"", "".h"", "".m"" }} - repeat with d in documents - if d is modified then - set f to path of d - if f starts with pp then - repeat with e in ext - if f ends with e then - save d - exit repeat - end if - end repeat + if it is running then + set pp to ""{1}"" + set ext to {{ "".storyboard"", "".xib"", "".h"", "".m"" }} + repeat with d in documents + if d is modified then + set f to path of d + if f starts with pp then + repeat with e in ext + if f ends with e then + save d + exit repeat + end if + end repeat + end if end if - end if - end repeat + end repeat + end if end tell"; const string XCODE_CLOSE_IN_PATH = @"tell application ""{0}"" - set pp to ""{1}"" - repeat with d in documents - set f to path of d - if f starts with pp then - close d - return true - end if - end repeat + if it is running then + set pp to ""{1}"" + repeat with d in documents + set f to path of d + if f starts with pp then + close d + return true + end if + end repeat + end if return false end tell"; const string XCODE_CHECK_PROJECT_OPEN = @"tell application ""{0}"" - set pp to ""{1}"" - repeat with p in projects - if real path of p is pp then - return true - exit repeat - end if - end repeat + if it is running then + set pp to ""{1}"" + repeat with p in projects + if real path of p is pp then + return true + exit repeat + end if + end repeat + end if return false end tell"; } diff --git a/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs b/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs index 02c06f5294..2592587be4 100644 --- a/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs +++ b/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs @@ -249,7 +249,6 @@ namespace MonoDevelop.MacDev.XcodeSyncing continue; if (finf.ProjectFile.BuildAction == BuildAction.Compile) { updateTypes = true; - break; } else if (IncludeInSyncedProject (finf.ProjectFile)) { updateProject = true; } @@ -259,7 +258,7 @@ namespace MonoDevelop.MacDev.XcodeSyncing using (var monitor = GetStatusMonitor (GettextCatalog.GetString ("Syncing to Xcode..."))) { //FIXME: make this async (and safely async) //FIXME: only update the project if obj-c types change - updateProject = UpdateTypes (monitor, true); + updateProject |= UpdateTypes (monitor, true); } } diff --git a/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeSyncContext.cs b/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeSyncContext.cs index a39fe1227c..6303d0457c 100644 --- a/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeSyncContext.cs +++ b/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeSyncContext.cs @@ -47,7 +47,7 @@ namespace MonoDevelop.MacDev.XcodeSyncing this.syncTimes = syncTimes; } - public FilePath ProjectDir { get; private set; } + public FilePath ProjectDir { get; set; } public DateTime GetSyncTime (string relativeFilename) { |