1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 20:11:20 +00:00

Documentation/Builds: Delete previously generated docs

As the Makefile is no longer responsible for calling the extension and
instrumentation documentation ensure any previously generated
documentation is deleted from the respective build file.
This commit is contained in:
Marc Bonnici 2017-08-14 17:19:03 +01:00
parent 4d607b46c5
commit f194ef281b
2 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,7 @@
import os
import sys
import shutil
from wlauto import ExtensionLoader
from wlauto.utils.doc import get_rst_from_extension, underline
@ -30,6 +31,9 @@ def generate_extension_documentation(source_dir, outdir, ignore_paths):
loader = ExtensionLoader(keep_going=True)
loader.clear()
loader.update(paths=[source_dir], ignore_paths=ignore_paths)
if os.path.exists(outdir):
shutil.rmtree(outdir)
os.makedirs(outdir)
for ext_type in loader.extension_kinds:
if not ext_type in GENERATE_FOR:
continue

View File

@ -38,6 +38,8 @@ def generate_instrumentation_method_map(outfile):
headers=['method name', 'signal'], align='<<')
priority_table = format_simple_table([(escape_trailing_underscore(k), v) for k, v in PRIORITY_MAP.iteritems()],
headers=['prefix', 'priority'], align='<>')
if os.path.isfile(outfile):
os.unlink(outfile)
with open(OUTPUT_TEMPLATE_FILE) as fh:
template = string.Template(fh.read())
with open(outfile, 'w') as wfh: