Chromium Code Reviews| Index: utils/apidoc/scripts/list_files.py |
| diff --git a/utils/apidoc/scripts/list_files.py b/utils/apidoc/scripts/list_files.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..836bb03a8d56f1b0168e2780b73fb4dc6baf42d0 |
| --- /dev/null |
| +++ b/utils/apidoc/scripts/list_files.py |
| @@ -0,0 +1,35 @@ |
| +#!/usr/bin/env python |
| +# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +# for details. All rights reserved. Use of this source code is governed by a |
| +# BSD-style license that can be found in the LICENSE file. |
| + |
| +# Traverses apidoc and dartdoc and lists all possible input files that are |
| +# used when building API documentation. Used by gyp to determine when apidocs |
| +# need to be regenerated (see `apidoc.gyp`). |
| + |
| +# TODO(rnystrom): Port this to dart. It can be run before dart has been built |
|
Ivan Posva
2012/03/30 21:45:02
We don't want to be dependent on Dart to build Dar
|
| +# (which is when this script is invoked by gyp) by using the prebuild dart in |
| +# tools/testing/bin. |
| + |
| +import os |
| +import sys |
| + |
| +def main(argv): |
| + if len(argv) == 1: |
| + dir = os.curdir |
| + else: |
| + dir = argv[1] |
| + for root, directories, files in os.walk(dir): |
| + if root == os.curdir: |
| + directories[0:] = [ |
| + os.path.join('utils', 'apidoc'), |
| + os.path.join('lib', 'dartdoc') |
| + ] |
| + |
| + for filename in files: |
| + if filename.endswith(( |
| + '.css', '.dart', '.ico', '.js', '.json', '.png', '.sh', '.txt')): |
| + print os.path.relpath(os.path.join(root, filename)) |
| + |
| +if __name__ == '__main__': |
| + sys.exit(main(sys.argv)) |