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

Unified Diff: components/cronet/tools/generate_javadoc.py

Issue 1148263004: [Cronet] Generate Javadoc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/cronet/android/java/build.xml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/tools/generate_javadoc.py
diff --git a/components/cronet/tools/generate_javadoc.py b/components/cronet/tools/generate_javadoc.py
new file mode 100755
index 0000000000000000000000000000000000000000..0fd98938fde0721cdf1760c3d299ede57516e015
--- /dev/null
+++ b/components/cronet/tools/generate_javadoc.py
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+#
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import fnmatch
+import optparse
+import os
+import sys
+
+REPOSITORY_ROOT = os.path.abspath(os.path.join(
+ os.path.dirname(__file__), '..', '..', '..'))
+
+sys.path.append(os.path.join(REPOSITORY_ROOT, 'build/android/gyp/util'))
+import build_utils
+
+
+def GenerateJavadoc(options):
+ source_dir = options.source_dir
+ output_dir = options.output_dir
+ working_dir = options.working_dir
+
+ build_utils.DeleteDirectory(output_dir)
+ build_utils.MakeDirectory(output_dir)
+ javadoc_cmd = ['ant', '-Dsource.dir=' + source_dir,
+ '-Ddoc.dir=' + os.path.abspath(output_dir), 'doc']
+ build_utils.CheckOutput(javadoc_cmd, cwd=working_dir)
+
mef 2015/06/03 22:00:54 nit: 2 empty lines between methods.
xunjieli 2015/06/04 13:37:35 Done.
+def main():
+ parser = optparse.OptionParser()
+ parser.add_option('--source-dir', help='Source directory')
+ parser.add_option('--output-dir', help='Directory to put javadoc')
+ parser.add_option('--working-dir', help='Working directory')
+
+ options, _ = parser.parse_args()
+
+ GenerateJavadoc(options)
+
+if __name__ == '__main__':
+ sys.exit(main())
+
« no previous file with comments | « components/cronet/android/java/build.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698