]> git.saurik.com Git - wxWidgets.git/blobdiff - build/tools/builder.py
Changes to allow these build scripts to use python3
[wxWidgets.git] / build / tools / builder.py
index 7c067ae8a8f948155aeabae56790972cbee6dfef..a61ca3d2b28fad226021feb770ba335a13bbc8cb 100755 (executable)
@@ -18,7 +18,7 @@ def runInDir(command, dir=None, verbose=True):
 
     commandStr = " ".join(command)
     if verbose:
-        print commandStr
+        print(commandStr)
     result = os.system(commandStr)
 
     if dir:
@@ -89,17 +89,21 @@ class Builder:
 
         return self.name
 
-    def clean(self, dir=None, projectFile=None):
+    def clean(self, dir=None, projectFile=None, options=None):
         """
         dir = the directory containing the project file
         projectFile = Some formats need to explicitly specify the project file's name
         """
-        
-        args = [self.getProgramPath(), "clean"]
-        if dir:
-            args.append(dir)
         if self.isAvailable():
-            result = runInDir(args)
+            if options:
+                optionList = list(options)
+            else:
+                optionList = []
+
+            optionList.insert(0, self.getProgramPath())
+            optionList.append("clean")
+        
+            result = runInDir(optionList, dir)
             return result
 
         return False
@@ -141,8 +145,8 @@ class GNUMakeBuilder(Builder):
         Builder.__init__(self, commandName=commandName, formatName=formatName)
 
 
-class XCodeBuilder(Builder):
-    def __init__(self, commandName="xcodebuild", formatName="XCode"):
+class XcodeBuilder(Builder):
+    def __init__(self, commandName="xcodebuild", formatName="Xcode"):
         Builder.__init__(self, commandName=commandName, formatName=formatName)
 
 
@@ -177,7 +181,7 @@ class AutoconfBuilder(GNUMakeBuilder):
 
         optionsStr = string.join(options, " ") if options else ""
         command = "%s %s" % (configure_cmd, optionsStr)
-        print command
+        print(command)
         result = os.system(command)
         #os.chdir(olddir)
         return result
@@ -200,7 +204,7 @@ class MSVCProjectBuilder(Builder):
         Builder.__init__(self, commandName="VCExpress.exe", formatName="msvcProject")
         for key in ["VS90COMNTOOLS", "VC80COMNTOOLS", "VC71COMNTOOLS"]:
             if os.environ.has_key(key):
-                self.prgoramDir = os.path.join(os.environ[key], "..", "IDE")
+                self.programDir = os.path.join(os.environ[key], "..", "IDE")
 
         if self.programDir == None:
             for version in ["9.0", "8", ".NET 2003"]:
@@ -223,7 +227,7 @@ class MSVCProjectBuilder(Builder):
 
         return False
 
-builders = [GNUMakeBuilder, XCodeBuilder, AutoconfBuilder, MSVCBuilder, MSVCProjectBuilder]
+builders = [GNUMakeBuilder, XcodeBuilder, AutoconfBuilder, MSVCBuilder, MSVCProjectBuilder]
 
 def getAvailableBuilders():
     availableBuilders = {}