C.61 PatchTask

The PatchTask uses the patch program to apply diff file to originals.

NB: the patch program must be in the system path!

Table C.81: Attributes

NameTypeDescriptionDefaultRequired
patchfileStringFile that includes the diff outputn/aYes
originalfileStringFile to patch. If not specified Task tries to guess it from the diff filenoneNo
destfileStringFile to send the output to instead of patching the file in placenoneNo
backupsBooleanKeep backups of the unpatched filesfalseNo
quietBooleanWork silently unless an error occursfalseNo
reverseBooleanAssume patch was created with old and new files swappedfalseNo
ignorewhitespaceBooleanIgnore whitespace differencesfalseNo
stripIntegerStrip the smallest prefix containing specified number of leading slashes from filenamesnoneNo
dirStringThe directory in which to run the patch commandnoneNo
haltonfailureBooleanStop the build process if the patching process encounters an error.falseNo
forwardBooleanIgnore patches that appear to be reversed or already applied.falseNo
fuzzStringSet the fuzz factor to LINES for inexact matching.n/aNo

C.61.1 Example

<patch
  patchfile="/path/to/patches/file.ext.patch"
  dir="/path/to/original"
/>

Apply "file.ext.path" to original file locataed in "/path/to/original" folder.