|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.Patch
public class Patch
Patches a file by applying a 'diff' file to it; requires "patch" to be on the execution path.
| Field Summary |
|---|
| Fields inherited from class org.apache.tools.ant.Task |
|---|
target, taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
|---|
description, location, project |
| Constructor Summary | |
|---|---|
Patch()
|
|
| Method Summary | |
|---|---|
void |
execute()
execute patch |
void |
setBackups(boolean backups)
flag to create backups; optional, default=false |
void |
setDestfile(java.io.File file)
The name of a file to send the output to, instead of patching the file(s) in place; optional. |
void |
setDir(java.io.File directory)
The directory to run the patch command in, defaults to the project's base directory. |
void |
setFailOnError(boolean value)
If true, stop the build process if the patch command
exits with an error status. |
void |
setIgnorewhitespace(boolean ignore)
flag to ignore whitespace differences; default=false |
void |
setOriginalfile(java.io.File file)
The file to patch; optional if it can be inferred from the diff file |
void |
setPatchfile(java.io.File file)
The file containing the diff output; required. |
void |
setQuiet(boolean q)
Work silently unless an error occurs; optional, default=false |
void |
setReverse(boolean r)
Assume patch was created with old and new files swapped; optional, default=false |
void |
setStrip(int num)
Strip the smallest prefix containing num leading slashes from filenames. |
| Methods inherited from class org.apache.tools.ant.Task |
|---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
|---|
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Patch()
| Method Detail |
|---|
public void setOriginalfile(java.io.File file)
file - the file to patchpublic void setDestfile(java.io.File file)
file - the file to send the output topublic void setPatchfile(java.io.File file)
file - the file containing the diff outputpublic void setBackups(boolean backups)
backups - if true create backupspublic void setIgnorewhitespace(boolean ignore)
ignore - if true ignore whitespace differences
public void setStrip(int num)
throws BuildException
patch's -p option.
num - number of lines to strip
BuildException - if num is < 0, or other errorspublic void setQuiet(boolean q)
q - if true suppress set the -s option on the patch commandpublic void setReverse(boolean r)
r - if true set the -R option on the patch commandpublic void setDir(java.io.File directory)
directory - the directory to run the patch command inpublic void setFailOnError(boolean value)
true, stop the build process if the patch command
exits with an error status.
value - true if it should halt, otherwise
false. The default is false.
public void execute()
throws BuildException
execute in class TaskBuildException - when it all goes a bit pear shaped
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||