GppCopy

Description

Substitute for the Copy task with integrated preprocessing.

GppCopy is the simplest way to preprocess files. Specified just like like the Copy task, GppCopy treats its source files as Groovy templates and writes the preprocessed output to the specified destination. In essence, GppCopy is simply a short cut for a Copy task defined with a single GppFilter.

In addition, GppCopy also inserts an instance of GppTool into the Groovy Template Context that allows you to access information about the source and destination files and encodings used for each file copied. It can be accessed through the key, gpp.

Parameters

GppCopy supports all of Copy's parameters and does not add any additional parameters at this time.

Parameters Specified as Nested Elements

In addition to all of Copy's parameters, GppCopy also supports all of Copy's parameters specified as nested elements, including additional filters which are processed subsequent to preprocessing via GppFilter. GppCopy additionally supports the following parameters specfied as nested elements:

config

By specifying this nested element, you can configure the Groovy Template Engine and Context used when preprocessing. See GppConfig for a detailed description.

Examples

Note: the following examples assume that GppCopy is being used as an antlib, hence the tasks use the gpp namespace. If not using as an antlib, then simply omit the ':' character and the xmlns attribute.

    <gpp:copy todir="output" overwrite="true" xmlns:gpp="antlib:foundrylogic.gpp" >
      <fileset dir="${src}" includes="*.html.gpp" />
      <mapper type="glob" from="*.html.gpp" to="*.html" />
    </gpp:copy>

preprocess all files with a .html.gpp extension in the ${src} directory to the output directory with a .html extnension.