]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - bin/compile.py
tidy up autobahn support -- now requires 0.17.2
[irc/quakenet/qwebirc.git] / bin / compile.py
index 151c1ec7cb81f9a9f87e1ad092f335e7dbd76522..1f37c54763431484b1e30bf50e8db0218ea2e740 100644 (file)
@@ -11,7 +11,7 @@ class MinifyException(Exception):
   
 def jarit(src):
   try:
-    p = subprocess.Popen(["java", "-jar", "bin/yuicompressor-2.4.2.jar", src], stdout=subprocess.PIPE)
+    p = subprocess.Popen(["java", "-jar", "bin/yuicompressor-2.4.8.jar", src], stdout=subprocess.PIPE, shell=os.name == "nt")
   except Exception, e:
     if hasattr(e, "errno") and e.errno == 2:
       raise MinifyException, "unable to run java"
@@ -61,13 +61,15 @@ def merge_files(output, files, root_path=lambda x: x):
   f = open(output, "wb")
 
   for x in files:
+    if x.startswith("//"):
+      continue
     f2 = open(root_path(x), "rb")
     f.write(f2.read() + "\n")
     f2.close()
   f.close()
 
 def main(outputdir=".", produce_debug=True):
-  ID = pagegen.gethgid()
+  ID = pagegen.getgitid()
   
   pagegen.main(outputdir, produce_debug=produce_debug)
 
@@ -97,7 +99,7 @@ def main(outputdir=".", produce_debug=True):
     
     #jmerge_files(outputdir, "js", uiname, value["uifiles"], lambda x: os.path.join("js", "ui", "frontends", x + ".js"))
     
-    alljs = []
+    alljs = ["js/debugdisabled.js"]
     for y in pages.JS_BASE:
       alljs.append(os.path.join("static", "js", y + ".js"))
     for y in value.get("buildextra", []):
@@ -107,7 +109,7 @@ def main(outputdir=".", produce_debug=True):
     for y in value["uifiles"]:
       alljs.append(os.path.join("js", "ui", "frontends", y + ".js"))
     jmerge_files(outputdir, "js", uiname + "-" + ID, alljs, file_prefix="QWEBIRC_BUILD=\"" + ID + "\";\n")
-    
+
   os.rmdir(coutputdir)
   
   f = open(".compiled", "w")
@@ -139,4 +141,4 @@ def vcheck():
   
 if __name__ == "__main__":
   main()
-  
\ No newline at end of file
+