conor 00/06/24 09:01:08
Modified: src/main/org/apache/tools/ant Main.java Project.java
Log:
Remove System.exit calls.
These have been replaced by propagating BuildExceptions. This will allow ant
to be more easily used from GUIs, IDEs, etc
Revision Changes Path
1.9 +4 -4 jakarta-ant/src/main/org/apache/tools/ant/Main.java
Index: Main.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Main.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Main.java 2000/06/24 10:55:38 1.8
+++ Main.java 2000/06/24 16:01:07 1.9
@@ -106,7 +106,7 @@
new Main(args).runBuild();
}
- protected Main(String[] args) {
+ protected Main(String[] args) throws BuildException {
// cycle through given args
@@ -216,7 +216,7 @@
* Executes the build.
*/
- private void runBuild() {
+ private void runBuild() throws BuildException {
if (!readyToRun) {
return;
@@ -265,7 +265,7 @@
} else {
be.getException().printStackTrace();
}
- System.exit(1);
+ throw be;
}
// make sure that we have a target to execute
@@ -282,7 +282,7 @@
if (msgOutputLevel > Project.MSG_INFO) {
be.printStackTrace();
}
- System.exit(1);
+ throw be;
}
// track our stop time and let the user know how long things took.
1.22 +2 -4 jakarta-ant/src/main/org/apache/tools/ant/Project.java
Index: Project.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- Project.java 2000/06/24 10:55:39 1.21
+++ Project.java 2000/06/24 16:01:07 1.22
@@ -116,7 +116,7 @@
* This involves setting the default task definitions and loading the
* system properties.
*/
- public void init() {
+ public void init() throws BuildException {
detectJavaVersion();
String defs = "/org/apache/tools/ant/taskdefs/defaults.properties";
@@ -149,9 +149,7 @@
this.setProperty(name, value);
}
} catch (IOException ioe) {
- String msg = "Can't load default task list";
- System.out.println(msg);
- System.exit(1);
+ throw new BuildException("Can't load default task list");
}
}