Integrated Google compiler into xCAT-UI build.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8885 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
phamt 2011-02-17 15:23:58 +00:00
parent 84a547506b
commit 9897773e99

View File

@ -28,6 +28,28 @@ else
else
pkg="packages"
fi
# Minify Javascript files using Google Compiler
JAVA='/opt/ibm/java-ppc64-60/jre/bin/java'
JAR='/xcat2/build/tools/compiler.jar'
UI='xCAT-UI/js'
declare -a FILES
IFS='
'
# Find all Javascript files
FILES=(`find ${UI} -name '*.js'`)
for i in ${FILES[*]}; do
# Ignore Javascripts that are already minified
if [[ ! $i =~ '.*\.min\.js$' ]]; then
`${JAVA} -jar ${JAR} --warning_level=QUIET --js=$i --js_output_file=$i.min`
# Remove old Javascript and replace it with minified version
rm -rf $i
mv $i.min $i
fi
done
set -x
tar --exclude=.svn -czf /usr/src/$pkg/SOURCES/xCAT-UI-$VER.tar.gz xCAT-UI