13from collections
import namedtuple
15Section = namedtuple(
'Section', [
'title',
'inputs'])
21 'shell/platform/darwin/ios',
22 'shell/platform/darwin/common',
23 'shell/platform/common',
29 'shell/platform/darwin/macos',
30 'shell/platform/darwin/common',
31 'shell/platform/common',
36 'shell/platform/linux',
37 'shell/platform/common',
41 'shell/platform/windows',
42 'shell/platform/common',
52 doxyfile = open(
'docs/Doxyfile.template',
'r').
read()
53 doxyfile = doxyfile.replace(
'@@OUTPUT_DIRECTORY@@', output_dir)
54 doxyfile = doxyfile.replace(
'@@LOG_FILE@@', log_file)
55 doxyfile = doxyfile.replace(
'@@INPUT_DIRECTORIES@@',
'"{}"'.
format(
'" "'.
join(section.inputs)))
56 doxyfile = doxyfile.replace(
'@@PROJECT_NAME@@',
'Flutter {}'.
format(section.title))
57 doxyfile = doxyfile.replace(
58 '@@DOCSET_FEEDNAME@@',
'Flutter {} Documentation'.
format(section.title)
60 with open(doxy_file,
'w')
as f:
65 output_dir = tempfile.mkdtemp(prefix=
"doxygen")
66 log_file = os.path.join(destination,
'{}-doxygen.log'.
format(name))
67 zip_file = os.path.join(destination,
'{}-docs.zip'.
format(name))
68 doxy_file = os.path.join(output_dir,
'Doxyfile')
71 subprocess.call([
'doxygen',
'-u'], cwd=output_dir)
72 subprocess.call([
'doxygen', doxy_file])
73 html_dir = os.path.join(output_dir,
'html')
74 with zipfile.ZipFile(zip_file,
'w')
as zip:
75 for root, _, files
in os.walk(html_dir):
77 filename = os.path.join(root, file)
78 zip.write(filename, os.path.relpath(filename, html_dir))
79 print(
'Wrote ZIP file for {} to {}'.
format(section, zip_file))
81 shutil.rmtree(output_dir, ignore_errors=
True)
87 'Error: Argument specifying output directory required. '
88 'Directory may be an absolute path, or a relative path from the "src" directory.'
93 script_path = os.path.realpath(__file__)
94 src_path = os.path.dirname(os.path.dirname(os.path.dirname(script_path)))
96 os.chdir(os.path.join(src_path,
'flutter'))
98 if not os.path.isabs(destination):
99 destination = os.path.join(src_path, destination)
100 os.makedirs(destination, exist_ok=
True)
101 for name, section
in SECTIONS.items():
105if __name__ ==
'__main__':
static bool read(SkStream *stream, void *buffer, size_t amount)
uint32_t uint32_t * format
def process_section(name, section, destination)
def generate_doxyfile(section, output_dir, log_file, doxy_file)
def print(*args, **kwargs)
static SkString join(const CommandLineFlags::StringArray &)