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

Side by Side Diff: dart/utils/apidoc/scripts/list_files.py

Issue 10308006: Share a tool for listing dependencies thus fixing a dependency problem on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Spotted another Windows bug Created 8 years, 7 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
« dart/tools/list_files.py ('K') | « dart/utils/apidoc/apidoc.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) 2012, 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.
5
6 # Traverses apidoc and dartdoc and lists all possible input files that are
7 # used when building API documentation. Used by gyp to determine when apidocs
8 # need to be regenerated (see `apidoc.gyp`).
9
10 # TODO(rnystrom): Port this to dart. It can be run before dart has been built
11 # (which is when this script is invoked by gyp) by using the prebuild dart in
12 # tools/testing/bin.
13
14 import os
15 import sys
16
17 def handle_walk(root, directories, files, start):
18 for filename in files:
19 if filename.endswith((
20 '.css', '.dart', '.ico', '.js', '.json', '.png', '.sh', '.txt')):
21 print os.path.relpath(os.path.join(root, filename), start=start)
22
23
24 def main(argv):
25 if len(argv) == 1:
26 dir = os.path.join(os.path.dirname(os.path.realpath(__file__)),
27 os.pardir, os.pardir, os.pardir)
28 else:
29 dir = argv[1]
30 start = os.path.join(dir, 'utils', 'apidoc')
31 for root, directories, files in os.walk(os.path.join(dir, 'utils', 'apidoc')):
32 handle_walk(root, directories, files, start)
33 for root, directories, files in os.walk(os.path.join(dir, 'lib', 'dartdoc')):
34 handle_walk(root, directories, files, start)
35
36 if __name__ == '__main__':
37 sys.exit(main(sys.argv))
OLDNEW
« dart/tools/list_files.py ('K') | « dart/utils/apidoc/apidoc.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698