#!/bin/bash # # Google Closure Tools installer # # Documentation: https://developers.google.com/closure/ # INSTALL_PATH=/usr/local/share #just in case mkdir -p $INSTALL_PATH # closure-compiler echo 'retrieving closure compiler' svn checkout http://closure-compiler.googlecode.com/svn/trunk/ $INSTALL_PATH/closure-compiler cd $INSTALL_PATH/closure-compiler echo 'installing compiler' ant jar # closure-library echo 'retrieving closure library' svn checkout http://closure-library.googlecode.com/svn/trunk/ $INSTALL_PATH/closure-library echo 'installing closure library' ln -s $INSTALL_PATH/closure-library/closure/bin/build/closurebuilder.py /usr/local/bin/closurebuilder.py # closure-templates echo 'retrieving closure templates' svn checkout http://closure-templates.googlecode.com/svn/trunk/ $INSTALL_PATH/closure-templates cd $INSTALL_PATH/closure-templates echo 'installing SoyToJsSrcCompiler' ant SoyToJsSrcCompiler # closure-stylesheets echo 'retrieving closure stylesheets' git clone https://code.google.com/p/closure-stylesheets/ $INSTALL_PATH/closure-stylesheets cd $INSTALL_PATH/closure-stylesheets echo 'installing closure-stylesheets' ant # shortcuts to closure compilers # gss > output.css # soytojs --outputPathFormat path/to/file.js input.js echo "java -jar $INSTALL_PATH/closure-stylesheets/build/closure-stylesheets.jar \$@" > /usr/local/bin/gss echo "java -jar $INSTALL_PATH/closure-templates/build/SoyToJsSrcCompiler.jar \$@" > /usr/local/bin/soytojs chmod u+x /usr/local/bin/gss chmod u+x /usr/local/bin/soytojs echo 'install complete.'