summaryrefslogtreecommitdiff
path: root/xsd
diff options
context:
space:
mode:
Diffstat (limited to 'xsd')
-rw-r--r--xsd/README2
-rw-r--r--xsd/build/bootstrap.build1
-rw-r--r--xsd/build/root.build13
-rw-r--r--xsd/doc/buildfile235
-rw-r--r--xsd/manifest14
-rw-r--r--xsd/xsd/buildfile86
6 files changed, 185 insertions, 166 deletions
diff --git a/xsd/README b/xsd/README
index 80d707f..dc1d4db 100644
--- a/xsd/README
+++ b/xsd/README
@@ -13,6 +13,8 @@ defined in XML Schema. Using these parser templates you can build
your own in-memory representations or perform immediate processing
of XML instance documents.
+Note also that the xsd executable provides build2 metadata.
+
See the NEWS file for the user-visible changes from the previous release.
See the LICENSE file for distribution conditions.
diff --git a/xsd/build/bootstrap.build b/xsd/build/bootstrap.build
index aaf60f8..6c0d4ab 100644
--- a/xsd/build/bootstrap.build
+++ b/xsd/build/bootstrap.build
@@ -5,5 +5,6 @@ project = xsd
using version
using config
+using test
using dist
using install
diff --git a/xsd/build/root.build b/xsd/build/root.build
index ace0237..4407c3e 100644
--- a/xsd/build/root.build
+++ b/xsd/build/root.build
@@ -1,6 +1,11 @@
# file : build/root.build
# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+config [bool] config.xsd.develop ?= false
+
+define cli: file
+cli{*}: extension = cli
+
using in
cxx.std = latest
@@ -20,14 +25,6 @@ if ($cxx.class == 'msvc')
cxx.poptions =+ "-I$out_root" "-I$src_root"
-# Load the cli module but only if it's available. This way a distribution
-# that includes pre-generated files can be built without installing cli.
-# This is also the reason why we need to explicitly spell out individual
-# source file prerequisites instead of using the cli.cxx{} group (it won't
-# be there unless the module is configured).
-#
-using? cli
-
# Extract the copyright notice from the LICENSE file.
#
# Note that cat is a builtin which means this is both portable and fast.
diff --git a/xsd/doc/buildfile b/xsd/doc/buildfile
index ccfc060..b15831a 100644
--- a/xsd/doc/buildfile
+++ b/xsd/doc/buildfile
@@ -25,7 +25,7 @@ png{*}: extension = png
define svg: file
svg{*}: extension = svg
-import? [metadata] cli = cli%exe{cli}
+import! [metadata] cli = cli%exe{cli}
# Import the html2ps and ps2pdf14 programs only if present on the system. This
# way a distribution that includes pre-generated files can be built without
@@ -34,99 +34,103 @@ import? [metadata] cli = cli%exe{cli}
import? html2ps = html2ps%exe{html2ps}
import? ps2pdf14 = ps2pdf14%exe{ps2pdf14}
+if $config.xsd.develop
+{
+ if ($html2ps == [null] || $ps2pdf14 == [null])
+ warn "html2ps and/or ps2pdf14 are not available, not generating .ps and .pdf documentation"
+}
+
./: xsd{custom-literals}
-# Note that we include the cli, html2ps, and ps2pdf14 generated files into the
-# distribution and don't remove them when cleaning in src (so that clean
-# results in a state identical to distributed).
+# Generate the man pages.
+#
+ops = $(src_root)/xsd/cxx/cli{options tree/options parser/options}
+
+doc_version = [string] "$version.major\.$version.minor\.$version.patch"
+if $version.pre_release
+ doc_version += "-$version.pre_release_string"
-# Generate the man pages if the cli program is available and handle (install,
-# distribute, etc) the pre-generated files otherwise, if present.
+# Let's take the last for-digit number to cover 2000-2021,2022.
#
-if ($cli != [null])
-{
- ./: {man1 xhtml}{xsd}
-
- man_topics = $(src_root)/xsd/cxx/cli{options tree/options parser/options}
-
- man_options = -v project="XSD" \
- -v version="$version.project_id" \
- -v copyright="$copyright" \
- -I $src_root \
- --stdout \
- --suppress-undocumented \
- --exclude-base
-
- man1{xsd}: $man_topics \
- man1{xsd-prologue \
- xsd-tree-header \
- xsd-parser-header \
- xsd-epilogue} \
- $cli
- {
- dist = true
- clean = ($src_root != $out_root)
- }
- {{
- diag cli $> : ($<[0]) # @@ TMP: revise
+doc_year = $regex.replace($copyright, '.+[-, ]([0-9][0-9][0-9][0-9]) .+', '\1')
- # Note that the date change doesn't change the script semantics, thus the
- # variable is defined locally.
- #
- date +"%B %Y" | set date
-
- $cli --generate-man -v date="$date" $man_options \
- --class CXX::options \
- --class options \
- --man-prologue-file $path($<[3]) \
- $path($<[0]) >$path($>)
-
- $cli --generate-man -v date="$date" $man_options \
- --man-prologue-file $path($<[4]) \
- $path($<[1]) >>$path($>)
-
- $cli --generate-man -v date="$date" $man_options \
- --man-prologue-file $path($<[5]) \
- --man-epilogue-file $path($<[6]) \
- $path($<[2]) >>$path($>)
- }}
-
- xhtml{xsd}: $man_topics \
- xhtml{xsd-prologue \
- xsd-tree-header \
- xsd-parser-header \
- xsd-epilogue} \
- css{*} \
- $cli
- {
- dist = true
- clean = ($src_root != $out_root)
- }
- {{
- diag cli $> : ($<[0]) # @@ TMP: revise
-
- date +"%B %Y" | set date
-
- $cli --generate-html -v date="$date" $man_options \
- --class CXX::options \
- --class options \
- --html-prologue-file $path($<[3]) \
- $path($<[0]) >$path($>)
-
- $cli --generate-html -v date="$date" $man_options \
- --html-prologue-file $path($<[4]) \
- $path($<[1]) >>$path($>)
-
- $cli --generate-html -v date="$date" $man_options \
- --html-prologue-file $path($<[5]) \
- --html-epilogue-file $path($<[6]) \
- $path($<[2]) >>$path($>)
- }}
+man_options = -v project="XSD" \
+ -v version="$doc_version" \
+ -v copyright="$copyright" \
+ -I $src_root \
+ --stdout \
+ --suppress-undocumented \
+ --exclude-base
+
+
+# Note: *logue and *-header are not real man pages.
+#
+./: man1{xsd}: $ops \
+ file{xsd-prologue.1 \
+ xsd-tree-header.1 \
+ xsd-parser-header.1 \
+ xsd-epilogue.1} \
+ $cli
+{
+ dist = true # Include into the distribution for user's convenience.
}
-else
- # Distribute both the pre-generated file (if present) and the sources.
+{{
+ diag cli --man ($<[0])
+
+ # Use the copyright year to approximate the last authoring date.
#
- ./: {man1 xhtml}{+xsd xsd-*} css{*}
+ $cli --generate-man -v date="January $doc_year" \
+ $man_options \
+ --class CXX::options \
+ --class options \
+ --man-prologue-file $path($<[3]) \
+ $path($<[0]) >$path($>)
+
+ $cli --generate-man -v date="January $doc_year" \
+ $man_options \
+ --man-prologue-file $path($<[4]) \
+ $path($<[1]) >>$path($>)
+
+ $cli --generate-man -v date="January $doc_year" \
+ $man_options \
+ --man-prologue-file $path($<[5]) \
+ --man-epilogue-file $path($<[6]) \
+ $path($<[2]) >>$path($>)
+}}
+
+# Note: *logue and *-header are not real xhtml files.
+#
+./: xhtml{xsd}: $ops \
+ file{xsd-prologue.xhtml \
+ xsd-tree-header.xhtml \
+ xsd-parser-header.xhtml \
+ xsd-epilogue.xhtml} \
+ css{*} \
+ $cli
+{
+ dist = true
+}
+{{
+ diag cli --html ($<[0])
+
+ $cli --generate-html -v date="January $doc_year" \
+ $man_options \
+ --class CXX::options \
+ --class options \
+ --html-prologue-file $path($<[3]) \
+ $path($<[0]) >$path($>)
+
+ $cli --generate-html -v date="January $doc_year" \
+ $man_options \
+ --html-prologue-file $path($<[4]) \
+ $path($<[1]) >>$path($>)
+
+ $cli --generate-html -v date="January $doc_year" \
+ $man_options \
+ --html-prologue-file $path($<[5]) \
+ --html-epilogue-file $path($<[6]) \
+ $path($<[2]) >>$path($>)
+}}
# Generate the user guide/manual ps/pdf files if the html2ps and ps2pdf14
# programs are imported and handle (install, distribute, etc) the
@@ -138,50 +142,55 @@ for d: cxx/parser/guide/ cxx/tree/guide/ cxx/tree/manual/
l = "([dir_path] $path.leaf($d))" # guide, manual
f = "cxx-$p-$l" # cxx-parser-guide, etc
- ./: $d/xhtml{index}: $d/{png svg}{*}
+ ./: $d/{png svg}{*}
- $d/xhtml{index}: $d/in{index}
+ ./: $d/xhtml{index}: $d/in{index}
{
in.symbol = '@'
+
+ dist = true
+ clean = ($src_root != $out_root)
}
- if ($html2ps != [null])
+ if ($html2ps != [null] && $ps2pdf14 != [null])
{
+ # Note that we include these generated files into the distribution and
+ # don't remove them when cleaning in src (so that clean results in a state
+ # identical to distributed).
+ #
./: $d/ps{$f}: $d/xhtml{index} $d/html2ps{$l} $html2ps
{
+ base = $src_base/$d
+
+ dist = true
+ clean = ($src_root != $out_root)
+ }
+ {{
+ diag html2ps ($<[0])
+
+ # Note: --base must include trailing directory separator.
+ #
+ $html2ps --base $base -f $path($<[1]) -o $path($>) $path($<[0])
+ }}
+
+ ./: $d/pdf{$f}: $d/ps{$f} $ps2pdf14
+ {
dist = true
clean = ($src_root != $out_root)
}
{{
- diag html2ps $> : ($<[0]) # @@ TMP: revise
+ diag ps2pdf14 ($<[0])
- $html2ps -f $path($<[1]) -o $path($>) $path($<[0])
+ $ps2pdf14 -dOptimize=true -dEmbedAllFonts=true $path($<[0]) $path($>)
}}
- if ($ps2pdf14 != [null])
+ $d/html2ps{$l}: $d/in{$l}
{
- ./: $d/pdf{$f}: $d/ps{$f} $ps2pdf14
- {
- dist = true
- clean = ($src_root != $out_root)
- }
- {{
- diag ps2pdf14 $> : ($<[0]) # @@ TMP: revise
-
- $ps2pdf14 -dOptimize=true -dEmbedAllFonts=true $path($<[0]) $path($>)
- }}
+ in.symbol = '@'
}
- else
- ./: $d/pdf{+$f}
}
else
- ./: $d/{ps pdf}{+$f} $d/html2ps{$l}
-
- $d/html2ps{$l}: $d/in{$l}
- {
- in.symbol = '@'
- }
+ ./: $d/{ps pdf}{+$f} $d/file{$l.html2ps.in}
}
-{man1 xhtml}{xsd-*}: install = false # xsd-prologue, etc
-doc{*}: install.subdirs = true
+doc{*}: install.subdirs = true
diff --git a/xsd/manifest b/xsd/manifest
index db9720b..52e789a 100644
--- a/xsd/manifest
+++ b/xsd/manifest
@@ -1,6 +1,6 @@
: 1
name: xsd
-version: 4.2.0-b.1.z
+version: 4.2.0-b.2.z
summary: XML Schema to C++ data binding compiler
license: other: GPL-2.0-only with Xerces-C++ linking exception and FLOSS exception
topics: C++, XML, XML Schema, XML parser, source code generation
@@ -11,13 +11,13 @@ doc-url: https://www.codesynthesis.com/projects/xsd/
src-url: https://git.codesynthesis.com/cgit/xsd/xsd/tree/xsd/
email: xsd-users@codesynthesis.com ; Mailing list
build-warning-email: builds@codesynthesis.com
+requires: host
requires: c++11
-depends: * build2 >= 0.13.0
-depends: * bpkg >= 0.13.0
-# @@ Should probably become conditional dependency.
-requires: ? cli ; Only required if changing .cli files.
+depends: * build2 >= 0.14.0
+depends: * bpkg >= 0.14.0
depends: libxsd-frontend ^2.1.0-
depends: libcutl ^1.11.0-
depends: libxerces-c ^3.0.0
-tests: xsd-tests == $
-examples: xsd-examples == $
+depends: * cli ^1.2.0-
+tests: * xsd-tests == $
+examples: * xsd-examples == $
diff --git a/xsd/xsd/buildfile b/xsd/xsd/buildfile
index 49fbf2c..1a58561 100644
--- a/xsd/xsd/buildfile
+++ b/xsd/xsd/buildfile
@@ -5,64 +5,74 @@ import libs = libxsd-frontend%lib{xsd-frontend}
import libs += libcutl%lib{cutl}
import libs += libxerces-c%lib{xerces-c}
-options_topics = options cxx/options cxx/parser/options cxx/tree/options
+import! [metadata] cli = cli%exe{cli}
-./: exe{xsd}: {hxx ixx txx cxx}{** -{$options_topics} -version} \
- {hxx ixx cxx}{$options_topics} \
- {hxx}{version} \
+ops = options cxx/options cxx/parser/options cxx/tree/options
+
+./: exe{xsd}: {hxx ixx txx cxx}{** -{$ops} -version} \
+ {hxx ixx cxx}{$ops} \
+ {hxx}{version} \
$libs
# Target metadata, see also --build2-metadata in xsd.cxx.
#
+# Note that xsd does not query any environment variables.
+#
exe{xsd}:
{
export.metadata = 1 xsd
xsd.name = [string] xsd
- xsd.version = $version
- xsd.checksum = $version
+ xsd.version = [string] $version
+ xsd.checksum = [string] $version
}
hxx{version}: in{version} $src_root/manifest
-# Build options.
-#
-# Pass the copyright notice extracted from the LICENSE file.
-#
-obj{xsd cxx/parser/generator cxx/tree/generator}: \
- cxx.poptions += -DXSD_COPYRIGHT=\"$copyright\"
-
# Generated options parser.
#
-if $cli.configured
-{
- cli.cxx{options}: cli{options}
- cxx/cli.cxx{options}: cxx/cli{options}
- cxx/parser/cli.cxx{options}: cxx/parser/cli{options}
- cxx/tree/cli.cxx{options}: cxx/tree/cli{options}
-
- cli.options += --std c++11 -I $src_root --generate-specifier \
---ostream-type ::std::wostream --exclude-base --suppress-undocumented \
---generate-file-scanner --include-with-brackets --option-length 28 \
+# Note: tracking .cli dependencies manually.
+#
+cli_options = --std c++11 -I $src_root --generate-specifier \
+--generate-file-scanner --suppress-undocumented \
+--ostream-type ::std::wostream --exclude-base \
+--include-with-brackets --option-length 28 \
--cxx-prologue '#include <xsd/options-parser.hxx>'
- cli.cxx{options}: cli.options += --include-prefix xsd --guard-prefix XSD
+<{hxx ixx cxx}{options}>: cli{options}
+{
+ cli_options += --include-prefix xsd --guard-prefix XSD
+}
- cxx/cli.cxx{options}: cli.options += --include-prefix xsd/cxx \
- --guard-prefix XSD_CXX
+<cxx/{hxx ixx cxx}{options}>: cxx/cli{options} cli{options}
+{
+ cli_options += --include-prefix xsd/cxx --guard-prefix XSD_CXX
+}
- cxx/parser/cli.cxx{options}: cli.options += --include-prefix xsd/cxx/parser \
- --guard-prefix XSD_CXX_PARSER
+<cxx/parser/{hxx ixx cxx}{options}>: cxx/parser/cli{options} cxx/cli{options} \
+ cli{options}
+{
+ cli_options += --include-prefix xsd/cxx/parser --guard-prefix XSD_CXX_PARSER
+}
- cxx/tree/cli.cxx{options}: cli.options += --include-prefix xsd/cxx/tree \
- --guard-prefix XSD_CXX_TREE
+<cxx/tree/{hxx ixx cxx}{options}>: cxx/tree/cli{options} cxx/cli{options} \
+ cli{options}
+{
+ cli_options += --include-prefix xsd/cxx/tree --guard-prefix XSD_CXX_TREE
+}
- # Include the generated cli files into the distribution and don't remove
- # them when cleaning in src (so that clean results in a state identical to
- # distributed).
+<hxx{~'/(.*)/'} ixx{~'/\1/'} cxx{~'/\1/'}>: cli{~'/\1/'} $cli
+{
+ # Symlink the generated code in src for convenience of development.
#
- cli.cxx{*}:
- {
- dist = true
- clean = ($src_root != $out_root)
- }
+ backlink = true
}
+{{
+ $cli $cli_options -o $directory($path($>[0])) $path($<[0])
+}}
+
+# Build options.
+#
+# Pass the copyright notice extracted from the LICENSE file.
+#
+obj{xsd cxx/parser/generator cxx/tree/generator}: \
+ cxx.poptions += -DXSD_COPYRIGHT=\"$copyright\"