aboutsummaryrefslogtreecommitdiff
path: root/tools/shared.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-12-20 07:25:24 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-12-20 07:25:24 -0800
commit62d5c159873ad08a4f3ec35074b2cdc7a3c46455 (patch)
tree2b04bbb16edc148cc77d98f76c3f002c59b876d4 /tools/shared.py
parentd95f029c7cc148a10f52a6bd1026b78f9935b947 (diff)
parent2f3cb58579bbca6645b144de339b73c19f37abed (diff)
Merge branch 'incoming'
Diffstat (limited to 'tools/shared.py')
-rw-r--r--tools/shared.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/shared.py b/tools/shared.py
index 1366f6fd..5b238aa4 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -563,7 +563,8 @@ class Building:
if type(passes) == str:
passes = [passes]
input = open(filename, 'r').read()
- output = Popen([NODE_JS, JS_OPTIMIZER] + passes, stdin=PIPE, stdout=PIPE).communicate(input)[0]
+ output, err = Popen([NODE_JS, JS_OPTIMIZER] + passes, stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate(input)
+ assert len(output) > 0, 'Error in js optimizer: ' + err + '\n\n' + output
filename += '.jo.js'
f = open(filename, 'w')
f.write(output)
@@ -578,7 +579,8 @@ class Building:
coffee = path_from_root('tools', 'eliminator', 'node_modules', 'coffee-script', 'bin', 'coffee')
eliminator = path_from_root('tools', 'eliminator', 'eliminator.coffee')
input = open(filename, 'r').read()
- output = Popen([coffee, eliminator], stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate(input)[0]
+ output, err = Popen([coffee, eliminator], stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate(input)
+ assert len(output) > 0, 'Error in eliminator: ' + err + '\n\n' + output
filename += '.el.js'
f = open(filename, 'w')
f.write(output)
@@ -597,8 +599,8 @@ class Building:
#'--formatting', 'PRETTY_PRINT',
#'--variable_map_output_file', filename + '.vars',
'--js', filename, '--js_output_file', filename + '.cc.js'], stdout=PIPE, stderr=STDOUT).communicate()[0]
- if 'ERROR' in cc_output:
- raise Exception('Error in cc output: ' + cc_output)
+ if 'ERROR' in cc_output or not os.path.exists(filename + '.cc.js'):
+ raise Exception('closure compiler error: ' + cc_output)
return filename + '.cc.js'