Michael[tm] Smith committed fd11eb4

make it possible to build and run on Windows (b=715, thx=CareyEvans)

Comments (0)

Files changed (1)

 import zipfile
 import sys
 from sgmllib import SGMLParser
+import subprocess
 javacCmd = 'javac'
 jarCmd = 'jar'
           self.leaves.append(self.baseUrl + value)    
 def runCmd(cmd):
-  if == 'nt':
-    cmd = cmd.replace('"', '')
-    print cmd
-    os.system(cmd)    
+  print cmd
+  if == 'nt' and cmd[:1] == '"':
-    print cmd
 def execCmd(cmd, args):
   print "%s %s" % (cmd, " ".join(args))
-  if os.execvp(cmd, [cmd,] + args):
-    print "Command failed."
-    sys.exit(2)
+  if == 'nt':
+    if[cmd,] + args):
+      print "Command failed."
+      sys.exit(2)
+  else:
+    if os.execvp(cmd, [cmd,] + args):
+      print "Command failed."
+      sys.exit(2)
 def removeIfExists(filePath):
   if os.path.exists(filePath):
-  runCmd('"%s" -nowarn -classpath "%s" -sourcepath "%s" -d "%s" %s'\
+  runCmd('"%s" -g -nowarn -classpath "%s" -sourcepath "%s" -d "%s" %s'\
 		% (javacCmd, classPath, sourceDir, classDir, "@temp-javac-list"))
   if pageTemplate:
     ioJar  = os.path.join("util", "dist", "io-xml-util.jar")
     pageEmitter = os.path.join("validator", "src", "nu", "validator", "servlet", "")
-    runCmd('"%s" -cp %s %s %s' % (javaCmd, ioJar, pageTemplate, pageEmitter))
+    runCmd('"%s" -classpath %s %s %s' % (javaCmd, ioJar, pageTemplate, pageEmitter))
   classPath = os.pathsep.join(dependencyJarPaths() 
                               + jarNamesToPaths(["non-schema", 
     '-Xms%sk' % heap,
     '-Xmx%sk' % heap,
-    '-cp',
+    '-classpath',
     '-Dnu.validator.servlet.log4j-properties=' + log4jProps,
   runCmd('"%s" co "%s" "%s"' % (svnCmd, svnRoot + 'build' + '/trunk/', 'build'))
   newArgv = [sys.executable, buildScript, '--no-self-update']
-  os.execv(sys.executable, newArgv)  
+  if == 'nt':
+    sys.exit(
+  else:
+    os.execv(sys.executable, newArgv)  
 def runTests():
                               + jingJarPath())
-  runCmd('"%s" -cp %s org.whattf.syntax.Driver' % (javaCmd, classPath))
+  runCmd('"%s" -classpath %s org.whattf.syntax.Driver' % (javaCmd, classPath))
 def splitHostSpec(spec):
   index = spec.find('/')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.