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

Side by Side Diff: mojo/public/tools/bindings/mojom_tool.py

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright 2016 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 # mojom_tool.py invokes the mojom tool built for the operating system and
7 # architecture on which this script is run. It forwards all of its command
8 # line arguments to the mojom tool blindly. This script's exit code is the
9 # mojom tool's exit code.
10
11 import os
12 import platform
13 import subprocess
14 import sys
15
16 def main(args):
17 # We assume this script is located in the Mojo SDK in tools/bindings.
18 this_dir = os.path.abspath(os.path.dirname(__file__))
19
20 system_dirs = {
21 ('Linux', '64bit'): 'linux64',
22 ('Darwin', '64bit'): 'mac64',
23 }
24 system = (platform.system(), platform.architecture()[0])
25 if system not in system_dirs:
26 raise Exception('The mojom tool only supports Linux or Mac 64 bits.')
27
28 mojom_tool = os.path.join(
29 this_dir, 'mojom_tool', 'bin', system_dirs[system], 'mojom')
30
31 if not os.path.exists(mojom_tool):
32 raise Exception(
33 "The mojom tool could not be found at %s. "
34 "You may need to run gclient sync."
35 % mojom_tool)
36
37 cmd = [mojom_tool]
38 cmd.extend(args)
39
40 process = subprocess.Popen(cmd)
41 return process.wait()
42
43 if __name__ == "__main__":
44 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « mojo/public/tools/bindings/mojom_list_dart_outputs.py ('k') | mojo/public/tools/bindings/mojom_tool/bin/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698