| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 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 | 6 |
| 7 """Generate Doxygen documentation.""" | 7 """Generate Doxygen documentation.""" |
| 8 | 8 |
| 9 | 9 |
| 10 import datetime | 10 import datetime |
| 11 import os | 11 import os |
| 12 import shutil | 12 import shutil |
| 13 import subprocess | 13 import subprocess |
| 14 import sys | 14 import sys |
| 15 | 15 |
| 16 from common.skia import global_constants | |
| 17 | |
| 18 | 16 |
| 19 DOXYFILE_BASENAME = 'Doxyfile' # must match name of Doxyfile in skia root | 17 DOXYFILE_BASENAME = 'Doxyfile' # must match name of Doxyfile in skia root |
| 20 DOXYGEN_BINARY = 'doxygen' | 18 DOXYGEN_BINARY = 'doxygen' |
| 21 WORKDIR = os.path.join(os.pardir, 'doxygen_workdir') | 19 WORKDIR = os.path.join(os.pardir, 'doxygen_workdir') |
| 22 DOXYGEN_CONFIG_DIR = os.path.join(WORKDIR, 'doxygen-config') | 20 DOXYGEN_CONFIG_DIR = os.path.join(WORKDIR, 'doxygen-config') |
| 23 DOXYGEN_WORKING_DIR = os.path.join(WORKDIR, 'doxygen') | 21 DOXYGEN_WORKING_DIR = os.path.join(WORKDIR, 'doxygen') |
| 24 DOXYGEN_GS_PATH = '/'.join(['gs:/', global_constants.GS_GM_BUCKET, 'doxygen']) | 22 DOXYGEN_GS_PATH = '/'.join(['gs://chromium-skia-gm', 'doxygen']) |
| 25 | 23 |
| 26 IFRAME_FOOTER_TEMPLATE = """ | 24 IFRAME_FOOTER_TEMPLATE = """ |
| 27 <html><body><address style="text-align: right;"><small> | 25 <html><body><address style="text-align: right;"><small> |
| 28 Generated at %s for skia | 26 Generated at %s for skia |
| 29 by <a href="http://www.doxygen.org/index.html">doxygen</a> | 27 by <a href="http://www.doxygen.org/index.html">doxygen</a> |
| 30 %s </small></address></body></html> | 28 %s </small></address></body></html> |
| 31 """ | 29 """ |
| 32 | 30 |
| 33 | 31 |
| 34 def recreate_dir(path): | 32 def recreate_dir(path): |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 66 |
| 69 # Upload. | 67 # Upload. |
| 70 cmd = [gsutil_path, 'cp', '-a', 'public-read', '-R', | 68 cmd = [gsutil_path, 'cp', '-a', 'public-read', '-R', |
| 71 DOXYGEN_WORKING_DIR, DOXYGEN_GS_PATH] | 69 DOXYGEN_WORKING_DIR, DOXYGEN_GS_PATH] |
| 72 subprocess.check_call(cmd) | 70 subprocess.check_call(cmd) |
| 73 | 71 |
| 74 | 72 |
| 75 if '__main__' == __name__: | 73 if '__main__' == __name__: |
| 76 generate_and_upload_doxygen(*sys.argv[1:]) | 74 generate_and_upload_doxygen(*sys.argv[1:]) |
| 77 | 75 |
| OLD | NEW |