From: g0dil Date: Thu, 3 Sep 2009 09:44:43 +0000 (+0000) Subject: Better doxygen env-var handling (e.g. REVISION) X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=2596fec751f49e59e7b152bf15bced29cc586ef0;p=senf.git Better doxygen env-var handling (e.g. REVISION) git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1375 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/site_scons/senfutil.py b/site_scons/senfutil.py index 215a42f..39866d3 100644 --- a/site_scons/senfutil.py +++ b/site_scons/senfutil.py @@ -242,6 +242,7 @@ def Doxygen(env, doxyheader=None, doxyfooter=None, doxycss=None, mydoxyfile=Fals DOXYOPTS = [ '--html', '--tagfiles', '"$TAGFILES"' ], DOXYENV = { 'TOPDIR' : env.Dir('#').abspath, 'LIBDIR' : libdir, + 'REVISION' : '$REVISION', 'tagfiles' : '$TAGFILES', 'output_dir' : 'doc', 'html_dir' : 'html', diff --git a/site_scons/site_tools/Doxygen.py b/site_scons/site_tools/Doxygen.py index a1975c9..cd8c39b 100644 --- a/site_scons/site_tools/Doxygen.py +++ b/site_scons/site_tools/Doxygen.py @@ -360,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): """ @@ -381,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,