peterreilly 2004/01/22 11:00:49 Modified: src/main/org/apache/tools/ant Tag: ANT_16_BRANCH TaskAdapter.java Project.java Log: sync with head Revision Changes Path No revision No revision 1.23.2.1 +5 -1 ant/src/main/org/apache/tools/ant/TaskAdapter.java Index: TaskAdapter.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/TaskAdapter.java,v retrieving revision 1.23 retrieving revision 1.23.2.1 diff -u -r1.23 -r1.23.2.1 --- TaskAdapter.java 17 Jul 2003 11:04:16 -0000 1.23 +++ TaskAdapter.java 22 Jan 2004 19:00:49 -0000 1.23.2.1 @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2003 The Apache Software Foundation. All rights + * Copyright (c) 2000-2004 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -106,6 +106,10 @@ final String message = "No public execute() in " + taskClass; project.log(message, Project.MSG_ERR); throw new BuildException(message); + } catch (LinkageError e) { + String message = "Could not load " + taskClass + ": " + e; + project.log(message, Project.MSG_ERR); + throw new BuildException(message, e); } } 1.154.2.3 +17 -2 ant/src/main/org/apache/tools/ant/Project.java Index: Project.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Project.java,v retrieving revision 1.154.2.2 retrieving revision 1.154.2.3 diff -u -r1.154.2.2 -r1.154.2.3 --- Project.java 17 Dec 2003 15:59:04 -0000 1.154.2.2 +++ Project.java 22 Jan 2004 19:00:49 -0000 1.154.2.3 @@ -926,6 +926,10 @@ + taskClass; log(message, Project.MSG_ERR); throw new BuildException(message); + } catch (LinkageError e) { + String message = "Could not load " + taskClass + ": " + e; + log(message, Project.MSG_ERR); + throw new BuildException(message, e); } if (!Task.class.isAssignableFrom(taskClass)) { TaskAdapter.checkTaskClass(taskClass, this); @@ -1090,8 +1094,19 @@ */ public void executeTargets(Vector targetNames) throws BuildException { + BuildException thrownException = null; for (int i = 0; i < targetNames.size(); i++) { - executeTarget((String) targetNames.elementAt(i)); + try { + executeTarget((String) targetNames.elementAt(i)); + } catch (BuildException ex) { + if (!(keepGoingMode)) { + throw ex; // Throw further + } + thrownException = ex; + } + } + if (thrownException != null) { + throw thrownException; } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]