You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2002/11/12 12:58:28 UTC

cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Concat.java

bodewig     2002/11/12 03:58:28

  Modified:    src/etc/testcases/taskdefs concat.xml
               src/main/org/apache/tools/ant/taskdefs Concat.java
  Log:
  Print a warning and don't create an output file if there is no input
  to <concat>.
  
  PR: 14310
  Submitted by:	Gus Heck <gus.heck at olin.edu>
  
  Revision  Changes    Path
  1.4       +3 -1      jakarta-ant/src/etc/testcases/taskdefs/concat.xml
  
  Index: concat.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/testcases/taskdefs/concat.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- concat.xml	8 Nov 2002 16:39:57 -0000	1.3
  +++ concat.xml	12 Nov 2002 11:58:28 -0000	1.4
  @@ -35,7 +35,9 @@
       <concat destfile="TESTDEST" append="true">
         <filelist dir="${basedir}" files="thisfiledoesnotexist"/>
       </concat>
  -    <delete file="TESTDEST"/>
  +    <available file="TESTDEST" property="TESTDEST.was.created"/>
  +    <fail message="TESTDEST created for nonexistant files"
  +          if="TESTDEST.was.created"/>
     </target>
   
   </project>
  
  
  
  1.11      +9 -0      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Concat.java
  
  Index: Concat.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Concat.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Concat.java	8 Nov 2002 13:10:22 -0000	1.10
  +++ Concat.java	12 Nov 2002 11:58:28 -0000	1.11
  @@ -266,6 +266,9 @@
                   // Concatenate the files.
                   if (srcFiles != null) {
                       catFiles(fileSetBase, srcFiles);
  +                } else {
  +                    log("Warning: Concat received empty fileset.", 
  +                        Project.MSG_WARN);
                   }
               }
           } finally {
  @@ -317,6 +320,12 @@
           }
   
           final int len = inputFileNames.size();
  +        if (len == 0) {
  +            log("Warning: Could not find any of the files specified " +
  +                "in concat task.", Project.MSG_WARN);
  +            return;
  +        }
  +
           String[] input = new String[len];
           inputFileNames.copyInto(input);
   
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>