From: g0dil Date: Wed, 20 Dec 2006 16:52:21 +0000 (+0000) Subject: Extended doxyfile builder to invoke installdox X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=93db392bf3739914fbf297f4aefa396a2d304d92;p=senf.git Extended doxyfile builder to invoke installdox Add optional local configfile 'Doxyfile.local' git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@168 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Packets/Doxyfile b/Packets/Doxyfile index 7e3faa3..ccebd76 100644 --- a/Packets/Doxyfile +++ b/Packets/Doxyfile @@ -1,5 +1,6 @@ -PROJECT_NAME = libPackets -PROJECT_NUMBER = "Version 0.0.1" -TAGFILES = ../Utils/doc/doxytags +@INCLUDE = ../doclib/Doxyfile.global -@INCLUDE = ../doclib/Doxyfile.global \ No newline at end of file +PROJECT_NAME = libPackets +PROJECT_NUMBER = "Version 0.0.1" +TAGFILES = ../Utils/doc/Utils.tag +GENERATE_TAGFILE = doc/Packets.tag \ No newline at end of file diff --git a/SConstruct b/SConstruct index 2745e81..c6355b6 100644 --- a/SConstruct +++ b/SConstruct @@ -24,3 +24,5 @@ SConscript(glob.glob("*/SConscript")) SatSCons.StandardTargets(env) SatSCons.GlobalTargets(env) SatSCons.Doxygen(env) + +env.Command("Doxyfile.local", None, Touch("$TARGET")) diff --git a/Scheduler/Doxyfile b/Scheduler/Doxyfile index 8ddfbd9..d746d23 100644 --- a/Scheduler/Doxyfile +++ b/Scheduler/Doxyfile @@ -1,5 +1,6 @@ -PROJECT_NAME = libScheduler -PROJECT_NUMBER = "Version 0.0.1" -TAGFILES = ../Utils/doc/doxytags - @INCLUDE = ../doclib/Doxyfile.global + +PROJECT_NAME = libScheduler +PROJECT_NUMBER = "Version 0.0.1" +TAGFILES = ../Utils/doc/Utils.tag +GENERATE_TAGFILE = doc/Scheduler.tag diff --git a/Scheduler/Scheduler.hh b/Scheduler/Scheduler.hh index cdcd4f6..a54bed8 100644 --- a/Scheduler/Scheduler.hh +++ b/Scheduler/Scheduler.hh @@ -42,9 +42,9 @@ //#include "scheduler.mpp" ///////////////////////////////hh.p//////////////////////////////////////// +/** \brief SENF Project namespace */ namespace senf { - /** \brief Singleton class to manage the event loop This class manages a single select() type event loop. A diff --git a/Socket/Doxyfile b/Socket/Doxyfile index 1d1ccbb..93f192f 100644 --- a/Socket/Doxyfile +++ b/Socket/Doxyfile @@ -1,5 +1,7 @@ -PROJECT_NAME = libSocket -PROJECT_NUMBER = "Version 0.0.1" -TAGFILES = ../Utils/doc/doxytags +@INCLUDE = ../doclib/Doxyfile.global + +PROJECT_NAME = libSocket +PROJECT_NUMBER = "Version 0.0.1" +TAGFILES = ../Utils/doc/Utils.tag +GENERATE_TAGFILE = doc/Socket.tag -@INCLUDE = ../doclib/Doxyfile.global \ No newline at end of file diff --git a/Utils/Doxyfile b/Utils/Doxyfile index d57aedb..50ae9a9 100644 --- a/Utils/Doxyfile +++ b/Utils/Doxyfile @@ -1,4 +1,5 @@ -PROJECT_NAME = libUtils -PROJECT_NUMBER = "Version 0.0.1" - @INCLUDE = ../doclib/Doxyfile.global + +PROJECT_NAME = libUtils +PROJECT_NUMBER = "Version 0.0.1" +GENERATE_TAGFILE = doc/Utils.tag diff --git a/doclib/Doxyfile.global b/doclib/Doxyfile.global index 05a7777..22a55f8 100644 --- a/doclib/Doxyfile.global +++ b/doclib/Doxyfile.global @@ -186,12 +186,11 @@ SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = PREDEFINED = DOXYGEN -EXPAND_AS_DEFINED = DefineCommand +EXPAND_AS_DEFINED = prefix_ SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- -GENERATE_TAGFILE = doc/doxytags ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = /usr/bin/perl @@ -205,7 +204,7 @@ CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES UML_LOOK = NO -TEMPLATE_RELATIONS = NO +TEMPLATE_RELATIONS = YES INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES CALL_GRAPH = NO @@ -216,7 +215,7 @@ DOT_PATH = DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 800 MAX_DOT_GRAPH_HEIGHT = 1200 -MAX_DOT_GRAPH_DEPTH = 1000 +MAX_DOT_GRAPH_DEPTH = 3 DOT_TRANSPARENT = NO DOT_MULTI_TARGETS = YES GENERATE_LEGEND = YES @@ -225,3 +224,5 @@ DOT_CLEANUP = NO # Configuration::additions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = NO + +@INCLUDE = "../Doxyfile.local" \ No newline at end of file diff --git a/senfscons/Doxyfile b/senfscons/Doxyfile index 2f7e474..b244b64 100644 --- a/senfscons/Doxyfile +++ b/senfscons/Doxyfile @@ -1,4 +1,4 @@ -PROJECT_NAME = SENFSCons -PROJECT_NUMBER = "Version 0.0.1" +@INCLUDE = ../doclib/Doxyfile.global -@INCLUDE = ../doclib/Doxyfile.global \ No newline at end of file +PROJECT_NAME = SENFSCons +PROJECT_NUMBER = "Version 0.0.1" diff --git a/senfscons/Doxygen.py b/senfscons/Doxygen.py index 8ec61fc..48cec6e 100644 --- a/senfscons/Doxygen.py +++ b/senfscons/Doxygen.py @@ -59,7 +59,7 @@ def DoxyfileParse(file_contents, dir, data = None): else : key = token if token != '@' : key_token = False else: - if token == "+=" or (token == "==" and key == "@INCLUDE"): + if token == "+=" or (token == "=" and key == "@INCLUDE"): if not data.has_key(key): data[key] = list() elif token == "=": @@ -91,6 +91,7 @@ def DoxyfileParse(file_contents, dir, data = None): if len(v) == 1: data[k] = v[0] + return data except: return {} @@ -174,7 +175,9 @@ def DoxyEmitter(source, target, env): # Grmpf ... need to use a File object here. The problem is, that # Dir.scan() is implemented to just return the directory entries # and does *not* invoke the source-file scanners .. ARGH !! - node = env.File( os.path.join(str(source[0].dir), out_dir, data.get(k + "_OUTPUT", v[1]), ".stamp" )) + dir = env.Dir( os.path.join(str(source[0].dir), out_dir, data.get(k + "_OUTPUT", v[1])) ) + node = env.File( os.path.join(str(dir), ".stamp" ) ) + env.Clean(node, dir) targets.append( node ) if data.has_key("GENERATE_TAGFILE"): @@ -184,12 +187,76 @@ def DoxyEmitter(source, target, env): for node in targets: env.Precious(node) - # set up cleaning stuff - for node in targets: - env.Clean(node, node) - return (targets, source) +def doxyNodeHtmlDir(node): + if not node.sources : return None + data = DoxyfileParse(node.sources[0].get_contents(), str(node.sources[0].dir)) + if data.get("GENERATE_HTML",'YES') != 'YES' : return None + return os.path.normpath(os.path.join( str(node.sources[0].dir), + data.get("OUTPUT_DIRECTORY","."), + data.get("HTML_OUTPUT","html") )) + +def relpath(source, target): + source = os.path.normpath(source) + target = os.path.normpath(target) + prefix = os.path.dirname(os.path.commonprefix((source,target))) + prefix_len = prefix and len(prefix.split(os.sep)) or 0 + source_elts = source.split(os.sep) + target_elts = target.split(os.sep) + if source_elts[0] == '..' or target_elts[0] == '..': + raise ValueError, "invalid relapth args" + return os.path.join(*([".."] * (len(source_elts) - prefix_len) + + target_elts[prefix_len:])) + +def DoxyGenerator(source, target, env, for_signature): + + data = DoxyfileParse(source[0].get_contents(), str(source[0].dir)) + + actions = [ env.Action("cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file}") ] + + # This will add automatic 'installdox' calls. + # + # For every referenced tagfile, the generator first checks for the + # existence of a construction variable '_DOXY_URL' where + # '' is the uppercased name of the tagfile sans extension + # (e.g. 'Utils.tag' -> 'UTILS_DOXY_URL'). If this variable exists, + # it must contain the url or path to the installed documentation + # corresponding to the tag file. + # + # Is the variable is not found and if a referenced tag file is a + # target within this same build, the generator will parse the + # 'Doxyfile' from which the tag file is built. It will + # automatically create the html directory from the information in + # that 'Doxyfile'. + # + # If for any referenced tagfile no url can be found, 'installdox' + # will *not* be called and a warning about the missing url is + # generated. + + if data.get('GENERATE_HTML','YES') == "YES": + output_dir = os.path.normpath(os.path.join( str(source[0].dir), + data.get("OUTPUT_DIRECTORY","."), + data.get("HTML_OUTPUT","html") )) + args = [] + for tagfile in data.get('TAGFILES',[]): + url = env.get(os.path.splitext(os.path.basename(tagfile))[0].upper()+"_DOXY_URL", None) + if not url: + url = doxyNodeHtmlDir( + env.File(os.path.normpath(os.path.join( str(source[0].dir), tagfile )))) + if url : url = relpath(output_dir, url) + if not url: + print "WARNING:",str(node.sources[0]),": missing tagfile url for",tagfile + args = None + if args is not None and url: + args.append("-l %s@%s" % ( os.path.basename(tagfile), url )) + if args: + actions.append(env.Action('cd %s && ./installdox %s' % (output_dir, " ".join(args)))) + + actions.append(env.Action([ "touch $TARGETS" ])) + + return actions + def generate(env): """ Add builders and construction variables for the @@ -203,7 +270,7 @@ def generate(env): doxyfile_builder = env.Builder( # scons 0.96.93 hang on the next line but I don't know hot to FIX the problem - action = env.Action("( cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file} ) && touch $TARGETS"), + generator = DoxyGenerator, emitter = DoxyEmitter, target_factory = env.fs.Entry, single_source = True,