OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 # |
| 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 |
| 5 # found in the LICENSE file. |
| 6 |
| 7 import fnmatch |
| 8 import optparse |
| 9 import os |
| 10 import sys |
| 11 |
| 12 REPOSITORY_ROOT = os.path.abspath(os.path.join( |
| 13 os.path.dirname(__file__), '..', '..', '..')) |
| 14 |
| 15 sys.path.append(os.path.join(REPOSITORY_ROOT, 'build/android/gyp/util')) |
| 16 import build_utils |
| 17 |
| 18 |
| 19 def GenerateJavadoc(options): |
| 20 source_dir = options.source_dir |
| 21 output_dir = options.output_dir |
| 22 working_dir = options.working_dir |
| 23 |
| 24 build_utils.DeleteDirectory(output_dir) |
| 25 build_utils.MakeDirectory(output_dir) |
| 26 javadoc_cmd = ['ant', '-Dsource.dir=' + source_dir, |
| 27 '-Ddoc.dir=' + os.path.abspath(output_dir), 'doc'] |
| 28 build_utils.CheckOutput(javadoc_cmd, cwd=working_dir) |
| 29 |
| 30 |
| 31 def main(): |
| 32 parser = optparse.OptionParser() |
| 33 parser.add_option('--source-dir', help='Source directory') |
| 34 parser.add_option('--output-dir', help='Directory to put javadoc') |
| 35 parser.add_option('--working-dir', help='Working directory') |
| 36 |
| 37 options, _ = parser.parse_args() |
| 38 |
| 39 GenerateJavadoc(options) |
| 40 |
| 41 if __name__ == '__main__': |
| 42 sys.exit(main()) |
| 43 |
OLD | NEW |