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

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

Issue 2438913004: Revert of [Reland] Upgrade to new Android SDK. (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 | « components/cronet/android/api/build.xml ('k') | docs/android_test_instructions.md » ('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 optparse 7 import optparse
8 import os 8 import os
9 import sys 9 import sys
10 import tempfile 10 import tempfile
(...skipping 25 matching lines...) Expand all
36 working_dir = os.path.join(options.input_dir, 'android/api') 36 working_dir = os.path.join(options.input_dir, 'android/api')
37 overview_file = os.path.abspath(options.overview_file) 37 overview_file = os.path.abspath(options.overview_file)
38 lib_java_dir = os.path.abspath(options.lib_java_dir) 38 lib_java_dir = os.path.abspath(options.lib_java_dir)
39 39
40 build_utils.DeleteDirectory(output_dir) 40 build_utils.DeleteDirectory(output_dir)
41 build_utils.MakeDirectory(output_dir) 41 build_utils.MakeDirectory(output_dir)
42 javadoc_cmd = ['ant', '-Dsource.dir=' + src_dir , '-Ddoc.dir=' + output_dir, 42 javadoc_cmd = ['ant', '-Dsource.dir=' + src_dir , '-Ddoc.dir=' + output_dir,
43 '-Dlib.java.dir=' + lib_java_dir, '-Doverview=' + overview_file, 43 '-Dlib.java.dir=' + lib_java_dir, '-Doverview=' + overview_file,
44 'doc'] 44 'doc']
45 stdout = build_utils.CheckOutput(javadoc_cmd, cwd=working_dir) 45 stdout = build_utils.CheckOutput(javadoc_cmd, cwd=working_dir)
46 for line in stdout.splitlines(): 46 if " error: " in stdout or "warning" in stdout or "javadoc: error " in stdout:
47 if " error: " in line or "javadoc: error " in line: 47 build_utils.DeleteDirectory(output_dir)
48 build_utils.DeleteDirectory(output_dir) 48 raise build_utils.CalledProcessError(working_dir, javadoc_cmd, stdout)
49 raise build_utils.CalledProcessError(working_dir, javadoc_cmd, stdout)
50 # TODO(crbug.com/655666): remove compiler suppression warning once fixed.
51 if ("warning" in line and not line.endswith('warnings') and
52 not "the highest major version" in line):
53 build_utils.DeleteDirectory(output_dir)
54 raise build_utils.CalledProcessError(working_dir, javadoc_cmd, stdout)
55 49
56 50
57 def main(): 51 def main():
58 parser = optparse.OptionParser() 52 parser = optparse.OptionParser()
59 build_utils.AddDepfileOption(parser) 53 build_utils.AddDepfileOption(parser)
60 parser.add_option('--output-dir', help='Directory to put javadoc') 54 parser.add_option('--output-dir', help='Directory to put javadoc')
61 parser.add_option('--input-dir', help='Root of cronet source') 55 parser.add_option('--input-dir', help='Root of cronet source')
62 parser.add_option('--input-src-jar', help='Cronet api source jar') 56 parser.add_option('--input-src-jar', help='Cronet api source jar')
63 parser.add_option('--overview-file', help='Path of the overview page') 57 parser.add_option('--overview-file', help='Path of the overview page')
64 parser.add_option('--readme-file', help='Path of the README.md') 58 parser.add_option('--readme-file', help='Path of the README.md')
(...skipping 20 matching lines...) Expand all
85 assert options.stamp 79 assert options.stamp
86 deps = [] 80 deps = []
87 for root, _, filenames in os.walk(options.input_dir): 81 for root, _, filenames in os.walk(options.input_dir):
88 deps.extend(os.path.join(root, f) for f in filenames) 82 deps.extend(os.path.join(root, f) for f in filenames)
89 build_utils.WriteDepfile(options.depfile, options.stamp, deps) 83 build_utils.WriteDepfile(options.depfile, options.stamp, deps)
90 # Clean up temporary output directory. 84 # Clean up temporary output directory.
91 build_utils.DeleteDirectory(unzipped_jar_path) 85 build_utils.DeleteDirectory(unzipped_jar_path)
92 86
93 if __name__ == '__main__': 87 if __name__ == '__main__':
94 sys.exit(main()) 88 sys.exit(main())
OLDNEW
« no previous file with comments | « components/cronet/android/api/build.xml ('k') | docs/android_test_instructions.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698