Pulling in patches for OL 2.11 RC3:
* ArcGISCache resolutions get compromised by some JS frameworks. (Closes #3474) * OpenLayers.Layer.HTTPRequest initialize simplification (Closes #3470) * missing requires (Closes #3467) * deleting a vertex does not update feature.modified (Closes #3463) * fixing test failure in some browsers (Closes #3461) * a grid layer may be moved while its grid hasn't been initialized yet (Closes #3458) -- this one is the actual release blocker * Change the callback function of Protocol.Script (JSONP) (Closes #3417) * "build.py -c closure" does not work on Windows systems. (Closes #3158) git-svn-id: http://svn.openlayers.org/branches/openlayers/2.11@12274 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -2,20 +2,21 @@ import sys
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
path = os.path.abspath(os.path.join(os.path.dirname(__file__), "closure-compiler.jar"))
|
||||
path = "../tools/closure-compiler.jar"
|
||||
if not os.path.exists(path):
|
||||
raise Exception("No closure-compiler.jar at %s; read README.txt!" % path)
|
||||
|
||||
def minimize(code):
|
||||
ntf = tempfile.NamedTemporaryFile()
|
||||
ntf = tempfile.NamedTemporaryFile(delete=False)
|
||||
ntf.write(code)
|
||||
ntf.flush()
|
||||
|
||||
ntf2 = tempfile.NamedTemporaryFile()
|
||||
|
||||
os.system("java -jar %s --js %s --js_output_file %s" % (path, ntf.name, ntf2.name))
|
||||
ntf2.seek(0)
|
||||
data = ntf2.read()
|
||||
ntf2 = tempfile.NamedTemporaryFile(delete=False)
|
||||
ntf.close()
|
||||
ntf2.close()
|
||||
|
||||
os.system("java -jar %s --js %s --js_output_file %s" % (path, ntf.name, ntf2.name))
|
||||
data = open(ntf2.name).read()
|
||||
os.unlink(ntf.name)
|
||||
os.unlink(ntf2.name)
|
||||
return data
|
||||
|
||||
Reference in New Issue
Block a user