Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Side by Side Diff: remoting/tools/jscompile.py

Issue 163953011: [Chromoting] Update jscompile target to use JS files from gypi. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update gyp file (wcs sandbox) Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/tools/htmlcompile.py ('k') | remoting/webapp/js_proto/remoting_proto.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/python
2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import argparse
7 import subprocess
8 import sys
9 import os
10
11 DESCRIPTION = '''Run the given JavaScript files through jscompile.'''
12 FILES_HELP = '''A list of Javascript files. The Javascript files should include
13 files that contain definitions of types or functions that are known to Chrome
14 but not to jscompile.'''
15 STAMP_HELP = 'Timestamp file to update on success.'
16
17 def checkJavascript(js_files):
18 args = ['jscompile'] + js_files
19 result = subprocess.call(args)
20 return result == 0
21
22
23 def main():
24 parser = argparse.ArgumentParser(description = DESCRIPTION)
25 parser.add_argument('files', nargs = '+', help = FILES_HELP)
26 parser.add_argument('--success-stamp', dest = 'success_stamp',
27 help = STAMP_HELP)
28 options = parser.parse_args()
29
30 js = []
31 for file in options.files:
32 name, extension = os.path.splitext(file)
33 if extension == '.js':
34 js.append(file)
35 else:
36 print >> sys.stderr, 'Unknown extension (' + extension + ') for ' + file
37 return 1
38
39 if not checkJavascript(js):
40 return 1
41
42 if options.success_stamp:
43 with open(options.success_stamp, 'w'):
44 os.utime(options.success_stamp, None)
45
46 return 0
47
48 if __name__ == '__main__':
49 sys.exit(main())
OLDNEW
« no previous file with comments | « remoting/tools/htmlcompile.py ('k') | remoting/webapp/js_proto/remoting_proto.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698