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.
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
=====================================================



+ 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>
<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>


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

@@ -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" />
@@ -375,6 +378,34 @@
</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>
</fail>
</target>

<target name="cleanup">
<delete>
<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");
}

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

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


Loading…
Cancel
Save