git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277464 13f79535-47bb-0310-9956-ffa450edef68master
@@ -188,6 +188,9 @@ Other changes: | |||||
* Added a comment attribute to the zip task. | * Added a comment attribute to the zip task. | ||||
Bugzilla report 22793. | Bugzilla report 22793. | ||||
* Made the dest attribute of the apply task optional; mapped target | |||||
filenames will be interpreted as absolute pathnames when dest is omitted. | |||||
Fixed bugs: | Fixed bugs: | ||||
----------- | ----------- | ||||
@@ -406,6 +406,28 @@ | |||||
</fail> | </fail> | ||||
</target> | </target> | ||||
<target name="testNoDest" depends="init,xyz" if="echo.can.run"> | |||||
<presetdef name="ekko"> | |||||
<apply executable="echo" addsourcefile="false" force="true"> | |||||
<filelist dir="${basedir}" files="x" /> | |||||
<globmapper from="*" to="${basedir}/*" /> | |||||
<targetfile /> | |||||
</apply> | |||||
</presetdef> | |||||
<ekko outputproperty="dest" dest="${basedir}" /> | |||||
<ekko outputproperty="nodest" /> | |||||
<fail> | |||||
<condition> | |||||
<or> | |||||
<available file="${dest}" /> | |||||
<not> | |||||
<available file="${nodest}" /> | |||||
</not> | |||||
</or> | |||||
</condition> | |||||
</fail> | |||||
</target> | |||||
<target name="cleanup"> | <target name="cleanup"> | ||||
<delete> | <delete> | ||||
<fileset refid="xyz" /> | <fileset refid="xyz" /> | ||||
@@ -277,16 +277,15 @@ public class ExecuteOn extends ExecTask { | |||||
throw new BuildException("no filesets and no filelists specified", | throw new BuildException("no filesets and no filelists specified", | ||||
getLocation()); | getLocation()); | ||||
} | } | ||||
if (targetFilePos != null || mapperElement != null | |||||
|| destDir != null) { | |||||
if (mapperElement == null) { | |||||
throw new BuildException("no mapper specified", getLocation()); | |||||
} | |||||
if (destDir == null) { | |||||
throw new BuildException("no dest attribute specified", | |||||
getLocation()); | |||||
} | |||||
if (targetFilePos != null && mapperElement == null) { | |||||
throw new BuildException("targetfile specified without mapper", | |||||
getLocation()); | |||||
} | |||||
if (destDir != null && mapperElement == null) { | |||||
throw new BuildException("dest specified without mapper", | |||||
getLocation()); | |||||
} | |||||
if (mapperElement != null) { | |||||
mapper = mapperElement.getImplementation(); | mapper = mapperElement.getImplementation(); | ||||
} | } | ||||
} | } | ||||
@@ -558,6 +558,10 @@ public class ExecuteOnTest extends BuildFileTest { | |||||
executeTarget("force"); | executeTarget("force"); | ||||
} | } | ||||
public void testNoDest() { | |||||
executeTarget("testNoDest"); | |||||
} | |||||
//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; | ||||