source:
trunk/workshop-routing-foss4g/web/proj4js/build/build.py
@
81
Revision 76, 922 bytes checked in by djay, 13 years ago (diff) | |
---|---|
|
Line | |
---|---|
1 | #!/usr/bin/env python |
2 | |
3 | import sys |
4 | sys.path.append("../tools") |
5 | |
6 | import jsmin, mergejs |
7 | |
8 | sourceDirectory = "../lib" |
9 | configFilename = "library.cfg" |
10 | filename = "proj4js-compressed.js" |
11 | outputFilename = "../lib/" + filename |
12 | |
13 | if len(sys.argv) > 1: |
14 | configFilename = sys.argv[1] |
15 | extension = configFilename[-4:] |
16 | |
17 | if extension != ".cfg": |
18 | configFilename = sys.argv[1] + ".cfg" |
19 | |
20 | if len(sys.argv) > 2: |
21 | outputFilename = sys.argv[2] |
22 | |
23 | print "Merging libraries." |
24 | merged = mergejs.run(sourceDirectory, None, configFilename) |
25 | print "Setting the filename to "+filename |
26 | merged = merged.replace('scriptName: "proj4js.js",','scriptName: "'+filename+'",'); |
27 | print "Compressing." |
28 | minimized = jsmin.jsmin(merged) |
29 | print "Adding license file." |
30 | minimized = file("license.txt").read() + minimized |
31 | |
32 | print "Writing to %s." % outputFilename |
33 | file(outputFilename, "w").write(minimized) |
34 | |
35 | print "Done." |
Note: See TracBrowser
for help on using the repository browser.