2. Description
Runs Calabash. You can use this task to process:
-
A single input file to produce a single output file
-
A set of input files, processed one at a time, to produce a set of output files
-
Multiple input files as the input to one XProc input port processed to produce a single output file
-
Any of the above with additional input ports to each of which are applied one or more input files whose file names may be either fixed or mapped from the name(s) of the current main input file(s)
-
Any of the above with additional output ports whose file names may be either fixed or mapped from the name(s) of the current main input file(s)
You can also specify options and parameters to be used by the pipeline.
2.1. Custom Task and Types
The previously defined Antlib provides one custom task and four custom types in the configured namespace.
2.1.1. calabash
The custom Ant Task that is provided by the Antlib. This is the main piece of the Calabash Ant integration. The remaining sections of this chapter describe the usage of this task.
2.1.2. stdin
A read-only Ant Resource that connects to stdin.
2.1.3. stdout
A write-only Ant Resource that connects to stdout.
2.1.4. stdinout
A read-write Ant Resource that connects to stdin for reading and to stdout for writing.
2.1.5. stderr
A write-only Ant Resource that connects to stderr.
2.2. Input and output files and filesets
In the simplest scenario, the in
attribute, if present, specifies the single input file and / or
the out
attribute, if present,
specifies the single output file. The inPort
and outPort
attributes specify the pipeline port to which to apply the input
or from which to receive the output, respectively, though these
may be omitted as stated below.
You can as well or instead specify one or more files to apply to an
input port using one or more nested input
elements.
input
elements whose port
attribute value matches
inPort
(or whose port
attribute is omitted when
inPort
is omitted) are
applied to the inPort
port. Those
input
elements may contain
zero or more Ant resources
(i.e., fileset
, dirset
, etc.).
input
elements for ports other than the
inPort
port may contain
either zero or more Ant resources or an Ant
mapper element (i.e., mapper
, globmapper
, etc.) that maps the
current inPort
file(s) name(s) to
other file name(s) that are used as the input file(s) for that
port. You cannot specify both Ant resources and a mapper
for an input port (nor can you specify a mapper for the inPort
port).
You can as well or instead specify a file to contain the output of
an output port using one or more nested output
elements. You cannot specify more than
one output
element for any pipeline
output.
An output
element whose port
attribute value matches
outPort
(or whose port
attribute is omitted when
outPort
is omitted) is
used for the outPort
port. This
output
element and the out
attribute cannot both be
used at once.
Other output
elements may each be used
for any of the other output ports of the pipeline.
output
elements may contain either
zero or more Ant resources or an Ant mapper
element (i.e., mapper
, globmapper
, etc.) that maps the
current inPort
file(s) name(s) to a
file name that is used as the output file for that port. You
cannot specify both Ant resources and a mapper for an
output port, and the output
cannot
result in more than one file name.
When no files are specified for either the inPort
or outPort
ports, the implicit fileset (formed based on includes
and other attributes
of calabash
) and / or an explicit file
set (formed from nested Ant resources (outside of
any input
or output
elements) makes a set of files that are
processed one at a time as the input to the inPort
port in separate runs of
the pipeline.
The basedir
, includes
, includesfile
, excludes
, excludesfile
, defaultexcludes
, and scanincludeddirectories
attributes determine the
implicit fileset. useimplicitfileset
can disable the implicit
fileset.
When the implicit fileset and / or the explicit fileset selects one
or more files, the destdir
, and
extension
attributes (or
using a nested mapper instead of extension
) determine the filename to use for the
output of the outPort
port, and the
Ant resources
or mapper for other input and output ports
determine the file(s) from which to read or the file to which to
write for those ports.
2.3. Ports
The inPort
and outPort
attributes determine the pipeline ports
to use for single, or sequential, processing of files.
Additionally, the filename of the file on the inPort
port is used (or can be
used) by mappers to determine the input or output files to use
for other ports.
You may omit at most one input port name and at most one output
port name from the ports specified on the calabash
task. The calabash
task maps the primary non-parameter
input the primary output port of the pipeline to the
unnamed ports (and any additional port without a defined mapping
will cause an error). The omitted ports do not have to be the
inPort
and outPort
ports; e.g., you can
instead specify inPort
and omit the
port
attribute on the
nested input
element for a different
port.
Nested parameter
elements specify Inputs
to parameter ports.