Section 6.7. Creating Patches


6.7. Creating Patches

This task applies a patch file to local source code, updating the local code. You can create a patch file with the CVS rdiff command, which lets you compare two files. Here's an example, which applies patch.txt to the module in the current directory:

<patch patchfile="patch.txt"/>

The attributes for this task appear in Table 6-9.

To use this task, the patch utility must be in your path.


Table 6-9. The patch task's attributes

Attribute

Description

Required

Default

backups

Specifies you want to keep backups of unpatched files

No

 

destfile

Specifies the file you want to send the output to. Since Ant 1.6

No

 

dir

Specifies the directory where you want to run the patch command

No

The project's basedir.

ignorewhitespace

Specifies that you want to ignore whitespace differences

No

 

originalfile

Specifies the file you want to patch

No

 

patchfile

Specifies the file that contains the patch

Yes

 

quiet

Specifies you want to supress messages unless an error occurs

No

 

reverse

Specifies you want to create the patch with old and new files in reverse order (swapped)

No

 




    Ant. The Definitive Guide
    Ant: The Definitive Guide, 2nd Edition
    ISBN: 0596006098
    EAN: 2147483647
    Year: 2003
    Pages: 115
    Authors: Steve Holzner

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net