mirror of
https://github.com/boostorg/build.git
synced 2026-02-13 12:22:17 +00:00
- Factor out XSLT processing rules - Add "tests" rule to build testcases and Jamfiles doxygen.jam: - Use Doxygen as-is, without the monolithic XML file patch xsltproc.jam: - xsltproc XSLT toolset user-config.jam: - add "using xsltproc" [SVN r18241]
121 lines
3.5 KiB
Plaintext
121 lines
3.5 KiB
Plaintext
# Copyright (C) 2003 Doug Gregor. Permission to copy, use, modify,
|
|
# sell and distribute this software is granted provided this
|
|
# copyright notice appears in all copies. This software is provided
|
|
# "as is" without express or implied warranty, and with no claim as
|
|
# to its suitability for any purpose.
|
|
|
|
# This module defines rules to handle generation of BoostBook XML
|
|
# from Doxygen XML output. At the moment, this requires a special
|
|
# version of Doxygen that can output a single XML file instead of a
|
|
# set of XML files.
|
|
|
|
import class : class new ;
|
|
import targets ;
|
|
import feature ;
|
|
import property ;
|
|
import generators ;
|
|
import boostbook ;
|
|
|
|
feature.feature recursive : off on ;
|
|
feature.feature pattern : : free ;
|
|
type.register DOXYGEN_XML : doxygen ; # Doxygen XML output
|
|
|
|
generators.register-standard doxygen.xml-to-boostbook : DOXYGEN_XML : XML ;
|
|
|
|
# Initialize the Doxygen module. Parameters are:
|
|
# name: the name of the 'doxygen' executable. If not specified, the name
|
|
# 'doxygen' will be used
|
|
rule init ( name ? )
|
|
{
|
|
if ! $(.initialized)
|
|
{
|
|
.initialized = true ;
|
|
|
|
if $(name)
|
|
{
|
|
.doxygen = $(name) ;
|
|
}
|
|
}
|
|
}
|
|
|
|
rule name ( )
|
|
{
|
|
return $(.doxygen) ;
|
|
}
|
|
|
|
rule extract-xml ( target : sources * : properties * )
|
|
{
|
|
local recursive = [ feature.get-values <recursive> : $(properties) ] ;
|
|
|
|
if $(recursive) = "on"
|
|
{
|
|
RECURSIVE on $(target) = YES ;
|
|
}
|
|
else
|
|
{
|
|
RECURSIVE on $(target) = NO ;
|
|
}
|
|
|
|
local index-target = $(target:B="xml/index":S=".xml") ;
|
|
PATTERNS on $(index-target) =
|
|
[ feature.get-values <pattern> : $(properties) ] ;
|
|
NAME on $(index-target) = [ name ] ;
|
|
doxygen-action $(index-target) : $(>) ;
|
|
|
|
local xsl-dir = [ boostbook.xsl-dir ] ;
|
|
DEPENDS $(target) : $(index-target) ;
|
|
xslt $(target) : $(index-target) "$(xsl-dir)/doxygen/collect.xsl"
|
|
: <xsl:param>doxygen.xml.path=/home/gregod/Projects/Boost/boost/libs/any/doc/xml ;
|
|
}
|
|
|
|
actions doxygen-action
|
|
{
|
|
$(NAME:E=doxygen) -g doxyfile
|
|
echo "GENERATE_HTML = NO" >> doxyfile
|
|
echo "GENERATE_LATEX = NO" >> doxyfile
|
|
echo "GENERATE_XML = YES" >> doxyfile
|
|
echo "INPUT = $(>) " >> doxyfile
|
|
echo "RECURSIVE = $(RECURSIVE) " >> doxyfile
|
|
echo "FILE_PATTERNS = $(PATTERNS) " >> doxyfile
|
|
$(NAME:E=doxygen) doxyfile ;
|
|
}
|
|
|
|
rule xml-to-boostbook ( target : source : properties * )
|
|
{
|
|
local xsl-dir = [ boostbook.xsl-dir ] ;
|
|
|
|
xslt $(target) : $(source) "$(xsl-dir)/doxygen/doxygen2boostbook.xsl"
|
|
: $(properties)
|
|
;
|
|
}
|
|
|
|
rule doxygen-xml-target-class ( name : project : sources * : requirements *
|
|
: default-build * )
|
|
{
|
|
basic-target.__init__ $(name) : $(project) : $(sources) : $(requirements)
|
|
: $(default-build) ;
|
|
|
|
rule construct ( source-targets * : property-set )
|
|
{
|
|
local target =
|
|
[ virtual-target.from-file $(self.name) : $(self.project) ] ;
|
|
local a = [ new action $(target) : $(source-targets) : doxygen.extract-xml
|
|
: $(property-set) ] ;
|
|
$(target).action $(a) ;
|
|
|
|
return [ virtual-target.register $(target) ] ;
|
|
}
|
|
}
|
|
|
|
class doxygen-xml-target-class : basic-target ;
|
|
|
|
rule doxygen ( target-name : sources * : requirements * : default-build * )
|
|
{
|
|
local project = [ CALLER_MODULE ] ;
|
|
targets.main-target-alternative
|
|
[ new doxygen-xml-target-class $(target-name) : $(project) : $(sources)
|
|
: [ targets.main-target-requirements $(requirements) : $(project) ]
|
|
: [ targets.main-target-default-build $(default-build) : $(project) ]
|
|
] ;
|
|
}
|