mirror of
https://github.com/boostorg/boostbook.git
synced 2025-05-08 18:33:58 +00:00
Comparing formatted XML files makes the comparison less sensitive to whitespace and newline differences between XML documents, and also makes the subsequent diff more informative, if any differences are found.
53 lines
1.2 KiB
Plaintext
53 lines
1.2 KiB
Plaintext
# Copyright 2009 Daniel James.
|
|
# Copyright 2024 Andrey Semashev
|
|
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
using boostbook ;
|
|
using doxygen ;
|
|
import xsltproc ;
|
|
import make ;
|
|
import os ;
|
|
|
|
doxygen autodoc
|
|
:
|
|
[ glob boost/*.hpp ]
|
|
:
|
|
<xsl:param>"boost.doxygen.reftitle=Example Reference"
|
|
;
|
|
|
|
# Applies format.xsl to an XML file to reduce potential newline/whitespace
|
|
# differences and make the subsequent diff more informative.
|
|
rule format-xml ( target : source : properties * )
|
|
{
|
|
xsltproc.xslt $(target) : $(source) format.xsl : $(properties) ;
|
|
}
|
|
|
|
make autodoc.xml.formatted : autodoc.xml : format-xml ;
|
|
make autodoc.gold.formatted : autodoc.gold : format-xml ;
|
|
|
|
if [ os.name ] = NT
|
|
{
|
|
actions compare
|
|
{
|
|
comp /A $(>[1]) $(>[2]) && echo "Stamped" >$(<)
|
|
}
|
|
}
|
|
else
|
|
{
|
|
actions compare
|
|
{
|
|
diff -u -w $(>[1]) $(>[2]) && echo "Stamped" >$(<)
|
|
}
|
|
}
|
|
|
|
make check : autodoc.xml.formatted autodoc.gold.formatted : @compare ;
|
|
|
|
boostbook standalone
|
|
:
|
|
example.xml
|
|
:
|
|
<xsl:param>boost.root=../../../../..
|
|
<dependency>autodoc
|
|
;
|