ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sbaill...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional ANTLR.java
Date Sat, 15 Dec 2001 00:27:16 GMT
sbailliez    01/12/14 16:27:16

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional ANTLR.java
  Log:
  Now catching the ExitException that can arise from
  running ANTLR in non-forked mode. It implies that
  the System Manager is overriden and trap System.exit()
  calls to throw an ExitException instead.
  
  Revision  Changes    Path
  1.5       +8 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java
  
  Index: ANTLR.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ANTLR.java	2001/11/18 15:59:18	1.4
  +++ ANTLR.java	2001/12/15 00:27:16	1.5
  @@ -63,6 +63,7 @@
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.BuildException;
  +import org.apache.tools.ant.ExitException;
   import org.apache.tools.ant.taskdefs.Execute;
   import org.apache.tools.ant.taskdefs.LogStreamHandler;
   import org.apache.tools.ant.taskdefs.ExecuteJava;
  @@ -196,7 +197,13 @@
                   ExecuteJava exe = new ExecuteJava();
                   exe.setJavaCommand(commandline.getJavaCommand());
                   exe.setClasspath(commandline.getClasspath());
  -                exe.execute(project);
  +                try {
  +                    exe.execute(project);
  +                } catch (ExitException e){
  +                    if ( e.getStatus() != 0 ){
  +                        throw new BuildException("ANTLR returned: " + e.getStatus(), location);
  +                    }
  +                }
               }
           }
       }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message