Update of /cvsroot/boost/boost/tools/build/v2/tools
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27258/tools/build/v2/tools

Modified Files:
        doxygen.jam 
Log Message:
Put in the build support for using the doxproc, Python based, Doxygen to 
BoostBook translator.

Index: doxygen.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/doxygen.jam,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- doxygen.jam 8 Feb 2007 19:27:41 -0000       1.29
+++ doxygen.jam 17 Apr 2007 04:44:59 -0000      1.30
@@ -33,6 +33,10 @@
 import xsltproc ;
 import make ;
 import os ;
+import toolset : flags ;
+import alias ;
+import common ;
+import modules ;
 
 # Use to specify extra configuration paramters. These get translated
 # into a doxyfile which configures the building of the docs.
@@ -44,17 +48,29 @@
 # Specify the "<xsl:param>boost.doxygen.reftitle" XSLT option.
 feature.feature reftitle : : free ;
 
+# Which processor to use for various translations from Doxygen.
+feature.feature doxygen.processor : xsltproc doxproc : propagated implicit ;
+
+# To generate, or not, index sections.
+feature.feature doxygen.doxproc.index : no yes : propagated incidental ;
+
+# The ID for the resulting BoostBook reference section.
+feature.feature doxygen.doxproc.id : : free ;
+
+# The title for the resulting BoostBook reference section.
+feature.feature doxygen.doxproc.title : : free ;
+
 # Doxygen configuration input file.
 type.register DOXYFILE : doxyfile ;
 
 # Doxygen XML multi-file output.
-type.register DOXYGEN_XML_MULTIFILE : : XML ;
+type.register DOXYGEN_XML_MULTIFILE : xml-dir : XML ;
 
 # Doxygen XML coallesed output.
 type.register DOXYGEN_XML : doxygen : XML ;
 
 # Doxygen HTML multifile directory.
-type.register DOXYGEN_HTML_MULTIFILE : dir : HTML ;
+type.register DOXYGEN_HTML_MULTIFILE : html-dir : HTML ;
 
 # Redirection HTML file to HTML multifile directory.
 type.register DOXYGEN_HTML : : HTML ;
@@ -125,13 +141,24 @@
             .doxygen = $(name) ;
         }
         .doxygen ?= doxygen ;
+        
+        .doxproc = [ modules.binding $(__name__) ] ;
+        .doxproc = $(.doxproc:D)/doxproc.py ;
 
-        generators.register-composing doxygen.headers-to-doxyfile : H HPP CPP 
: DOXYFILE ;
-        generators.register-standard doxygen.run : DOXYFILE : 
DOXYGEN_XML_MULTIFILE ;
-        generators.register-standard doxygen.xml-to-boostbook : DOXYGEN_XML : 
BOOSTBOOK ;
-        generators.register-standard doxygen.collect : DOXYGEN_XML_MULTIFILE : 
DOXYGEN_XML ;
-        generators.register-standard doxygen.run : DOXYFILE : 
DOXYGEN_HTML_MULTIFILE ;
-        generators.register-standard doxygen.html-redirect : 
DOXYGEN_HTML_MULTIFILE : DOXYGEN_HTML ;
+        generators.register-composing doxygen.headers-to-doxyfile
+            : H HPP CPP : DOXYFILE ;
+        generators.register-standard doxygen.run
+            : DOXYFILE : DOXYGEN_XML_MULTIFILE ;
+        generators.register-standard doxygen.xml-dir-to-boostbook
+            : DOXYGEN_XML_MULTIFILE : BOOSTBOOK : <doxygen.processor>doxproc ;
+        generators.register-standard doxygen.xml-to-boostbook
+            : DOXYGEN_XML : BOOSTBOOK : <doxygen.processor>xsltproc ;
+        generators.register-standard doxygen.collect
+            : DOXYGEN_XML_MULTIFILE : DOXYGEN_XML ;
+        generators.register-standard doxygen.run
+            : DOXYFILE : DOXYGEN_HTML_MULTIFILE ;
+        generators.register-standard doxygen.html-redirect
+            : DOXYGEN_HTML_MULTIFILE : DOXYGEN_HTML ;
 
         IMPORT $(__name__) : doxygen : : doxygen ;
     }
@@ -150,7 +177,13 @@
 # action must deal with this behavior.
 actions doxygen-action
 {
-    "$(NAME:E=doxygen)" $(>) && echo "Stamped" > "$(<)"
+    $(RM) "$(*.XML)" & "$(NAME:E=doxygen)" $(>) && echo "Stamped" > "$(<)"
+}
+
+# Runs the Python doxproc XML processor.
+actions doxproc
+{
+    python "$(DOXPROC)" "--xmldir=$(>)" "--output=$(<)" "$(OPTIONS)" 
"--id=$(ID)" "--title=$(TITLE)"
 }
 
 # Generates a doxygen configuration file (doxyfile) given a set of C++
@@ -159,12 +192,24 @@
 rule headers-to-doxyfile ( target : sources * : properties * )
 {
     local text "# Generated by Boost.Build version 2" ;
+    
+    local output-dir ;
 
     # Translate <doxygen:param> into command line flags.
     for local param in [ feature.get-values <doxygen:param> : $(properties) ]
     {
         local namevalue = [ regex.match ([^=]*)=(.*) : $(param) ] ;
         text += "$(namevalue[1]) = $(namevalue[2])" ;
+        if $(namevalue[1]) = OUTPUT_DIRECTORY
+        {
+            output-dir = "$(namevalue[2])" ;
+        }
+    }
+    
+    if ! $(output-dir)
+    {
+        output-dir = [ on $(target) return $(LOCATE) ] ;
+        text += "OUTPUT_DIRECTORY = $(output-dir)" ;
     }
 
     local headers = "" ;
@@ -188,6 +233,15 @@
 {
     doxygen-action $(target) : $(source) ;
     NAME on $(target) = $(.doxygen) ;
+    RM on $(target) = [ modules.peek common : RM ] ;
+    *.XML on $(target) =
+        [ path.native
+            [ path.join
+                [ path.make [ on $(target) return $(LOCATE) ] ]
+                $(target:B:S=)
+                *.xml ]
+            ]
+        ;
 }
 
 # The rules below require Boost.Book stylesheets, so we need
@@ -218,9 +272,12 @@
     local collect-xsl-dir = [ path.native
         [ path.join [ boostbook.xsl-dir ] doxygen collect ]
         ] ;
-    local collect-path = [ path.join [ path.pwd ] xml ] ;
-    local real-source = [ path.native xml/index.xml ] ;
-    NOTFILE $(real-source) ;
+    local source-path
+        = [ path.make [ on $(source) return $(LOCATE) ] ] ;
+    local collect-path
+        = [ path.join [ path.pwd ] $(source-path) $(source:B) ] ;
+    local real-source
+        = [ path.native [ path.join [ path.native $(collect-path) ] index.xml 
] ] ;
     xsltproc.xslt $(target) : $(real-source) $(collect-xsl-dir:S=.xsl)
         : <xsl:param>doxygen.xml.path=$(collect-path)
         ;
@@ -248,6 +305,19 @@
     xsltproc.xslt $(target) : $(source) $(d2b-xsl) : $(xslt-properties) ;
 }
 
+flags doxygen.xml-dir-to-boostbook OPTIONS <doxygen.doxproc.index>yes : 
--enable-index ;
+flags doxygen.xml-dir-to-boostbook ID <doxygen.doxproc.id> ;
+flags doxygen.xml-dir-to-boostbook TITLE <doxygen.doxproc.title> ;
+
+rule xml-dir-to-boostbook ( target : source : properties * )
+{
+    DOXPROC on $(target) = $(.doxproc) ;
+    
+    LOCATE on $(source:S=) = [ on $(source) return $(LOCATE) ] ;
+    
+    doxygen.doxproc $(target) : $(source:S=) ;
+}
+
 # Generate the HTML redirect to HTML dir index.html file.
 rule html-redirect ( target : source : properties * )
 {
@@ -273,7 +343,7 @@
 }
 
 # User-level rule to generate BoostBook XML from a set of headers via Doxygen.
-rule doxygen ( target : sources * : requirements * : default-build * )
+rule doxygen ( target : sources * : requirements * : default-build * : 
usage-requirements * )
 {
     local project = [ project.current ] ;
 
@@ -325,24 +395,65 @@
     else
     {
         # Build a BoostBook XML file from the sources.
-        local doxyfile = [
-            new typed-target $(target) : $(project) : BOOSTBOOK
-                : [ targets.main-target-sources $(sources) : $(target) ]
+        local location-xml = [ feature.get-values <location> : $(requirements) 
] ;
+        requirements = [ property.change $(requirements) : <location> ] ;
+        local target-xml = $(target:B=$(target:B)-xml) ;
+        
+        ## The doxygen configuration file.
+        targets.main-target-alternative
+            [ new typed-target $(target-xml:S=.tag) : $(project) : DOXYFILE
+                : [ targets.main-target-sources $(sources) : 
$(target-xml:S=.tag) ]
                 : [ targets.main-target-requirements $(requirements)
                     <doxygen:param>GENERATE_HTML=NO
                     <doxygen:param>GENERATE_XML=YES
+                    <doxygen:param>XML_OUTPUT=$(target-xml)
                     : $(project) ]
                 : [ targets.main-target-default-build $(default-build) : 
$(project) ]
             ] ;
-        targets.main-target-alternative $(doxyfile) ;
+        $(project).mark-target-as-explicit $(target-xml:S=.tag) ;
+        
+        ## The Doxygen XML directory of the processed source files.
+        targets.main-target-alternative
+            [ new typed-target $(target-xml:S=.dir) : $(project) : 
DOXYGEN_XML_MULTIFILE
+                : $(target-xml:S=.tag)
+                : [ targets.main-target-requirements $(requirements)
+                    : $(project) ]
+                : [ targets.main-target-default-build $(default-build) : 
$(project) ]
+            ] ;
+        $(project).mark-target-as-explicit $(target-xml:S=.dir) ;
+        
+        ## The resulting BoostBook file is generated by the processor tool. The
+        ## tool can be either the xsltproc plus accompanying XSL scripts. Or it
+        ## can be the python doxproc.py script.
+        targets.main-target-alternative
+            [ new typed-target $(target-xml) : $(project) : BOOSTBOOK
+                :  $(target-xml:S=.dir)
+                : [ targets.main-target-requirements $(requirements)
+                    : $(project) ]
+                : [ targets.main-target-default-build $(default-build) : 
$(project) ]
+            ] ;
+        $(project).mark-target-as-explicit $(target-xml) ;
 
         targets.main-target-alternative
             [ new install-target-class $(target:S=.xml) : $(project)
-                : [ $(doxyfile).name ]
+                : $(target-xml)
+                : [ targets.main-target-requirements $(requirements)
+                    <location>$(location-xml:E=.)
+                    <name>$(target:S=.xml)
+                    : $(project) ]
+                : [ targets.main-target-default-build $(default-build) : 
$(project) ]
+            ] ;
+        $(project).mark-target-as-explicit $(target:S=.xml) ;
+        
+        targets.main-target-alternative
+            [ new alias-target-class $(target) : $(project)
+                : 
                 : [ targets.main-target-requirements $(requirements)
-                    <location>.
                     : $(project) ]
                 : [ targets.main-target-default-build $(default-build) : 
$(project) ]
+                : [ targets.main-target-usage-requirements 
$(usage-requirements)
+                    <dependency>$(target:S=.xml)
+                    : $(project) ]
             ] ;
     }
 }


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to