| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Generate Doxygen documentation.""" | 6 """Generate Doxygen documentation.""" |
| 7 | 7 |
| 8 import datetime | 8 import datetime |
| 9 import os | 9 import os |
| 10 import shutil | 10 import shutil |
| 11 import sys | 11 import sys |
| 12 | 12 |
| 13 from build_step import BuildStep | 13 from build_step import BuildStep |
| 14 from utils import file_utils, shell_utils | 14 from utils import file_utils |
| 15 from py.utils import shell_utils |
| 15 | 16 |
| 16 DOXYFILE_BASENAME = 'Doxyfile' # must match name of Doxyfile in skia root | 17 DOXYFILE_BASENAME = 'Doxyfile' # must match name of Doxyfile in skia root |
| 17 DOXYGEN_BINARY = 'doxygen' | 18 DOXYGEN_BINARY = 'doxygen' |
| 18 DOXYGEN_CONFIG_DIR = os.path.join(os.pardir, os.pardir, 'doxygen-config') | 19 DOXYGEN_CONFIG_DIR = os.path.join(os.pardir, os.pardir, 'doxygen-config') |
| 19 DOXYGEN_WORKING_DIR = os.path.join(os.pardir, os.pardir, 'doxygen') | 20 DOXYGEN_WORKING_DIR = os.path.join(os.pardir, os.pardir, 'doxygen') |
| 20 | 21 |
| 21 IFRAME_FOOTER_TEMPLATE = """ | 22 IFRAME_FOOTER_TEMPLATE = """ |
| 22 <html><body><address style="text-align: right;"><small> | 23 <html><body><address style="text-align: right;"><small> |
| 23 Generated at %s for skia | 24 Generated at %s for skia |
| 24 by <a href="http://www.doxygen.org/index.html">doxygen</a> | 25 by <a href="http://www.doxygen.org/index.html">doxygen</a> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 48 # Create iframe_footer.html | 49 # Create iframe_footer.html |
| 49 with open(os.path.join(DOXYGEN_WORKING_DIR, 'iframe_footer.html'), | 50 with open(os.path.join(DOXYGEN_WORKING_DIR, 'iframe_footer.html'), |
| 50 'w') as fh: | 51 'w') as fh: |
| 51 fh.write(IFRAME_FOOTER_TEMPLATE % ( | 52 fh.write(IFRAME_FOOTER_TEMPLATE % ( |
| 52 datetime.datetime.now().isoformat(' '), | 53 datetime.datetime.now().isoformat(' '), |
| 53 shell_utils.run([DOXYGEN_BINARY, '--version']))) | 54 shell_utils.run([DOXYGEN_BINARY, '--version']))) |
| 54 | 55 |
| 55 | 56 |
| 56 if '__main__' == __name__: | 57 if '__main__' == __name__: |
| 57 sys.exit(BuildStep.RunBuildStep(GenerateDoxygen)) | 58 sys.exit(BuildStep.RunBuildStep(GenerateDoxygen)) |
| OLD | NEW |