java left logo
java middle logo
java right logo
 

Home arrow Other API Tips arrow Ant arrow How to use Patch task
 
 
Main Menu
Home
Java Tutorials
Book Reviews
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Java Network
Java Forums
Java Blog




Most Visited Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews
Top Rated Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews


Statistics
Registered Users: 4093
Java SE Tips: 614
Java ME Tips: 202
Java EE Tips: 183
Other API Tips: 779
Java Applications: 298
Java Libraries: 209
Java Games: 16
Book Reviews:
 
 
 
How to use Patch task E-mail
User Rating: / 12
PoorBest 

Patch

Description

Applies a diff file to originals. ; requires "patch" to be on the execution path.

Parameters

Attribute Description Required
patchfile the file that includes the diff output Yes
originalfile the file to patch No, tries to guess it from the diff file
destfile the file to send the output to instead of patching the file(s) in place. since Ant 1.6 No.
backups Keep backups of the unpatched files No
quiet Work silently unless an error occurs No
reverse Assume patch was created with old and new files swapped. No
ignorewhitespace Ignore whitespace differences. No
strip Strip the smallest prefix containing num leading slashes from filenames. No
dir The directory in which to run the patch command. No, default is the project's basedir.

Examples

  <patch patchfile="module.1.0-1.1.patch"/>

applies the diff included in module.1.0-1.1.patch to the files in base directory guessing the filename(s) from the diff output.

  <patch patchfile="module.1.0-1.1.patch" strip="1"/>

like above but one leading directory part will be removed. i.e. if the diff output looked like

--- a/mod1.0/A	Mon Jun  5 17:28:41 2000
+++ a/mod1.1/A	Mon Jun  5 17:28:49 2000
the leading a/ will be stripped.

Source: Apache Ant


 Related Tips

 
< Prev   Next >

Page 1 of 0 ( 0 comments )

You can share your information about this topic using the form below!

Please do not post your questions with this form! Thanks.


Name (required)


E-Mail (required)

Your email will not be displayed on the site - only to our administrator
Homepage(optional)



Comment Enable HTML code : Yes No



 
       
         
     
 
 
 
   
 
 
java bottom left
java bottom middle
java bottom right
RSS 0.91 FeedRSS 1.0 FeedRSS 2.0 FeedATOM FeedOPML Feed

Home - About Us - Privacy Policy
Copyright 2005 - 2008 www.java-tips.org
Java is a trademark of Sun Microsystems, Inc.