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..6064f01a45cf2fe55ca15229c5d225a1d52ffe30 |
--- /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): |
+ javadoc_cwd = options.javadoc_cwd |
+ source_dir = options.source_dir |
+ output_dir = options.output_dir |
+ |
+ build_utils.DeleteDirectory(output_dir) |
+ build_utils.MakeDirectory(output_dir) |
+ jar_cmd = ['ant', '-Dsource.dir=' + source_dir, |
mef
2015/06/03 18:25:01
javadoc_cmd = ...
Why do you need ant? Can we run
xunjieli
2015/06/03 20:19:34
javadoc is horrendously hard to configure. For ins
mef
2015/06/03 22:00:54
I see. That's unfortunate, but I don't see any exa
xunjieli
2015/06/04 13:37:35
Acknowledged.
|
+ '-Ddoc.dir=' + os.path.abspath(output_dir), 'doc'] |
+ build_utils.CheckOutput(jar_cmd, cwd=javadoc_cwd) |
+ |
+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('--javadoc-cwd', help='Working directory') |
mef
2015/06/03 18:25:01
maybe temp-dir or working-dir?
Can it be created
xunjieli
2015/06/03 20:19:34
Done.
|
+ |
+ options, _ = parser.parse_args() |
+ |
+ GenerateJavadoc(options) |
+ |
+if __name__ == '__main__': |
+ sys.exit(main()) |
+ |