Browse Source

Add overwrite attribute to <apply>.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277043 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 20 years ago
parent
commit
2f1e0c35af
4 changed files with 48 additions and 4 deletions
  1. +3
    -0
      WHATSNEW
  2. +6
    -0
      docs/manual/CoreTasks/apply.html
  3. +35
    -4
      src/etc/testcases/taskdefs/exec/apply.xml
  4. +4
    -0
      src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java

+ 3
- 0
WHATSNEW View File

@@ -86,6 +86,9 @@ Other changes:
* Junit task -- display suite first. * Junit task -- display suite first.
Bugzilla report 31962. 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 Changes from Ant 1.6.2 to current Ant 1.6 CVS version
===================================================== =====================================================




+ 6
- 0
docs/manual/CoreTasks/apply.html View File

@@ -255,6 +255,12 @@ to send input to it is via the input and inputstring attributes.</p>
via filelists. <em>Since Ant 1.6.2.</em></td> via filelists. <em>Since Ant 1.6.2.</em></td>
<td align="center" valign="top">No, default is <i>true</i></td> <td align="center" valign="top">No, default is <i>true</i></td>
</tr> </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> </table>
<h3>Parameters specified as nested elements</h3> <h3>Parameters specified as nested elements</h3>
<h4>fileset</h4> <h4>fileset</h4>


+ 35
- 4
src/etc/testcases/taskdefs/exec/apply.xml View File

@@ -313,10 +313,7 @@
</apply> </apply>
</target> </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=""> <condition property="pad" value="">
<or> <or>
<not> <not>
@@ -341,6 +338,12 @@
</and> </and>
</condition> </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}"> <pathconvert property="xy" pathsep="${pad}${line.separator}">
<path> <path>
<filelist refid="xylist" /> <filelist refid="xylist" />
@@ -375,6 +378,34 @@
</fail> </fail>
</target> </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>
</fail>
</target>

<target name="cleanup"> <target name="cleanup">
<delete> <delete>
<fileset refid="xyz" /> <fileset refid="xyz" />


+ 4
- 0
src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java View File

@@ -554,6 +554,10 @@ public class ExecuteOnTest extends BuildFileTest {
executeTarget("ignoremissing"); executeTarget("ignoremissing");
} }


public void testOverwrite() {
executeTarget("overwrite");
}

//borrowed from TokenFilterTest //borrowed from TokenFilterTest
private String getFileString(String filename) throws IOException { private String getFileString(String filename) throws IOException {
String result = null; String result = null;


Loading…
Cancel
Save