[cfe-commits] r95675 - /cfe/trunk/tools/scan-build/set-xcode-analyzer

Ted Kremenek kremenek at apple.com
Tue Feb 9 10:46:58 PST 2010


Author: kremenek
Date: Tue Feb  9 12:46:58 2010
New Revision: 95675

URL: http://llvm.org/viewvc/llvm-project?rev=95675&view=rev
Log:
Add a check for a running Xcode before modifying its configuration files.

Modified:
    cfe/trunk/tools/scan-build/set-xcode-analyzer

Modified: cfe/trunk/tools/scan-build/set-xcode-analyzer
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/set-xcode-analyzer?rev=95675&r1=95674&r2=95675&view=diff

==============================================================================
--- cfe/trunk/tools/scan-build/set-xcode-analyzer (original)
+++ cfe/trunk/tools/scan-build/set-xcode-analyzer Tue Feb  9 12:46:58 2010
@@ -6,6 +6,7 @@
 import tempfile
 import shutil
 import stat
+from AppKit import *
 
 def FindClangSpecs(path):
   for root, dirs, files in os.walk(path):
@@ -50,6 +51,12 @@
   if options.path is None and options.default is None:
     parser.error("You must specify a version of Clang to use for static analysis.  Specify '-h' for details")
 
+  # determine if Xcode is running
+  for x in NSWorkspace.sharedWorkspace().runningApplications():
+    if x.localizedName().find("Xcode") >= 0:
+      print "You must quit Xcode first before modifying its configuration files."
+      return
+
   if options.path:
     # Expand tildes.
     path = os.path.expanduser(options.path)
@@ -61,8 +68,8 @@
   else:
     print "Using the Clang bundled with Xcode"
     path = options.default
-
   print ""
+  
   for x in FindClangSpecs('/Developer'):
     ModifySpec(x, path)
 





More information about the cfe-commits mailing list