| Index: tools/gypv8sh.py
|
| diff --git a/tools/gypv8sh.py b/tools/gypv8sh.py
|
| index edb14020cae767bf2954def5acf60a09fdd70b2c..ca9c759c9c05e53a48f8125b214099d5f415ae13 100644
|
| --- a/tools/gypv8sh.py
|
| +++ b/tools/gypv8sh.py
|
| @@ -8,7 +8,7 @@ argument lists and to generate inlinable tests.
|
|
|
| Usage:
|
| python tools/gypv8sh.py v8_shell mock.js test_api.js js2webui.js \
|
| - inputfile outputfile
|
| + inputfile inputrelfile cxxoutfile jsoutfile
|
| """
|
|
|
| try:
|
| @@ -19,30 +19,35 @@ import optparse
|
| import os
|
| import subprocess
|
| import sys
|
| +import shutil
|
|
|
| def main ():
|
| parser = optparse.OptionParser()
|
| parser.set_usage(
|
| - "%prog v8_shell mock.js test_api.js js2webui.js inputfile outputfile")
|
| + "%prog v8_shell mock.js test_api.js js2webui.js inputfile inputrelfile "
|
| + "cxxoutfile jsoutfile")
|
| parser.add_option('-v', '--verbose', action='store_true')
|
| parser.add_option('-n', '--impotent', action='store_true',
|
| help="don't execute; just print (as if verbose)")
|
| (opts, args) = parser.parse_args()
|
|
|
| - if len(args) != 6:
|
| + if len(args) != 8:
|
| parser.error('all arguments are required.')
|
| - v8_shell, mock_js, test_api, js2webui, inputfile, outputfile = args
|
| - arguments = [js2webui, inputfile, os.path.basename(inputfile), outputfile]
|
| + (v8_shell, mock_js, test_api, js2webui, inputfile, inputrelfile,
|
| + cxxoutfile, jsoutfile) = args
|
| + arguments = [js2webui, inputfile, inputrelfile, cxxoutfile]
|
| cmd = [v8_shell, '-e', "arguments=" + json.dumps(arguments), mock_js,
|
| test_api, js2webui]
|
| if opts.verbose or opts.impotent:
|
| print cmd
|
| if not opts.impotent:
|
| try:
|
| - subprocess.check_call(cmd, stdout=open(outputfile,'w'))
|
| + subprocess.check_call(cmd, stdout=open(cxxoutfile, 'w'))
|
| + shutil.copyfile(inputfile, jsoutfile)
|
| except Exception, ex:
|
| print ex
|
| - os.remove(outputfile)
|
| + os.remove(cxxoutfile)
|
| + os.remove(jsoutfile)
|
| sys.exit(1)
|
|
|
| if __name__ == '__main__':
|
|
|