Skip to content

Commit

Permalink
Updated the minify code to not need to change when the number of js f…
Browse files Browse the repository at this point in the history
…iles changes; minify now copies the latest versions to a file with _latest in the title; the read me file's version numbers are updated automatically; the allowable version numbers now can contain an "a" or a "b" so that alpha and beta versions can be specified.
  • Loading branch information
paulrosen committed Jul 12, 2014
1 parent efd073c commit ef31061
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions minify.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ die () {
}

[ "$#" -eq 1 ] || die "Call with a version number argument in the form x.y"
echo $1 | grep -E -q '^[1-9]\.[0-9]+$' || die "Version number argument required (x.y), $1 provided"
echo $1 | grep -E -q '^[1-9]\.[0-9ab]+$' || die "Version number argument required (x.y), $1 provided"
echo "Concatenating all files..."
cat parse/abc_common.js parse/abc_parse.js parse/abc_parse_directive.js parse/abc_parse_header.js parse/abc_parse_key_voice.js parse/abc_tokenizer.js > tmp/parse.js
cat write/abc_glyphs.js write/abc_graphelements.js write/abc_layout.js write/abc_write.js write/sprintf.js > tmp/write.js
cat api/abc_tunebook.js data/abc_tune.js midi/abc_midiwriter.js tmp/parse.js tmp/write.js > tmp/abcjs-noraphael.js
cat write/raphael.js tmp/abcjs-noraphael.js > tmp/abcjs_all.js
cat tmp/abcjs_all.js edit/abc_editor.js > tmp/abcjs_editor.js
cat tmp/abcjs-noraphael.js edit/abc_editor.js > tmp/abcjs_editor-noraphael.js
cat parse/*.js write/*.js > tmp/parse.js
cat api/*.js data/*.js midi/*.js parse/*.js write/*.js > tmp/abcjs-noraphael.js
cat raphael.js tmp/abcjs-noraphael.js > tmp/abcjs_all.js
cat tmp/abcjs_all.js edit/*.js > tmp/abcjs_editor.js
cat tmp/abcjs-noraphael.js edit/*.js > tmp/abcjs_editor-noraphael.js
cat tmp/abcjs-noraphael.js plugin/abc_plugin.js > tmp/abcjs_plugin-noraphael.js
cat tmp/abcjs_all.js plugin/abc_plugin.js > tmp/abcjs_plugin.js
echo "Compressing basic..."
Expand All @@ -24,6 +23,13 @@ java -jar yuicompressor-2.4.2.jar --line-break 7000 -o bin/abcjs_editor_norapha
echo "Compressing plugin..."
java -jar yuicompressor-2.4.2.jar --line-break 7000 -o bin/abcjs_plugin_noraphael_nojquery_$1-min.js tmp/abcjs_plugin-noraphael.js
java -jar yuicompressor-2.4.2.jar --line-break 7000 -o bin/abcjs_plugin_nojquery_$1-min.js tmp/abcjs_plugin.js
cat jquery-1.10.2.min.js bin/abcjs_plugin_nojquery_$1-min.js > bin/abcjs_plugin_$1-min.js
cat jquery-1.11.1.min.js bin/abcjs_plugin_nojquery_$1-min.js > bin/abcjs_plugin_$1-min.js
cat plugin/greasemonkey.js bin/abcjs_plugin_$1-min.js > bin/abcjs_plugin_$1.user.js
echo "Creating latest..."
cp bin/abcjs_basic_$1-min.js bin/abcjs_basic_latest-min.js
cp bin/abcjs_editor_$1-min.js bin/abcjs_editor_latest-min.js
cp bin/abcjs_plugin_$1-min.js bin/abcjs_plugin_latest-min.js
echo "Fix readme..."
perl -pi -e "s/abcjs_(.+)_1([^-]+)-min.js/abcjs_\$1_$1-min.js/" README.md
perl -pi -e "s/abcjs_(.+)_1([^-]+).user.js/abcjs_\$1_$1.user.js/" README.md

0 comments on commit ef31061

Please sign in to comment.