* 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
23 lines
568 B
Python
23 lines
568 B
Python
import sys
|
|
import os
|
|
import tempfile
|
|
|
|
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(delete=False)
|
|
ntf.write(code)
|
|
ntf.flush()
|
|
|
|
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
|