bodewig     00/10/12 06:22:51

  Modified:    src/main/org/apache/tools/ant/taskdefs Javac.java
  Log:
  Make <javac> use the value of srcdir as destdir if the latter has not
  been specified.
  
  Submitted by: Alexander Pokahr <[EMAIL PROTECTED]>
  
  Revision  Changes    Path
  1.48      +6 -3      
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java
  
  Index: Javac.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- Javac.java        2000/10/05 09:11:59     1.47
  +++ Javac.java        2000/10/12 13:22:49     1.48
  @@ -281,20 +281,23 @@
        * Executes the task.
        */
       public void execute() throws BuildException {
  -        // first off, make sure that we've got a srcdir and destdir
  +        // first off, make sure that we've got a srcdir
   
           if (src == null) {
               throw new BuildException("srcdir attribute must be set!", 
location);
           }
  -        
           String [] list = src.list();
           if (list.length == 0) {
               throw new BuildException("srcdir attribute must be set!", 
location);
           }
           
  +        
           if (destDir == null) {
  -            throw new BuildException("destdir attribute must be set!", 
location);
  +            destDir = project.resolveFile(list[0]);
  +            log("destdir set to "+destDir.getPath()+" from srcdir 
attribute", 
  +                Project.MSG_INFO);
           }
  +
           if (!destDir.isDirectory()) {
               throw new BuildException("destination directory \"" + destDir + 
"\" does not exist or is not a directory", location);
           }
  
  
  

Reply via email to