From: phasefx Date: Mon, 16 Nov 2009 08:19:44 +0000 (+0000) Subject: google closure compiler: experiment with compressing staff client javascript X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=192170ed0a62bc5f77271f2557b7029153e7ec3c;p=evergreen%2Fmasslnc.git google closure compiler: experiment with compressing staff client javascript git-svn-id: svn://svn.open-ils.org/ILS/trunk@14918 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/Makefile.am b/Open-ILS/xul/staff_client/Makefile.am index cef6f877e3..d440c8360f 100644 --- a/Open-ILS/xul/staff_client/Makefile.am +++ b/Open-ILS/xul/staff_client/Makefile.am @@ -5,6 +5,9 @@ export STAFF_CLIENT_BUILD_ID = $$(/bin/cat build/BUILD_ID) +# from http://closure-compiler.googlecode.com/files/compiler-latest.zip FIXME: Autotools this? +export CLOSURE_COMPILER_JAR = ~/closure-compiler/compiler.jar + OPENSRF_JSLIBS = "$(OPENSRF_LIBS)/javascript" CHROME_LOCALES = $$(ls -1 chrome/locale) SKIN_CSS = $$(ls -1 server/skin/*css | sed -e "s/.css/_custom.css/") @@ -96,3 +99,14 @@ server-xul: build @echo "Copying xul into $(WEBDIR)/xul/$(STAFF_CLIENT_BUILD_ID)" mkdir -p "$(WEBDIR)/xul/$(STAFF_CLIENT_BUILD_ID)" cp -R @top_srcdir@/Open-ILS/xul/staff_client/build/server "${WEBDIR}/xul/${STAFF_CLIENT_BUILD_ID}/" + +compress-javascript: build + @echo "Size of build/ before compression = " `du -sh build/` + @echo " * Running Google's Closure Compiler against javascript. Errors in build/compression.err" + @external/closure_compiler.sh $(CLOSURE_COMPILER_JAR) 2>> build/compression.err + @echo `find build/ -name '*.js~' -size 0 -print | wc -l` compression failures + @find build/ -name '*.js~' -size 0 -exec rm {} \; # remove the output files for those that did not compile + @echo `find build/ -name '*.js~' -print | wc -l` compression successes + @find build/ -name '*.js~' -exec perl -e '$$a = "{}"; chop $$a; `mv $$a~ $$a`;' \; + @echo "Size of build/ (minus compression.err) after compression = " `du -sh --exclude compression.err build/` +