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

Side by Side Diff: components/cronet/tools/generate_javadoc.py

Issue 1553623003: Port cronet_package GYP target to GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix issues Created 4 years, 11 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 | « components/cronet/tools/extract_from_jars.py ('k') | components/cronet/tools/jar_src.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « components/cronet/tools/extract_from_jars.py ('k') | components/cronet/tools/jar_src.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698