summaryrefslogtreecommitdiffstats
path: root/extras/doxygen.py
diff options
context:
space:
mode:
Diffstat (limited to 'extras/doxygen.py')
-rw-r--r--extras/doxygen.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/extras/doxygen.py b/extras/doxygen.py
index 28f56e9..20cd9e1 100644
--- a/extras/doxygen.py
+++ b/extras/doxygen.py
@@ -27,6 +27,7 @@ When using this tool, the wscript will look like:
"""
import os, os.path, re
+from collections import OrderedDict
from waflib import Task, Utils, Node
from waflib.TaskGen import feature
@@ -40,7 +41,13 @@ inc m mm py f90c cc cxx cpp c++ java ii ixx ipp i++ inl h hh hxx
re_rl = re.compile('\\\\\r*\n', re.MULTILINE)
re_nl = re.compile('\r*\n', re.M)
def parse_doxy(txt):
- tbl = {}
+ '''
+ Parses a doxygen file.
+ Returns an ordered dictionary. We cannot return a default dictionary, as the
+ order in which the entries are reported does matter, especially for the
+ '@INCLUDE' lines.
+ '''
+ tbl = OrderedDict()
txt = re_rl.sub('', txt)
lines = re_nl.split(txt)
for x in lines:
@@ -78,6 +85,12 @@ class doxygen(Task.Task):
if not getattr(self, 'pars', None):
txt = self.inputs[0].read()
self.pars = parse_doxy(txt)
+
+ # Override with any parameters passed to the task generator
+ if getattr(self.generator, 'pars', None):
+ for k, v in self.generator.pars.items():
+ self.pars[k] = v
+
if self.pars.get('OUTPUT_DIRECTORY'):
# Use the path parsed from the Doxyfile as an absolute path
output_node = self.inputs[0].parent.get_bld().make_node(self.pars['OUTPUT_DIRECTORY'])
@@ -87,11 +100,6 @@ class doxygen(Task.Task):
output_node.mkdir()
self.pars['OUTPUT_DIRECTORY'] = output_node.abspath()
- # Override with any parameters passed to the task generator
- if getattr(self.generator, 'pars', None):
- for k, v in self.generator.pars.items():
- self.pars[k] = v
-
self.doxy_inputs = getattr(self, 'doxy_inputs', [])
if not self.pars.get('INPUT'):
self.doxy_inputs.append(self.inputs[0].parent)