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

Side by Side Diff: mojo/public/tools/dart_list_mojoms.py

Issue 1824253002: Remove the mojom-sources flag from dart_pkg.py (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « mojo/public/dart/rules.gni ('k') | mojo/public/tools/dart_pkg.py » ('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 2015 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 # This script scans a directory tree for any .mojom files and outputs a list.
7
8 import argparse
9 import os
10 import sys
11
12 def main(args):
13 parser = argparse.ArgumentParser(
14 description='Prints list of generated dart binding source files.')
15 parser.add_argument('source_directory',
16 metavar='source_directory',
17 help='Path to source directory tree containing .mojom'
18 ' files')
19 parser.add_argument('relative_directory_root',
20 metavar='relative_directory_root',
21 help='Path to directory which all outputted paths will'
22 'be relative to.')
23 args = parser.parse_args()
24 # Directory to start searching for .mojom files.
25 source_directory = args.source_directory
26 # Prefix to chop off output.
27 root_prefix = os.path.abspath(args.relative_directory_root)
28 for dirname, dirnames, filenames in os.walk(source_directory):
29 # filter for .mojom files.
30 filenames = [f for f in filenames if f.endswith('.mojom')]
31 # Skip any directories that start with 'test'.
32 dirnames[:] = [d for d in dirnames if not d.startswith('test')]
33 for f in filenames:
34 path = os.path.abspath(os.path.join(dirname, f))
35 path = os.path.relpath(path, root_prefix)
36 print(path)
37
38 if __name__ == '__main__':
39 sys.exit(main(sys.argv[1:]))
40
OLDNEW
« no previous file with comments | « mojo/public/dart/rules.gni ('k') | mojo/public/tools/dart_pkg.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698