Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

adding some initial scripts

  • Loading branch information...
commit cb11855406c6043c1b6f89587b200d6f22469c5a 1 parent 60a510c
Aaron Bedra abedra authored
1  .gitignore
@@ -2,3 +2,4 @@
2 2 .idea
3 3 /.DS_Store
4 4 /classes
  5 +closure
16 script/bootstrap
... ... @@ -0,0 +1,16 @@
  1 +#!/bin/sh
  2 +
  3 +echo "Fetching Google Closure Library..."
  4 +mkdir -p closure/library
  5 +cd closure/library
  6 +curl -O -s http://closure-library.googlecode.com/files/closure-library-20110323-r790.zip
  7 +unzip -q closure-library-20110323-r790.zip
  8 +rm closure-library-20110323-r790.zip
  9 +cd ..
  10 +echo "Fetching Google Closure Compiler..."
  11 +mkdir compiler
  12 +cd compiler
  13 +curl -O -s http://closure-compiler.googlecode.com/files/compiler-latest.zip
  14 +unzip -q compiler-latest.zip
  15 +rm compiler-latest.zip
  16 +cd ../..
4 script/clean
... ... @@ -0,0 +1,4 @@
  1 +#!/bin/sh
  2 +
  3 +rm -rf closure
  4 +rm -rf compilation
30 script/test-compile
... ... @@ -0,0 +1,30 @@
  1 +#!/bin/sh
  2 +
  3 +echo "Generating sample javascript"
  4 +mkdir compilation
  5 +
  6 +cat <<EOF > compilation/test.js
  7 +function create_alert(msg) {
  8 + alert(msg);
  9 +}
  10 +EOF
  11 +
  12 +echo "Testing compilation"
  13 +cd compilation
  14 +for file in *
  15 +do
  16 + if [ -f $file ] ; then
  17 + name=${file%\.*}
  18 + java -jar ../closure/compiler/compiler.jar --js $file --js_output_file $name-compiled.js
  19 + fi
  20 +done
  21 +cd ..
  22 +
  23 +echo "\nOriginal:"
  24 +cat compilation/test.js
  25 +
  26 +echo "\nOptimized:"
  27 +cat compilation/test-compiled.js
  28 +
  29 +echo "\nCleaning up"
  30 +rm -rf compilation

0 comments on commit cb11855

Please sign in to comment.
Something went wrong with that request. Please try again.