build.py -c closure: generate an error of undefined variables

This commit is contained in:
Xavier Mamano
2011-12-03 17:07:10 +01:00
parent d83a96b169
commit 1a5e57a32f
3 changed files with 77 additions and 1 deletions

View File

@@ -14,7 +14,12 @@ def minimize(code):
ntf2 = tempfile.NamedTemporaryFile()
ntf2.close()
os.system("java -jar %s --js %s --js_output_file %s" % (path, ntf.name, ntf2.name))
os.system(("java -jar %s --js %s --js_output_file %s" +
" --externs closure-compiler/Externs.js" +
" --externs closure-compiler/errors-pending-to-fix.js" +
" --jscomp_warning checkVars" +
" --jscomp_error checkRegExp" +
" --jscomp_error undefinedVars") % (path, ntf.name, ntf2.name))
data = open(ntf2.name).read()
os.unlink(ntf.name)
os.unlink(ntf2.name)