<zzpatch>
Implements the following features:
To use this task, add this to your ANT build script:
<taskdef
classpath="path/to/zz-patch-x.y.z-jar-with-dependencies.jar"
resource="antlib.xml"
/>
Name | Description |
---|---|
file="..."
|
Configures a file to be transformed; either in-place, or, iff tofile=... or todir=... is
configured, out-of-place.
|
keepOriginals="..."
|
Whether to keep backup copies of files/entries that are modified or removed, renamed to ".
|
lookInto="..."
|
Look into compressed and archive contents if the format and the path match the given glob. |
mode="..."
|
Configures how the files are processed. |
todir="..."
|
Configures the directory for the output file created from file=... and/or the resource collection
subelements.
|
tofile="..."
|
Configures the output file for the input file specified through file=... .
|
Name | Description |
---|---|
<add>
|
Configures that an entry be added to all archives that match the path pattern. |
<patch>
|
Configures a transformation by applying a DIFF document. |
<remove>
|
Configures that files/entries that match the name be deleted/removed.
|
<rename>
|
Configures that files/entries that match the name be renamed.
|
<substitute>
|
Configures that lines that match the regex="..." within files/entries that match
the path="..." glob pattern be replaced with the replacement="..." string.
|
<update>
|
Configures that the contents of files/entries that match the name glob pattern be replaced with the
contents of the given "update file".
|
Any Any resource collection |
Adds another set of resources (<fileset> , <path> , ...) that will be patched.
|
Default values are underlined.
mode="TRANSFORM|CHECK|CHECK_AND_TRANSFORM"
TRANSFORM
CHECK
CHECK_AND_TRANSFORM
keepOriginals="true|false"
".
file-name.orig"
. file="file"
tofile=...
or todir=...
is
configured, out-of-place. tofile="file"
file=...
. The default is to patch the
input file in-place. todir="existing-dir"
file=...
and/or the resource collection
subelements. lookInto="format-glob:path-glob"
Supported archive formats are: [cpio, zip, dump, jar, tar, ar, arj, 7z].
Supported compression formats are: [snappy-raw, bzip2, gz, snappy-framed, pack200, xz, z, lzma].
The default is too look into any recognized archive or compressed contents.
Example:
lookInto="zip:**,tar:**,gz:**"
<fileset>
, <path>
, ...) that will be patched.
Interface describing a collection of Resources.
<update>
name
glob pattern be replaced with the contents of the given "update file".
A predicate that determines whether a path is applicable by matching it with a glob.
name="path"
path="..."
insteadpath="glob"
<substitute>
regex="..."
within files/entries that match the path="..."
glob pattern be replaced with the replacement="..."
string. Alternatively, the regex and the replacement can be configured with <regex>
and <replacement>
subelements; one advantage of subelements is that they can contain <![CDATA[...]]>
sections where you don't have to SGML-escape special characters.
You are not limited to line-wise pattern matching, but be careful with using greedy quantifiers, because these may require that the entire contents of each file needs to be loaded into memory.
Configures a substitution, i.e. the transformation of contents by finding pattern matches and replacing them with a replacement string.inputEncoding="charset"
outputEncoding="charset"
regex="regex"
For the precise description of the supported regular-expression constructs, see here.
replacement="replacement"
For the precise description of the format, see here.
condition="expression"
true
before each occurrence is replaced. The following variables are available in the expression:
path
match
occurrence
name="path"
path="..."
insteadpath="glob"
<regex>
For the precise description of the supported regular-expression constructs, see here.
<replacement>
For the precise description of the format, see here.
<patch>
A DIFF document generally contains differentials for one or more files. Each differential comprises a sequence of "hunks". Traditional format, context format and unified format are supported.
If the DIFF document describes more than on differential, then all but the first differential are ignored. The file name information in the differential is also ignored.
Configures a patch, i.e. the transformation of contents by applying a "DIFF document" to the input.inputEncoding="value"
outputEncoding="value"
patchFile="patch-file"
patchFileEncoding="charset"
condition="expression"
true
before each DIFF hunk is applied. The following variables are available in the expression:
path
hunks
hunkIndex
hunk
lineNumber
name="path"
path="..."
insteadpath="glob"
<remove>
name
be deleted/removed.
A predicate that determines whether a path is applicable by matching it with a glob.
name="path"
path="..."
insteadpath="glob"
<rename>
name
be renamed.
A glob that implements renaming of a path.
name="path"
path="..."
insteadpath="glob"
<add>
entryName="entry-name"
contents="contents-file"
name="path"
path="..."
insteadpath="glob"
Copyright © 2022 Arno Unkrig. All rights reserved.