OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2015 The Chromium Authors. All rights reserved. | 3 # Copyright 2015 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 import fnmatch | 7 import fnmatch |
8 import optparse | 8 import optparse |
9 import os | 9 import os |
10 import sys | 10 import sys |
(...skipping 30 matching lines...) Expand all Loading... |
41 javadoc_cmd = ['ant', '-Dsource.dir=src', '-Ddoc.dir=' + output_dir, | 41 javadoc_cmd = ['ant', '-Dsource.dir=src', '-Ddoc.dir=' + output_dir, |
42 '-Doverview=' + overview_file, 'doc'] | 42 '-Doverview=' + overview_file, 'doc'] |
43 stdout = build_utils.CheckOutput(javadoc_cmd, cwd=working_dir) | 43 stdout = build_utils.CheckOutput(javadoc_cmd, cwd=working_dir) |
44 if " error: " in stdout or "warning" in stdout: | 44 if " error: " in stdout or "warning" in stdout: |
45 build_utils.DeleteDirectory(output_dir) | 45 build_utils.DeleteDirectory(output_dir) |
46 raise build_utils.CalledProcessError(working_dir, javadoc_cmd, stdout) | 46 raise build_utils.CalledProcessError(working_dir, javadoc_cmd, stdout) |
47 | 47 |
48 | 48 |
49 def main(): | 49 def main(): |
50 parser = optparse.OptionParser() | 50 parser = optparse.OptionParser() |
| 51 build_utils.AddDepfileOption(parser) |
51 parser.add_option('--output-dir', help='Directory to put javadoc') | 52 parser.add_option('--output-dir', help='Directory to put javadoc') |
52 parser.add_option('--input-dir', help='Root of cronet source') | 53 parser.add_option('--input-dir', help='Root of cronet source') |
53 parser.add_option('--overview-file', help='Path of the overview page') | 54 parser.add_option('--overview-file', help='Path of the overview page') |
54 parser.add_option('--readme-file', help='Path of the README.md') | 55 parser.add_option('--readme-file', help='Path of the README.md') |
55 | 56 |
56 options, _ = parser.parse_args() | 57 options, _ = parser.parse_args() |
57 | 58 |
58 net_docs.ProcessDocs([options.readme_file], options.input_dir, | 59 net_docs.ProcessDocs([options.readme_file], options.input_dir, |
59 options.output_dir, extensions=[CronetExtension()]) | 60 options.output_dir, extensions=[CronetExtension()]) |
60 | 61 |
61 GenerateJavadoc(options) | 62 GenerateJavadoc(options) |
62 | 63 |
| 64 if options.depfile: |
| 65 input_paths = [] |
| 66 for root, _, filenames in os.walk(options.input_dir): |
| 67 input_paths.extend(os.path.join(root, f) for f in filenames) |
| 68 build_utils.WriteDepfile(options.depfile, |
| 69 input_paths + build_utils.GetPythonDependencies()) |
| 70 |
63 if __name__ == '__main__': | 71 if __name__ == '__main__': |
64 sys.exit(main()) | 72 sys.exit(main()) |
65 | |
OLD | NEW |