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 Java.java
Date Wed, 20 Sep 2000 15:07:54 GMT
bodewig     00/09/20 08:07:53

  Modified:    src/main/org/apache/tools/ant/taskdefs Java.java
  Log:
  Improved output and error checking in <java>.
  Submitted by:	Diane Holt <holtdl@yahoo.com>
  
  Revision  Changes    Path
  1.21      +12 -3     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Java.java
  
  Index: Java.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Java.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Java.java	2000/09/12 12:26:46	1.20
  +++ Java.java	2000/09/20 15:07:53	1.21
  @@ -103,13 +103,14 @@
        */
       public int executeJava() throws BuildException {
           String classname = cmdl.getClassname();
  -        log("Calling " + classname, Project.MSG_VERBOSE);
   
           if (classname == null) {
               throw new BuildException("Classname must not be null.");
           }
   
           if (fork) {
  +            log("Forking " + cmdl.toString(), Project.MSG_VERBOSE);
  +        
               return run(cmdl.getCommandline());
           } else {
               if (cmdl.getVmCommand().size() > 1) {
  @@ -118,7 +119,9 @@
               if (dir != null) {
                   log("Working directory ignored when same JVM is used.", Project.MSG_WARN);
               }
  -            
  +
  +            log("Running in same VM " + cmdl.getJavaCommand().toString(), 
  +                Project.MSG_VERBOSE);
               run(cmdl);
               return 0;
           }
  @@ -246,8 +249,14 @@
           
           
           exe.setAntRun(project);
  +
  +        if (dir == null) {
  +            dir = project.getBaseDir();
  +        } else if (!dir.exists() || !dir.isDirectory()) {
  +            throw new BuildException(dir.getAbsolutePath()+" is not a valid directory",
  +                                     location);
  +        }
   
  -        if (dir == null) dir = project.getBaseDir();
           exe.setWorkingDirectory(dir);
   
           exe.setCommandline(command);
  
  
  

Mime
View raw message