4 sys.path.append("../tools")
10 have_compressor = "jsmin"
14 have_compressor = "minimize"
19 sourceDirectory = "../lib"
20 configFilename = "full.cfg"
21 outputFilename = "OpenLayers.js"
24 configFilename = sys.argv[1]
25 extension = configFilename[-4:]
27 if extension != ".cfg":
28 configFilename = sys.argv[1] + ".cfg"
31 outputFilename = sys.argv[2]
33 print "Merging libraries."
34 merged = mergejs.run(sourceDirectory, None, configFilename)
35 if have_compressor == "jsmin":
36 print "Compressing using jsmin."
37 minimized = jsmin.jsmin(merged)
38 elif have_compressor == "minimize":
39 print "Compressing using minimize."
40 minimized = minimize.minimize(merged)
42 print "Not compressing."
44 print "Adding license file."
45 minimized = file("license.txt").read() + minimized
47 print "Writing to %s." % outputFilename
48 file(outputFilename, "w").write(minimized)