| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/env python | |
| 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 | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 # pylint: disable=C0301 | |
| 7 """Uploads Doxygen documentation to Google Storage, where it can be browsed at | |
| 8 http://chromium-skia-gm.commondatastorage.googleapis.com/doxygen/doxygen/html/in
dex.html | |
| 9 """ | |
| 10 # pylint: enable=C0301 | |
| 11 | |
| 12 import posixpath | |
| 13 import sys | |
| 14 | |
| 15 from build_step import BuildStep | |
| 16 from utils import gs_utils | |
| 17 from utils import old_gs_utils | |
| 18 import generate_doxygen | |
| 19 import skia_vars | |
| 20 | |
| 21 # It's silly that we include 'doxygen' in the destination path twice, but | |
| 22 # that's to maintain current behavior while fixing http://skbug.com/2658 . | |
| 23 DOXYGEN_GSUTIL_PATH = posixpath.join( | |
| 24 gs_utils.GSUtils.with_gs_prefix( | |
| 25 skia_vars.GetGlobalVariable('googlestorage_bucket')), | |
| 26 'doxygen', 'doxygen') | |
| 27 | |
| 28 # Directives for HTTP caching of these files served out by Google Storage. | |
| 29 # See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html | |
| 30 GS_CACHE_CONTROL_HEADER = 'Cache-Control:public,max-age=3600' | |
| 31 | |
| 32 | |
| 33 class UploadDoxygen(BuildStep): | |
| 34 def _Run(self): | |
| 35 old_gs_utils.upload_dir_contents( | |
| 36 local_src_dir=generate_doxygen.DOXYGEN_WORKING_DIR, | |
| 37 remote_dest_dir=DOXYGEN_GSUTIL_PATH, | |
| 38 gs_acl='public-read', | |
| 39 http_header_lines=[GS_CACHE_CONTROL_HEADER]) | |
| 40 | |
| 41 | |
| 42 if '__main__' == __name__: | |
| 43 sys.exit(BuildStep.RunBuildStep(UploadDoxygen)) | |
| OLD | NEW |