mbenson     2005/01/25 14:03:35

  Modified:    .        WHATSNEW
               src/main/org/apache/tools/ant/taskdefs ExecuteOn.java
               src/testcases/org/apache/tools/ant/taskdefs
                        ExecuteOnTest.java
               src/etc/testcases/taskdefs/exec apply.xml
  Log:
  Make apply's dest attribute optional.
  
  Revision  Changes    Path
  1.718     +3 -0      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.717
  retrieving revision 1.718
  diff -u -r1.717 -r1.718
  --- WHATSNEW  25 Jan 2005 18:48:29 -0000      1.717
  +++ WHATSNEW  25 Jan 2005 22:03:35 -0000      1.718
  @@ -188,6 +188,9 @@
   * Added a comment attribute to the zip task.
     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:
   -----------
   
  
  
  
  1.61      +9 -10     ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
  
  Index: ExecuteOn.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- ExecuteOn.java    25 Jan 2005 11:22:24 -0000      1.60
  +++ ExecuteOn.java    25 Jan 2005 22:03:35 -0000      1.61
  @@ -277,16 +277,15 @@
               throw new BuildException("no filesets and no filelists 
specified",
                                        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();
           }
       }
  
  
  
  1.10      +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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ExecuteOnTest.java        16 Dec 2004 14:01:37 -0000      1.9
  +++ ExecuteOnTest.java        25 Jan 2005 22:03:35 -0000      1.10
  @@ -558,6 +558,10 @@
           executeTarget("force");
       }
   
  +    public void testNoDest() {
  +        executeTarget("testNoDest");
  +    }
  +
       //borrowed from TokenFilterTest
       private String getFileString(String filename) throws IOException {
           String result = null;
  
  
  
  1.8       +22 -0     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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- apply.xml 16 Nov 2004 21:46:46 -0000      1.7
  +++ apply.xml 25 Jan 2005 22:03:35 -0000      1.8
  @@ -406,6 +406,28 @@
           </fail>
       </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">
           <delete>
               <fileset refid="xyz" />
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to