Exclude qtip from minified files
Exclude qtip from minified files

d3 needs to stay in because it's not amd enabled

#!/bin/bash #!/bin/bash
# #
# minify.sh # minify.sh
# #
# Minfies javascript files # Minfies javascript files
# #
# @author Christopher Han <xiphux@gmail.com> # @author Christopher Han <xiphux@gmail.com>
# @copyright Copyright (c) 2010 Christopher Han # @copyright Copyright (c) 2010 Christopher Han
# @package GitPHP # @package GitPHP
# @subpackage util # @subpackage util
# #
   
JSDIR="js" JSDIR="js"
   
JSEXT=".js" JSEXT=".js"
MINEXT=".min.js" MINEXT=".min.js"
GZEXT=".gz" GZEXT=".gz"
   
CSSDIR="css" CSSDIR="css"
CSSEXT=".css" CSSEXT=".css"
MINCSSEXT=".min.css" MINCSSEXT=".min.css"
   
rm -fv ${JSDIR}/*${MINEXT} rm -fv ${JSDIR}/*${MINEXT}
rm -fv ${CSSDIR}/*${MINCSSEXT} rm -fv ${CSSDIR}/*${MINCSSEXT}
rm -fv ${JSDIR}/*${GZEXT} rm -fv ${JSDIR}/*${GZEXT}
rm -fv ${JSDIR}/ext/*${GZEXT} rm -fv ${JSDIR}/ext/*${GZEXT}
rm -fv ${CSSDIR}/*${GZEXT} rm -fv ${CSSDIR}/*${GZEXT}
rm -fv ${CSSDIR}/ext/*${GZEXT} rm -fv ${CSSDIR}/ext/*${GZEXT}
   
if [ "$1" == "clean" ]; then if [ "$1" == "clean" ]; then
exit; exit;
fi fi
   
for i in ${JSDIR}/*${JSEXT}; do for i in ${JSDIR}/*${JSEXT}; do
echo "Minifying ${i}..." echo "Minifying ${i}..."
JSMODULE="`basename ${i%$JSEXT}`" JSMODULE="`basename ${i%$JSEXT}`"
java -classpath lib/rhino/js.jar:lib/closure/compiler.jar org.mozilla.javascript.tools.shell.Main lib/requirejs/r.js -o name=${JSMODULE} out=${JSDIR}/${JSMODULE}${MINEXT} baseUrl=${JSDIR} paths.jquery="empty:" paths.qtip="ext/jquery.qtip.min" paths.d3="ext/d3.v2.min" optimize="closure" java -classpath lib/rhino/js.jar:lib/closure/compiler.jar org.mozilla.javascript.tools.shell.Main lib/requirejs/r.js -o name=${JSMODULE} out=${JSDIR}/${JSMODULE}${MINEXT} baseUrl=${JSDIR} paths.jquery="empty:" paths.qtip="empty:" paths.d3="ext/d3.v2.min" optimize="closure"
done done
   
for i in ${CSSDIR}/*${CSSEXT}; do for i in ${CSSDIR}/*${CSSEXT}; do
echo "Minifying ${i}..." echo "Minifying ${i}..."
CSSBASE=${i%$CSSEXT} CSSBASE=${i%$CSSEXT}
java -classpath lib/rhino/js.jar org.mozilla.javascript.tools.shell.Main lib/requirejs/r.js -o cssIn=${i} out=${CSSBASE}${MINCSSEXT} optimizeCss="standard" java -classpath lib/rhino/js.jar org.mozilla.javascript.tools.shell.Main lib/requirejs/r.js -o cssIn=${i} out=${CSSBASE}${MINCSSEXT} optimizeCss="standard"
done done
   
for i in ${JSDIR}/*${MINEXT}; do for i in ${JSDIR}/*${MINEXT}; do
gzip -v -c ${i} > ${i}${GZEXT} gzip -v -c ${i} > ${i}${GZEXT}
touch ${i} ${i}${GZEXT} touch ${i} ${i}${GZEXT}
done done
   
for i in ${JSDIR}/ext/jquery-*${MINEXT}; do for i in ${JSDIR}/ext/jquery*${MINEXT}; do
gzip -v -c ${i} > ${i}${GZEXT} gzip -v -c ${i} > ${i}${GZEXT}
touch ${i} ${i}${GZEXT} touch ${i} ${i}${GZEXT}
done done
   
gzip -v -c ${JSDIR}/ext/require.js > ${JSDIR}/ext/require.js${GZEXT} gzip -v -c ${JSDIR}/ext/require.js > ${JSDIR}/ext/require.js${GZEXT}
touch ${JSDIR}/ext/require.js ${JSDIR}/ext/require.js${GZEXT} touch ${JSDIR}/ext/require.js ${JSDIR}/ext/require.js${GZEXT}
   
for i in ${CSSDIR}/*${MINCSSEXT}; do for i in ${CSSDIR}/*${MINCSSEXT}; do
gzip -v -c ${i} > ${i}${GZEXT} gzip -v -c ${i} > ${i}${GZEXT}
touch ${i} ${i}${GZEXT} touch ${i} ${i}${GZEXT}
done done
   
gzip -v -c ${CSSDIR}/ext/jquery.qtip.min.css > ${CSSDIR}/ext/jquery.qtip.min.css${GZEXT} gzip -v -c ${CSSDIR}/ext/jquery.qtip.min.css > ${CSSDIR}/ext/jquery.qtip.min.css${GZEXT}
touch ${CSSDIR}/ext/jquery.qtip.min.css ${CSSDIR}/ext/jquery.qtip.min.css${GZEXT} touch ${CSSDIR}/ext/jquery.qtip.min.css ${CSSDIR}/ext/jquery.qtip.min.css${GZEXT}
   
comments