Permalink
Browse files

Merge pull request #140 from sptramer/tistud-465

TISTUD-465 : Recompile debugger.plist when necessary
  • Loading branch information...
2 parents df5e5a4 + 130f684 commit eb5fc270215600916258dc3012e781059b08c7c3 @rseagraves rseagraves committed Jun 22, 2011
Showing with 16 additions and 7 deletions.
  1. +16 −7 support/iphone/builder.py
View
@@ -5,7 +5,7 @@
# the application on the device via iTunes
#
-import os, sys, uuid, subprocess, shutil, signal, string, traceback, imp
+import os, sys, uuid, subprocess, shutil, signal, string, traceback, imp, filecmp
import platform, time, re, run, glob, codecs, hashlib, datetime, plistlib
from compiler import Compiler
from projector import Projector
@@ -700,10 +700,21 @@ def write_debugger_plist(debuggerplist):
else:
plist = plist.replace('__DEBUGGER_HOST__','')
plist = plist.replace('__DEBUGGER_PORT__','')
- pf = codecs.open(debuggerplist,'w', encoding='utf-8')
+
+ tempfile = debuggerplist+'.tmp'
+ pf = codecs.open(tempfile,'w',encoding='utf-8')
pf.write(plist)
pf.close()
+ if os.path.exists(debuggerplist):
+ changed = not filecmp.cmp(tempfile, debuggerplist, shallow=False)
+ else:
+ changed = True
+
+ shutil.move(tempfile, debuggerplist)
+
+ return changed
+
# TODO:
# This code is used elsewhere, as well. We should move stuff like this to
@@ -883,11 +894,9 @@ def write_info_plist(infoplist_tmpl):
# compile debugger file
debug_plist = os.path.join(iphone_dir,'Resources','debugger.plist')
- write_debugger_plist(debug_plist)
- # Every time the debugger changes, we need to relink so that the new
- # host/port gets picked up
- if debughost:
- force_xcode = True
+
+ # Force an xcodebuild if the debugger.plist has changed
+ force_xcode = write_debugger_plist(debug_plist)
if command!='simulator':
# compile plist into binary format so it's faster to load

0 comments on commit eb5fc27

Please sign in to comment.