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

Side by Side Diff: tools/dart_for_gn.py

Issue 2446473002: GN: Fix build (Closed)
Patch Set: Remove redundant print Created 4 years, 1 month 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
« no previous file with comments | « BUILD.gn ('k') | utils/compiler/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 The Dart project authors. All rights reserved. 2 # Copyright 2016 The Dart project authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # Usage: dart_for_gn.py path_to_dart_binary [arguments] 6 # Usage: dart_for_gn.py path_to_dart_binary [arguments]
7 # 7 #
8 # We have gn set up so that actions can only run python scripts. 8 # We have gn set up so that actions can only run python scripts.
9 # We use this wrapper script when we need an action to run the Dart VM 9 # We use this wrapper script when we need an action to run the Dart VM
10 # The first command line argument is mandatory and should be the absolute path 10 # The first command line argument is mandatory and should be the absolute path
11 # to the Dart VM binary. 11 # to the Dart VM binary.
12 12
13 import subprocess 13 import subprocess
14 import sys 14 import sys
15 15
16 def run_command(command):
17 try:
18 subprocess.check_output(command, stderr=subprocess.STDOUT)
19 return 0
20 except subprocess.CalledProcessError as e:
21 return ("Command failed: " + ' '.join(command) + "\n" +
22 "output: " + e.output)
23
16 def main(argv): 24 def main(argv):
17 if len(argv) < 2: 25 if len(argv) < 2:
18 print "Requires path to Dart VM binary as first argument" 26 print "Requires path to Dart VM binary as first argument"
19 return -1 27 return -1
20 command = argv[1:] 28 result = run_command(argv[1:])
21 return subprocess.call(command) 29 if result != 0:
30 print result
31 return -1
32 return 0
22 33
23 if __name__ == '__main__': 34 if __name__ == '__main__':
24 sys.exit(main(sys.argv)) 35 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | utils/compiler/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698