aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Karneges <justin@affinix.com>2013-01-30 17:41:57 -0800
committerJustin Karneges <justin@affinix.com>2013-01-30 17:41:57 -0800
commitc75ea0700ef944957051114cb347f8090249268d (patch)
treef924f8fc82ffc5b7019f20a2fa740c656ff34cf7
parent03689f1cc5b4ad2b77acc1d08222987f7930fffc (diff)
downloadpollymer-c75ea0700ef944957051114cb347f8090249268d.tar
pollymer-c75ea0700ef944957051114cb347f8090249268d.tar.gz
build files
-rw-r--r--Makefile16
-rwxr-xr-xcompile.py26
2 files changed, 42 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0767e67
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,16 @@
+VERSION = 1.0.0
+
+all: dist
+
+distclean:
+ rm -f polldance-$(VERSION).js polldance-$(VERSION).min.js
+
+clean:
+
+dist: polldance-$(VERSION).min.js
+
+polldance-$(VERSION).js: polldance.js
+ cp polldance.js polldance-$(VERSION).js
+
+polldance-$(VERSION).min.js: polldance-$(VERSION).js
+ ./compile.py polldance-$(VERSION).js > polldance-$(VERSION).min.js
diff --git a/compile.py b/compile.py
new file mode 100755
index 0000000..28247eb
--- /dev/null
+++ b/compile.py
@@ -0,0 +1,26 @@
+#!/usr/bin/python
+
+import httplib, urllib, sys
+
+# Define the parameters for the POST request and encode them in
+# a URL-safe format.
+
+file = open(sys.argv[1])
+js_code = file.read()
+file.close()
+
+params = urllib.urlencode([
+ ('js_code', js_code),
+ ('compilation_level', 'SIMPLE_OPTIMIZATIONS'),
+ ('output_format', 'text'),
+ ('output_info', 'compiled_code'),
+ ])
+
+# Always use the following value for the Content-type header.
+headers = { "Content-type": "application/x-www-form-urlencoded" }
+conn = httplib.HTTPConnection('closure-compiler.appspot.com')
+conn.request('POST', '/compile', params, headers)
+response = conn.getresponse()
+data = response.read()
+print data
+conn.close()