mbenson 2004/11/16 12:58:22 Modified: . WHATSNEW src/testcases/org/apache/tools/ant/taskdefs ExecuteOnTest.java docs/manual/CoreTasks apply.html src/etc/testcases/taskdefs/exec apply.xml Log: Add overwrite attribute to <apply>. Revision Changes Path 1.684 +3 -0 ant/WHATSNEW Index: WHATSNEW =================================================================== RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.683 retrieving revision 1.684 diff -u -r1.683 -r1.684 --- WHATSNEW 15 Nov 2004 10:41:43 -0000 1.683 +++ WHATSNEW 16 Nov 2004 20:58:22 -0000 1.684 @@ -86,6 +86,9 @@ * Junit task -- display suite first. Bugzilla report 31962. +* <apply> has a new "overwrite" attribute that, when true, disables + checking of target files. + Changes from Ant 1.6.2 to current Ant 1.6 CVS version ===================================================== 1.7 +4 -0 ant/src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java Index: ExecuteOnTest.java =================================================================== RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ExecuteOnTest.java 16 Jun 2004 16:41:38 -0000 1.6 +++ ExecuteOnTest.java 16 Nov 2004 20:58:22 -0000 1.7 @@ -554,6 +554,10 @@ executeTarget("ignoremissing"); } + public void testOverwrite() { + executeTarget("overwrite"); + } + //borrowed from TokenFilterTest private String getFileString(String filename) throws IOException { String result = null; 1.32 +6 -0 ant/docs/manual/CoreTasks/apply.html Index: apply.html =================================================================== RCS file: /home/cvs/ant/docs/manual/CoreTasks/apply.html,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- apply.html 24 Jun 2004 19:22:20 -0000 1.31 +++ apply.html 16 Nov 2004 20:58:22 -0000 1.32 @@ -255,6 +255,12 @@ via filelists. <em>Since Ant 1.6.2.</em></td> <td align="center" valign="top">No, default is <i>true</i></td> </tr> + <tr> + <td valign="top">overwrite</td> + <td valign="top">Whether to bypass timestamp comparisons + for target files. <em>Since Ant 1.7.</em></td> + <td align="center" valign="top">No, default is <i>false</i></td> + </tr> </table> <h3>Parameters specified as nested elements</h3> <h4>fileset</h4> 1.6 +35 -4 ant/src/etc/testcases/taskdefs/exec/apply.xml Index: apply.xml =================================================================== RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/exec/apply.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- apply.xml 13 Jul 2004 16:09:20 -0000 1.5 +++ apply.xml 16 Nov 2004 20:58:22 -0000 1.6 @@ -313,10 +313,7 @@ </apply> </target> - <target name="ignoremissing" depends="init,xyz" if="echo.can.run"> - <filelist id="xylist" dir="${basedir}" files="x,y" /> - <delete file="z" /> - + <target name="pad"> <condition property="pad" value=""> <or> <not> @@ -341,6 +338,12 @@ </and> </condition> + </target> + + <target name="ignoremissing" depends="init,xyz,pad" if="echo.can.run"> + <filelist id="xylist" dir="${basedir}" files="x,y" /> + <delete file="z" /> + <pathconvert property="xy" pathsep="${pad}${line.separator}"> <path> <filelist refid="xylist" /> @@ -369,6 +372,34 @@ <and> <equals arg1="${xy}${pad}" arg2="${ignoretrue}" /> <equals arg1="${xyz}${pad}" arg2="${ignorefalse}" /> + </and> + </not> + </condition> + </fail> + </target> + + <target name="overwrite" depends="init,xyz,pad" if="echo.can.run"> + <presetdef name="ekko"> + <apply executable="echo" append="true" dest="${basedir}"> + <filelist refid="xyzlist" /> + <mapper type="identity" /> + </apply> + </presetdef> + + <pathconvert property="xyz" pathsep="${pad}${line.separator}"> + <path> + <filelist refid="xyzlist" /> + </path> + </pathconvert> + + <ekko outputproperty="foo" /> + <ekko outputproperty="bar" overwrite="true" /> + <fail> + <condition> + <not> + <and> + <equals arg1="${foo}" arg2="" /> + <equals arg1="${bar}" arg2="${xyz}" /> </and> </not> </condition>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]