ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Java.java
Date Wed, 05 Jul 2000 15:24:29 GMT
conor       00/07/05 08:24:29

  Modified:    src/main/org/apache/tools/ant/taskdefs Java.java
  Log:
  Provide access to the return code of the JavaVM when it is forked.
  
  Revision  Changes    Path
  1.7       +12 -2     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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Java.java	2000/03/29 17:13:31	1.6
  +++ Java.java	2000/07/05 15:24:28	1.7
  @@ -76,7 +76,16 @@
        * Do the execution.
        */
       public void execute() throws BuildException {
  -        
  +        executeJava();
  +    }
  +
  +    /**
  +     * Do the execution and return a return code.
  +     *
  +     * @return the return code from the execute java cklass if it was executed in 
  +     * a separate VM (fork = "yes").
  +     */
  +    public int executeJava() throws BuildException {
           project.log("Calling " + classname, "java", project.MSG_VERBOSE);
   
           if (classname == null) {
  @@ -101,12 +110,13 @@
                   b.append(args);
               }
               
  -            run(b.toString());
  +            return run(b.toString());
           } else {
               Vector argList = tokenize(args);
               if (jvmargs != null) project.log("JVM args and classpath ignored when same
JVM is used.", "java", project.MSG_VERBOSE);
               project.log("Java args: " + argList.toString(), "java", project.MSG_VERBOSE);
               run(classname, argList);
  +            return 0;
           }
       }
   
  
  
  

Mime
View raw message