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

Side by Side Diff: tools/list_dart_files.py

Issue 2391863002: Tweak how the pkg files timestamps are created. (Closed)
Patch Set: Created 4 years, 2 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 | « pkg/pkg_files.gyp ('k') | no next file » | 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/env python
2 # Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file.
Bill Hesse 2016/10/04 08:57:18 Since this tool is all about not hitting the xcode
5
6 """Tool for listing Dart source files.
7
8 Usage:
9 python tools/list_dart_files.py <directory> <root directory pattern>
10 """
11
12 import os
13 import re
14 import sys
15
16
17 def main(argv):
18 directory = argv[1]
19
20 pattern = None
21 if len(argv) > 2:
22 pattern = re.compile(argv[2])
23
24 for root, directories, files in os.walk(directory):
25 # We only care about actual source files, not generated code or tests.
26 for skip_dir in ['.git', 'gen', 'test']:
27 if skip_dir in directories:
28 directories.remove(skip_dir)
29
30 # If we are looking at the root directory, filter the immediate
31 # subdirectories by the given pattern.
32 if pattern and root == directory:
33 directories[:] = filter(pattern.match, directories)
34
35 for filename in files:
36 if filename.endswith('.dart') and not filename.endswith('_test.dart'):
37 fullname = os.path.relpath(os.path.join(root, filename))
38 fullname = fullname.replace(os.sep, '/')
39 print fullname
40
41
42 if __name__ == '__main__':
43 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « pkg/pkg_files.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698