X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=site_scons%2Fsite_tools%2FDoxygen.py;h=cd8c39b8e401e55d494ca8aeb1a5e5b94ba90d2c;hb=ad287a6e1241649e73188edf5b8902e4e65f615d;hp=2b4530b0ac3cac6b1a819330523944441a9d75d0;hpb=d33cd468d4ece7c0c98270b4d1a9858e5a94510d;p=senf.git diff --git a/site_scons/site_tools/Doxygen.py b/site_scons/site_tools/Doxygen.py index 2b4530b..cd8c39b 100644 --- a/site_scons/site_tools/Doxygen.py +++ b/site_scons/site_tools/Doxygen.py @@ -17,53 +17,11 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# The Modifications are Copyright (C) 2006,2007 +# The Modifications are Copyright (C) 2006,2007,2008,2009 # Fraunhofer Institute for Open Communication Systems (FOKUS) # Competence Center NETwork research (NET), St. Augustin, GERMANY # Stefan Bund -## \file -# \brief Doxygen builder - -## \package senfscons.Doxygen -# \brief Doxygen Documentation Builder -# -# This builder will invoke \c doxygen to build software -# documentation. The doxygen builder only takes the name of the -# doxyfile as it's source file. The builder parses that doxygen -# configuration file. -# -# The builder will automatically find all sources on which the -# documentation depends. This includes -# \li the source code files (as selected by the \c RECURSIVE, \c -# FILE_PATTERNS, \c INPUT and \c EXCLUDE_PATTERNS doxygen -# directives -# \li the \c HTML_HEADER and \c HTML_FOOTER -# \li all referenced \c TAGFILES -# \li the \c INPUT_FILTER -# \li all included doxyfiles (via \c @INCLUDE) -# -# The builder will emit a list of targets built by doxygen. This -# depends on the types of documentation built. -# -# The builder will also generate additional commands to resolve -# cross-references to other module documentations. This is based on -# the \c TAGFILES used. Tagfiles built in the same project in other -# modules are automatically found and the links will be resolved -# correctly. To resolve links from external tagfiles, you may specify -# tagfilename_DOXY_URL as a construction environment -# variable to specify the path to resolve references from the given -# tagfile to. tagfilename is the uppercased basename of the -# tagfile used. -# -# \par Construction Envrionment Variables: -# -# -# -#
\c DOXYGENdoxygen command, defaults to \c doxygen
tag_DOXY_URLexternal tagfile resolve URL
-# -# \ingroup builder - # I (g0dil@berlios.de) have been fighting 4 problems in this # implementation: # - A Directory target will *not* call any source scanners @@ -75,11 +33,10 @@ # - Theres a bug in SCons which will produce an error message for # directory targets if dir.sources is not set explicitly # - the first argument to env.Clean() must be the command line target, -# with which the scons was invoked. This does not help to add -# aditional files or directories to be cleaned if you don't know -# that target (it's not possible to say 'if you clean this file, -# also clean that one' hich is, what I had expected env.Clean to -# do). +# with which scons was invoked. This does not help to add aditional +# files or directories to be cleaned if you don't know that target +# (it's not possible to say 'if you clean this file, also clean that +# one' which is, what I had expected env.Clean to do). # # Together, these problems have produced several difficulties. I have # solved them by @@ -87,7 +44,7 @@ # cause source scanners to be invoked # - Adding the documentation directory as a target (so it will be # cleaned up which env.Clean doesn't help me to do), but *only* if -# scons is called to with the -c option +# scons is called with the -c option # - Setting dir.sources to the known source-list to silence the error # message whenever a directory is added as a target # @@ -239,7 +196,7 @@ class DoxyfileParser: parser.parse() return - raise ValueError,"@INCLUDE file not found" + raise ValueError,"@INCLUDE file '%s' not found" % value[0] def _INCLUDE_PATH(self, op, value): self._include_path.extend(value) @@ -403,14 +360,14 @@ def relpath(source, target): return os.path.join(*([".."] * (len(source_elts) - prefix_len) + target_elts[prefix_len:])) -def DoxyGenerator(source, target, env, for_signature): - data = DoxyfileParse(env, source[0].abspath) - actions = [ - SCons.Action.Action("$DOXYGENCOM"), - SCons.Action.Action([ "touch $TARGETS" ]), - ] - - return actions +def doxyAction(target, source, env): + e = {} + e.update(env['ENV']) + for k,v in env.get('DOXYENV',[]).iteritems() : e[k] = env.subst(v) + SCons.Action.Action("$DOXYGENCOM")(target, source, env.Clone(ENV = e), show=False) + +def doxyActionStr(target, source, env): + return env.subst("$DOXYGENCOM") def generate(env): """ @@ -424,7 +381,8 @@ def generate(env): ) doxyfile_builder = env.Builder( - generator = DoxyGenerator, + action = [ SCons.Action.Action(doxyAction, doxyActionStr), + SCons.Action.Action([ "touch $TARGETS" ]) ], emitter = DoxyEmitter, target_factory = env.fs.Entry, single_source = True,