Nit comment resolution for pull request 271 (making connectSeparatedPoints per-series...
[dygraphs.git] / generate-combined.sh
CommitLineData
6a1aa64f
DV
1#!/bin/bash
2# Generates a single JS file that's easier to include.
43f15770 3
1beeb310
KW
4GetSources () {
5 # This list needs to be kept in sync w/ the one in dygraph-dev.js
6 # and the one in jsTestDriver.conf. Order matters, except for the plugins.
7 for F in \
8 strftime/strftime-min.js \
9 rgbcolor/rgbcolor.js \
10 stacktrace.js \
11 dashed-canvas.js \
12 dygraph-options.js \
13 dygraph-layout.js \
14 dygraph-canvas.js \
15 dygraph.js \
16 dygraph-utils.js \
17 dygraph-gviz.js \
18 dygraph-interaction-model.js \
19 dygraph-tickers.js \
20 dygraph-plugin-base.js \
21 plugins/*.js \
a49c164a
DE
22 dygraph-plugin-install.js \
23 datahandler/datahandler.js \
24 datahandler/default.js \
25 datahandler/default-fractions.js \
26 datahandler/bars.js \
27 datahandler/bars-custom.js \
28 datahandler/bars-error.js \
29 datahandler/bars-fractions.js
1beeb310
KW
30 do
31 echo "$F"
32 done
33}
34
74a5af31 35# Pack all the JS together.
1beeb310
KW
36CatSources () {
37 GetSources \
38 | xargs cat \
39 | perl -ne 'print unless m,REMOVE_FOR_COMBINED,..m,/REMOVE_FOR_COMBINED,'
40}
74a5af31 41
1beeb310
KW
42Copyright () {
43 echo '/*! @license Copyright 2011 Dan Vanderkam (danvdk@gmail.com) MIT-licensed (http://opensource.org/licenses/MIT) */'
44}
b2a516b8 45
1beeb310
KW
46CatCompressed () {
47 Copyright
48 CatSources \
49 | java -jar yuicompressor-2.4.2.jar --type js
50}
b2a516b8 51
1beeb310
KW
52ACTION="${1:-update}"
53case "$ACTION" in
54ls)
55 GetSources
56 ;;
57cat)
58 Copyright
59 CatSources
60 ;;
61compress*|cat_compress*)
62 CatCompressed
63 ;;
64update)
806e1ea5
DV
65 CatCompressed > dygraph-combined.js
66 chmod a+r dygraph-combined.js
1beeb310
KW
67 ;;
68*)
69 echo >&2 "Unknown action '$ACTION'"
70 exit 1
71 ;;
72esac