ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Javac.java
Date Thu, 12 Oct 2000 15:00:25 GMT
bodewig     00/10/12 08:00:24

  Modified:    docs     index.html
               src/main/org/apache/tools/ant/taskdefs Javac.java
  Log:
  Made destdir in <javac> optional - don't use the -d switch at all if
  this one hasn't been given.
  
  Submitted by:	Alexander Pokahr <5pokahr@informatik.uni-hamburg.de>
  
  Revision  Changes    Path
  1.128     +1 -1      jakarta-ant/docs/index.html
  
  Index: index.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/index.html,v
  retrieving revision 1.127
  retrieving revision 1.128
  diff -u -r1.127 -r1.128
  --- index.html	2000/10/12 13:25:15	1.127
  +++ index.html	2000/10/12 15:00:22	1.128
  @@ -2555,7 +2555,7 @@
     <tr>
       <td valign="top">destdir</td>
       <td valign="top">location where to store the class files.</td>
  -    <td align="center" valign="top">No (defaults to - the first - srcdir)</td>
  +    <td align="center" valign="top">No</td>
     </tr>
     <tr>
       <td valign="top">includes</td>
  
  
  
  1.49      +21 -17    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.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- Javac.java	2000/10/12 13:22:49	1.48
  +++ Javac.java	2000/10/12 15:00:23	1.49
  @@ -291,14 +291,7 @@
               throw new BuildException("srcdir attribute must be set!", location);
           }
           
  -        
  -        if (destDir == null) {
  -            destDir = project.resolveFile(list[0]);
  -            log("destdir set to "+destDir.getPath()+" from srcdir attribute", 
  -                Project.MSG_INFO);
  -        }
  -
  -        if (!destDir.isDirectory()) {
  +        if (destDir != null && !destDir.isDirectory()) {
               throw new BuildException("destination directory \"" + destDir + "\" does not
exist or is not a directory", location);
           }
   
  @@ -315,7 +308,7 @@
   
               String[] files = ds.getIncludedFiles();
   
  -            scanDir(srcDir, destDir, files);
  +            scanDir(srcDir, destDir != null ? destDir : srcDir, files);
           }
           
           // compile the source files
  @@ -333,7 +326,7 @@
               log("Compiling " + compileList.size() + 
                   " source file"
                   + (compileList.size() == 1 ? "" : "s")
  -                + " to " + destDir);
  +                + (destDir != null ? " to " + destDir : ""));
   
               if (compiler.equalsIgnoreCase("classic")) {
                   doClassicCompile();
  @@ -407,7 +400,9 @@
           // add dest dir to classpath so that previously compiled and
           // untouched classes are on classpath
   
  -        classpath.setLocation(destDir);
  +        if (destDir != null) {
  +            classpath.setLocation(destDir);
  +        }
   
           // add our classpath to the mix
   
  @@ -542,8 +537,11 @@
               cmd.createArgument().setValue("-deprecation");
           }
   
  -        cmd.createArgument().setValue("-d");
  -        cmd.createArgument().setFile(destDir);
  +        if (destDir != null) {
  +            cmd.createArgument().setValue("-d");
  +            cmd.createArgument().setFile(destDir);
  +        }
  +        
           cmd.createArgument().setValue("-classpath");
           // Just add "sourcepath" to classpath ( for JDK1.1 )
           if (Project.getJavaVersion().startsWith("1.1")) {
  @@ -669,8 +667,11 @@
           if (deprecation == true)
               cmd.createArgument().setValue("-deprecation");
   
  -        cmd.createArgument().setValue("-d");
  -        cmd.createArgument().setFile(destDir);
  +        if (destDir != null) {
  +            cmd.createArgument().setValue("-d");
  +            cmd.createArgument().setFile(destDir);
  +        }
  +        
           cmd.createArgument().setValue("-classpath");
           cmd.createArgument().setPath(classpath);
   
  @@ -853,8 +854,11 @@
           Commandline cmd = new Commandline();
           cmd.setExecutable("jvc");
   
  -        cmd.createArgument().setValue("/d");
  -        cmd.createArgument().setFile(destDir);
  +        if (destDir != null) {
  +            cmd.createArgument().setValue("/d");
  +            cmd.createArgument().setFile(destDir);
  +        }
  +        
           // Add the Classpath before the "internal" one.
           cmd.createArgument().setValue("/cp:p");
           cmd.createArgument().setPath(classpath);
  
  
  

Mime
View raw message