These macros have been developed as they were required, especially the external tool wrappers, but they can be divided into three broad categories.
The XML macros include:
apply-transform
: Applies an XSLT (or a
series of XSLTs) to a file or fileset. As might be expected
this is a wrapper around the built in Ant
<xslt>
task but with some convenience
features.
compile-schematron
: Compiles a Schematron
file (or files) into an XSLT using the ISO Schematron
transforms, although the individual stylesheets that perform
the various stages of the compilation can be overridden if
required. Standard XPantS library XSLTs can also be applied
directly, e.g. to remove comments.
convert-schema
: A wrapper around the
Trang
converter (and consequently has the same limitations).
validate-instance
: A wrapper around Ant’s
<xmlvalidate>
and
<schemavalidate>
tasks, along with a
wrapper around the
Jing
validator for RNG/RNC instance files. This allows the user to
use the same macro to validate an instance against any type of
schema.
Some of the more utility based macros include:
attr-checks
: These macros are mainly used
by the rest of the library as part of it’s parameter checking
and error handling.
compare-files
: Compare files (or filesets)
using either the diff tool or
DeltaXML
(which must also be installed).
deploy-files
: Deploys a set of files to a
target. This may use the standard file system utilities
(i.e. the Ant <copy>
task) but
options exist for using the AWS command line tool (for
example, deployment to an S3 bucket) or
scp.
extract-markdown
: Uses XSLTs internal to
the library to extract Markdown documentation from Ant build
files, XSLT files or Schematron files. For Ant build files it
also adds documentation around the macros and targets the file
contains. XSLT file documentation is enhanced with lists of
templates and Schematron files have documentation for pattern,
rules, asserts and reports added. The output is Markdown, so
may need to be converted into HTML (e.g. using the
<pandoc>
macro, below).
file-utils
: These macros are mainly used by
the rest of the library as part of it’s parameter checking and
error handling.
A number of external (command line based) tools also have Ant macro wrappers:
aws
: A wrapper around the AWS command line
tool. It also includes a macro that uses the “s3
sync” command, which is used by
<deploy-files>
.
git
: These macros provide access to the
git command line functionality.
Convenience functions are included for getting the current
branch name, getting the current status, checking for
outstanding commits (and failing the build if there are any)
and checking if the current branch matches a particular
pattern (e.g. failing the build if the current branch is not
"release).
pandoc
: A wrapper for the
Pandoc document
converter. Most of the important options are available as
arguments to the <pandoc>
macro.
python
: A wrapper for the
python command to run local scripts or
installed modules. Also includes macros to build and install
Python Package Index (PyPi) modules.
ssh
: Wrappers for the
ssh (Secure Shell) and
scp commands. Also used by the
<deploy-files>
macro.
tidy
: A wrapper around the
HTML Tidy
application.
version-number
: One of the newer macros,
this contains a number of functions to update version numbers
that conform to the Semantic Versioning standard.
xspec
: This is simply a wrapper around the
xspec.bat/xspec.sh
scripts provided by the XSpec install (so it should be on the
path).
The AntUnit testing framework is gradually being applied to more of the macros as development time permits. This should increase the stability and quality of the library.