Merge pull request #184 from kberg/master
[dygraphs.git] / generate-combined.sh
1 #!/bin/bash
2 # Generates a single JS file that's easier to include.
3
4 # Pack all the JS together.
5
6 # This list needs to be kept in sync w/ the one in dygraph-dev.js
7 # and the one in jsTestDriver.conf.
8 cat \
9 dygraph-layout.js \
10 dygraph-canvas.js \
11 dygraph.js \
12 dygraph-utils.js \
13 dygraph-gviz.js \
14 dygraph-interaction-model.js \
15 dygraph-range-selector.js \
16 dygraph-tickers.js \
17 rgbcolor/rgbcolor.js \
18 strftime/strftime-min.js \
19 dashed-canvas.js \
20 plugins/base.js \
21 plugins/annotations.js \
22 plugins/axes.js \
23 plugins/chart-labels.js \
24 plugins/grid.js \
25 plugins/legend.js \
26 plugins/install.js \
27 | perl -ne 'print unless m,REMOVE_FOR_COMBINED,..m,/REMOVE_FOR_COMBINED,' \
28 > /tmp/dygraph.js
29
30 java -jar yuicompressor-2.4.2.jar /tmp/dygraph.js \
31 > /tmp/dygraph-packed.js
32
33 (
34 echo '/*! @license Copyright 2011 Dan Vanderkam (danvdk@gmail.com) MIT-licensed (http://opensource.org/licenses/MIT) */'
35 cat /tmp/dygraph-packed.js
36 ) > dygraph-combined.js
37 chmod a+r dygraph-combined.js