Flutter Engine
The Flutter Engine
Functions | Variables
generate_and_upload_doxygen Namespace Reference

Functions

def recreate_dir (path)
 
def generate_and_upload_doxygen ()
 

Variables

string DOXYFILE_BASENAME = 'Doxyfile'
 
string DOXYGEN_BINARY = 'doxygen'
 
 WORKDIR = os.path.join(os.pardir, 'doxygen_workdir')
 
 DOXYGEN_CONFIG_DIR = os.path.join(WORKDIR, 'doxygen-config')
 
 DOXYGEN_WORKING_DIR = os.path.join(WORKDIR, 'doxygen')
 
string DOXYGEN_GS_PATH = '/'.join(['gs://skia-doc', 'doxygen'])
 
string IFRAME_FOOTER_TEMPLATE
 

Function Documentation

◆ generate_and_upload_doxygen()

def generate_and_upload_doxygen.generate_and_upload_doxygen ( )
Generate Doxygen.

Definition at line 42 of file generate_and_upload_doxygen.py.

43 """Generate Doxygen."""
44 # Create empty dir and add static_footer.txt
45 recreate_dir(DOXYGEN_WORKING_DIR)
46 static_footer_path = os.path.join(DOXYGEN_WORKING_DIR, 'static_footer.txt')
47 shutil.copyfile(os.path.join('tools', 'doxygen_footer.txt'),
48 static_footer_path)
49
50 # Make copy of doxygen config file, overriding any necessary configs,
51 # and run doxygen.
52 recreate_dir(DOXYGEN_CONFIG_DIR)
53 modified_doxyfile = os.path.join(DOXYGEN_CONFIG_DIR, DOXYFILE_BASENAME)
54 with open(DOXYFILE_BASENAME, 'r') as reader:
55 with open(modified_doxyfile, 'w') as writer:
56 shutil.copyfileobj(reader, writer)
57 writer.write('OUTPUT_DIRECTORY = %s\n' % DOXYGEN_WORKING_DIR)
58 writer.write('HTML_FOOTER = %s\n' % static_footer_path)
59 subprocess.check_call([DOXYGEN_BINARY, modified_doxyfile])
60
61 # Create iframe_footer.html
62 with open(os.path.join(DOXYGEN_WORKING_DIR, 'iframe_footer.html'), 'w') as f:
63 f.write(IFRAME_FOOTER_TEMPLATE % (
64 datetime.datetime.now().isoformat(' '),
65 subprocess.check_output([DOXYGEN_BINARY, '--version']).rstrip()))
66
67 # Upload.
68 cmd = ['gsutil', 'cp', '-a', 'public-read', '-R',
69 DOXYGEN_WORKING_DIR, DOXYGEN_GS_PATH]
70 subprocess.check_call(cmd)
71
72

◆ recreate_dir()

def generate_and_upload_doxygen.recreate_dir (   path)
Delete and recreate the directory.

Definition at line 32 of file generate_and_upload_doxygen.py.

32def recreate_dir(path):
33 """Delete and recreate the directory."""
34 try:
35 shutil.rmtree(path)
36 except OSError:
37 if os.path.exists(path):
38 raise Exception('Could not remove %s' % path)
39 os.makedirs(path)
40
41

Variable Documentation

◆ DOXYFILE_BASENAME

string generate_and_upload_doxygen.DOXYFILE_BASENAME = 'Doxyfile'

Definition at line 17 of file generate_and_upload_doxygen.py.

◆ DOXYGEN_BINARY

string generate_and_upload_doxygen.DOXYGEN_BINARY = 'doxygen'

Definition at line 18 of file generate_and_upload_doxygen.py.

◆ DOXYGEN_CONFIG_DIR

generate_and_upload_doxygen.DOXYGEN_CONFIG_DIR = os.path.join(WORKDIR, 'doxygen-config')

Definition at line 20 of file generate_and_upload_doxygen.py.

◆ DOXYGEN_GS_PATH

string generate_and_upload_doxygen.DOXYGEN_GS_PATH = '/'.join(['gs://skia-doc', 'doxygen'])

Definition at line 22 of file generate_and_upload_doxygen.py.

◆ DOXYGEN_WORKING_DIR

generate_and_upload_doxygen.DOXYGEN_WORKING_DIR = os.path.join(WORKDIR, 'doxygen')

Definition at line 21 of file generate_and_upload_doxygen.py.

◆ IFRAME_FOOTER_TEMPLATE

string generate_and_upload_doxygen.IFRAME_FOOTER_TEMPLATE
Initial value:
1= """
2<html><body><address style="text-align: right;"><small>
3Generated at %s for skia
4by <a href="http://www.doxygen.org/index.html">doxygen</a>
5%s </small></address></body></html>
6"""

Definition at line 24 of file generate_and_upload_doxygen.py.

◆ WORKDIR

generate_and_upload_doxygen.WORKDIR = os.path.join(os.pardir, 'doxygen_workdir')

Definition at line 19 of file generate_and_upload_doxygen.py.