[OpenLayers-Commits] r12408 - trunk/openlayers/build

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Tue Sep 20 23:16:41 EDT 2011


Author: openlayersgit
Date: 2011-09-20 20:16:39 -0700 (Tue, 20 Sep 2011)
New Revision: 12408

Modified:
   trunk/openlayers/build/build.py
Log:
Modify build script to support minimizing with jsmin before passing to closure
webservice for closure_ws. (Closes #3422)

Modified: trunk/openlayers/build/build.py
===================================================================
--- trunk/openlayers/build/build.py	2011-09-21 03:16:33 UTC (rev 12407)
+++ trunk/openlayers/build/build.py	2011-09-21 03:16:39 UTC (rev 12408)
@@ -55,7 +55,20 @@
     elif use_compressor == "minimize":
         minimized = minimize.minimize(merged)
     elif use_compressor == "closure_ws":
-        minimized = closure_ws.minimize(merged)      
+        if len(merged) > 1000000: # The maximum file size for this web service is 1000 KB.
+            print "\nPre-compressing using jsmin"
+            merged = jsmin.jsmin(merged)
+        print "\nIs being compressed using Closure Compiler Service."
+        try:
+            minimized = closure_ws.minimize(merged)
+        except Exception, E:
+            print "\nAbnormal termination."
+            sys.exit("ERROR: Closure Compilation using Web service failed!\n%s" % E)
+        if len(minimized) <= 2:
+            print "\nAbnormal termination due to compilation errors."
+            sys.exit("ERROR: Closure Compilation using Web service failed!")
+        else:
+            print '\nClosure Compilation using Web service has completed successfully.'
     elif use_compressor == "closure":
         minimized = closure.minimize(merged)      
     else: # fallback



More information about the Commits mailing list