/[ascend]/trunk/scons/doxygen.py
ViewVC logotype

Diff of /trunk/scons/doxygen.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 766 by johnpye, Thu Jul 13 06:33:03 2006 UTC revision 2315 by jpye, Mon Dec 13 06:55:14 2010 UTC
# Line 63  def DoxyfileParse(file_contents): Line 63  def DoxyfileParse(file_contents):
63              if not data.has_key(key):              if not data.has_key(key):
64                 data[key] = list()                 data[key] = list()
65           elif token == "=":           elif token == "=":
66              data[key] = list()              if key == "TAGFILES" and data.has_key(key):
67                   append_data( data, key, False, "=" )
68                   new_data=False
69                else:
70                   data[key] = list()
71           else:           else:
72              append_data( data, key, new_data, token )              append_data( data, key, new_data, token )
73              new_data = True              new_data = True
# Line 81  def DoxyfileParse(file_contents): Line 85  def DoxyfileParse(file_contents):
85           data.pop(k)           data.pop(k)
86    
87        # items in the following list will be kept as lists and not converted to strings        # items in the following list will be kept as lists and not converted to strings
88        if k in ["INPUT", "FILE_PATTERNS", "EXCLUDE_PATTERNS"]:        if k in ["INPUT", "FILE_PATTERNS", "EXCLUDE_PATTERNS", "TAGFILES"]:
89           continue           continue
90    
91        if len(v) == 1:        if len(v) == 1:
# Line 117  def DoxySourceScan(node, env, path): Line 121  def DoxySourceScan(node, env, path):
121     file_patterns = data.get("FILE_PATTERNS", default_file_patterns)     file_patterns = data.get("FILE_PATTERNS", default_file_patterns)
122     exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns)     exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns)
123    
124       # We're running in the top-level directory, but the doxygen
125       # configuration file is in the same directory as node; this means
126       # that relative pathnames in node must be adjusted before they can
127       # go onto the sources list
128       conf_dir = os.path.dirname(str(node))
129      
130     for node in data.get("INPUT", []):     for node in data.get("INPUT", []):
131          if not os.path.isabs(node):
132             node = os.path.join(conf_dir, node)
133        if os.path.isfile(node):        if os.path.isfile(node):
134           sources.append(node)           sources.append(node)
135        elif os.path.isdir(node):        elif os.path.isdir(node):
# Line 135  def DoxySourceScan(node, env, path): Line 147  def DoxySourceScan(node, env, path):
147              for pattern in file_patterns:              for pattern in file_patterns:
148                 sources.extend(glob.glob("/".join([node, pattern])))                 sources.extend(glob.glob("/".join([node, pattern])))
149    
150       # Add tagfiles to the list of source files:
151       for node in data.get("TAGFILES", []):
152          file = node.split("=")[0]
153          if not os.path.isabs(file):
154             file = os.path.join(conf_dir, file)
155          sources.append(file)
156      
157       # Add additional files to the list of source files:
158       def append_additional_source(option):
159          file = data.get(option, "")
160          if file != "":
161             if not os.path.isabs(file):
162                file = os.path.join(conf_dir, file)
163             if os.path.isfile(file):
164                sources.append(file)
165    
166       append_additional_source("HTML_STYLESHEET")
167       append_additional_source("HTML_HEADER")
168       append_additional_source("HTML_FOOTER")
169    
170     sources = map( lambda path: env.File(path), sources )     sources = map( lambda path: env.File(path), sources )
171     return sources     return sources
172    
# Line 158  def DoxyEmitter(source, target, env): Line 190  def DoxyEmitter(source, target, env):
190    
191     targets = []     targets = []
192     out_dir = data.get("OUTPUT_DIRECTORY", ".")     out_dir = data.get("OUTPUT_DIRECTORY", ".")
193       if not os.path.isabs(out_dir):
194          conf_dir = os.path.dirname(str(source[0]))
195          out_dir = os.path.join(conf_dir, out_dir)
196    
197     # add our output locations     # add our output locations
198     for (k, v) in output_formats.items():     for (k, v) in output_formats.items():
199        if data.get("GENERATE_" + k, v[0]) == "YES":        if data.get("GENERATE_" + k, v[0]) == "YES":
200           targets.append(env.Dir( os.path.join(out_dir, data.get(k + "_OUTPUT", v[1]))) )           targets.append(env.Dir( os.path.join(out_dir, data.get(k + "_OUTPUT", v[1]))) )
201    
202       # add the tag file if neccessary:
203       tagfile = data.get("GENERATE_TAGFILE", "")
204       if tagfile != "":
205          if not os.path.isabs(tagfile):
206             conf_dir = os.path.dirname(str(source[0]))
207             tagfile = os.path.join(conf_dir, tagfile)
208          targets.append(env.File(tagfile))
209    
210     # don't clobber targets     # don't clobber targets
211     for node in targets:     for node in targets:
212        env.Precious(node)        env.Precious(node)
# Line 185  def generate(env): Line 228  def generate(env):
228        scan_check = DoxySourceScanCheck,        scan_check = DoxySourceScanCheck,
229     )     )
230    
231     doxyfile_builder = env.Builder(     import SCons.Builder
232        action = env.Action("cd ${SOURCE.dir}  &&  ${DOXYGEN} ${SOURCE.file}"),     doxyfile_builder = SCons.Builder.Builder(
233          action = "cd ${SOURCE.dir}  &&  ${DOXYGEN} ${SOURCE.file}",
234        emitter = DoxyEmitter,        emitter = DoxyEmitter,
235        target_factory = env.fs.Entry,        target_factory = env.fs.Entry,
236        single_source = True,        single_source = True,

Legend:
Removed from v.766  
changed lines
  Added in v.2315

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22