diff options
author | wisberg <wisberg> | 2002-12-18 21:35:17 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2002-12-18 21:35:17 +0000 |
commit | 91f0430dcae0c34e662a6ba65a0ead7d30625f3a (patch) | |
tree | d2431dc3955b152543090c55eb600258ae1fa2f7 /taskdefs/src | |
parent | 7cd6a97ee6a8884c4114a64265a21d3847aece7a (diff) | |
download | aspectj-91f0430dcae0c34e662a6ba65a0ead7d30625f3a.tar.gz aspectj-91f0430dcae0c34e662a6ba65a0ead7d30625f3a.zip |
suppressing info messages unless verbose
and rendering user-visible exceptions using Main
Diffstat (limited to 'taskdefs/src')
-rw-r--r-- | taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java b/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java index b6ed3c9eb..988836869 100644 --- a/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java +++ b/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java @@ -36,6 +36,7 @@ import org.aspectj.bridge.IMessageHolder; import org.aspectj.bridge.MessageHandler; import org.aspectj.tools.ajc.Main; import org.aspectj.tools.ajc.Main.MessagePrinter; +import org.aspectj.util.LangUtil; /** @@ -523,6 +524,8 @@ public class AjcTask extends MatchingTask { * Compile using ajc per settings. * This prints the messages in verbose or terse form * unless an IMessageHolder was set using setMessageHolder. + * This also renders Compiler exceptions with our header to System.err + * an rethrows a BuildException to be ignored. * @exception BuildException if the compilation has problems * or if there were compiler errors and failonerror is true. */ @@ -534,7 +537,10 @@ public class AjcTask extends MatchingTask { final IMessageHandler delegate = verbose ? MessagePrinter.VERBOSE: MessagePrinter.TERSE; mhandler.setInterceptor(delegate); - holder = mhandler; + if (!verbose) { + mhandler.ignore(IMessage.INFO); + } + holder = mhandler; numPreviousErrors = 0; } else { numPreviousErrors = holder.numMessages(IMessage.ERROR, true); @@ -566,7 +572,10 @@ public class AjcTask extends MatchingTask { } catch (BuildException e) { throw e; } catch (Throwable x) { - throw new BuildException("Thrown: ", x); + System.err.println(Main.renderExceptionForUser(x)); + throw new BuildException("IGNORE -- See " + + LangUtil.unqualifiedClassName(x) + + " rendered to System.err"); } } |